Slashdot Mirror


Live Nightclub Hacking

rjjm writes "Alex Mclean has written a stormin' article at perl.com on Hacking Perl In Nightclubs. Alex programmes live on stage to perform his music."

27 of 236 comments (clear)

  1. I like perl by Slashbot+Hive-Mind · · Score: 5, Interesting

    'm going to stick my neck out and say I like Perl -- so I think this is good news. However, I've always thought of Perl as a text-processing language, and In My Limited Experience, mobile phones can only fit about ten words on the screen. {on the other hand, this could simply lead to phones with bigger screens.}

    There's no denying that you can write really ugly code in Perl, but you can also write beautiul code in Perl. I think some of the people who knock Perl are confusing "undisciplined" with "not anal retentive". Perl was always based around the idea of serving the end rather than the means -- it's about where you're at, rather than how you got there. It does not impose a particular style on the programmer. Thus, for any given task, there could be many, many ways to accomplish it in Perl.

    They're all right.

    Some will be faster than others, some will use fewer resources than others, some will look prettier then others when viewed as source. But if you don't care enough about those things to mention them in the design spec, then they don't matter.

    Now, you can have your fancy object-oriented stuff, but in many ways it's overkill. For instance, if you needed to write a programme involving geometry, you could create an Angle object which would have a value assumed to be in radians and properties for its sine, cosine, tangent and representation in degrees; a Distance object which would have properties for its representation in different measuring units; and assigning a value to any property would affect the object and therefore its other properties. It might be beautiful if you like the OO concept, but it's a bit overkill if you just want to find the missing side of a triangle.

    And does a "disposable" programme -- one that you will run only a few times before forgetting it forever -- really need to look pretty anyway?

    As for PHP, well, it really isn't much different from Perl -- apart from always needing to put brackets around function parameters, the fact that all variables start with a $ sign whether scalar, array or hash and there is no $_. {I happen to love $_. It goes nicely with the concept of an accumulator. If you never did any assembly language, you probably won't know what I'm talking about, though}. That is hardly surprising, because the original PHP was actually written in Perl to be like a kind of subset of Perl.

    Also, one of my little niggles -- and I freely admit that this is just my own opinion -- is the inability to get on with any language that uses the plus sign as the string concatenation operator while letting you freely mix string and numberic variables. {*cough* ruby *cough*} I expect "2" + 2 to equal 4, not 22. Hell, if I have to do something to my variables before I can add them, that just nullified the advantage of having freely-mixable scalar types! It might as well be a strict-typed language and barf on an expression such as "2" + 2!

    As for Python - well, it's not my cup of tea {I guess you like either Perl or Python} but other people seem to have written some pretty good stuff in it, so I shan't knock it.

    --

    --
    We are the collective Slashbot HiveMind
  2. hmm by TedCheshireAcad · · Score: 5, Insightful

    I usually go to nightclubs to dance and meet women, but I guess this is the Slashdot Way.

    1. Re:hmm by PorscheDriver · · Score: 5, Funny

      I go to nightclubs to to dance and get rejected by women, but I guess this is the Slashdot way.

      --
      "This is your life, and it's ending one second at a time."
  3. Why not? by arose · · Score: 4, Funny

    What else would a geek do in a nightclub?

    --
    Analogies don't equal equalities, they are merely somewhat analogous.
  4. Hmmmm.. by maggeth · · Score: 3, Funny
    I've found the experiences of dancing and programming to have a great deal in common.

    Why not just say, "I hate dancing, but want to get laid eventually, and just hang around nightclubs hoping that some chick is drunk enough to not notice?"

    Well, TFA is interesting if you're into music composition in any case. :D

    1. Re:Hmmmm.. by Slashbot+Hive-Mind · · Score: 5, Funny

      We are confused. What is this 'chick' you speak off?

      The Slashbot Collective Hivemind

      --

      --
      We are the collective Slashbot HiveMind
  5. white boy by smaksly · · Score: 5, Funny

    play that funky
    @P=split//,".URRUU\c8R";@d=split//,"\nrekca h xinU / lreP rehtona tsuJ";sub p{
    @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q *=2) +=$f=!fork;map{$P=$P[$f^ord
    ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[ P.]/&&
    close$_}%p;wait until$?;map{/^r/&&}%p;$_=$d[$q];sleep rand(2)if/\S/;print

    till you die

    1. Re:white boy by Walterk · · Score: 5, Funny

      syntax error at - line 4, near "&&}"
      Execution of white boy aborted due to compilation errors.

    2. Re:white boy by simcop2387 · · Score: 4, Informative

      slashdot mangled this perl script, and the geek that i am, figured i'd make some music and fix it:)

      @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
      @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q *=2) +=$f=!fork;map{$P=$P[$f^ord
      ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[ P.]/&&
      close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q]; sleep rand(2)if/\S/;print

  6. You blew it man by not_a_product_id · · Score: 5, Funny

    geek gets into a night club with real live women and what does he do? He programs perl. jeez

    --

    ---
    We spoke for about a half an hour. I don't recall a thing we said. - Colorblind James Experience

  7. Music and programming by ryg0r · · Score: 3, Insightful
    IAAMP (am a music producer) and I find that if you want to perform really well at a nite club to get the crowd rocking, you give them what they want - its as simple as that. Supply and demand.

    Think of the dance floor as a high maintenance lover. When you bring on the goods, you'll be rewarded well.

    Now back to the subject. I can understand that you can use perl to create some interesting musical results. But instead of music being written by a persons creativity, its now a result of a script.

    I dunno, I'm undecided on the issue, but it seems like a cop-out, rather than an advancement in the way the musicians write/create tunes.

    The best way to perform for your lover is with V1@GrA - used by DJ's all around the globe.

    --
    Karma whoring .sigs don't work
  8. Re:hmm... Perl in a **nightclub** by hype7 · · Score: 5, Funny

    perl in a nightclub?

    I do not think that word means what you think it means...

    -- james

  9. more like by schmu_20mol · · Score: 3, Funny

    #!/usr/bin/perl print "YMCA\n";

    --
    "Nae Kin! Nae Quin! Nae laird! Nae master! We willna be fooled again!"
  10. Obligatory Swordfish Reference by Anonymous Coward · · Score: 3, Funny

    What better place than a nightclub to crack 1024 bit encryption at gunpoint while having a 60-second sexual relation (depending on the defintion of "is" and "sex") with a beautiful woman.

  11. Just goes to show by wackysootroom · · Score: 4, Funny

    You can take the geek out of the nightclub, but you can't take the nightclub out of the geek.

    1. Re:Just goes to show by duggy_92127 · · Score: 3, Funny

      I prefer: You can lead a geek to a nightclub, but you can't make him get a life.

      Doug

  12. I Do Both, But Not Simultaneously by Greenisus · · Score: 4, Interesting

    I am a software developer by day, and DJ at a night club by night. The idea of programming live is really cool to me, but when I'm DJing with my computer, I'm scared to run anything other than the DJ software, because I can't have ANY lag. I do, however, write software at home to help my DJ gigs.

  13. There are better languages for this, like ChucK by Trepidity · · Score: 5, Informative

    ChucK is a "concurrent, on-the-fly audio programming language", designed from the ground up precisely for this application: live programming of generative music.

  14. Re:I swear to God... by Ignignot · · Score: 4, Funny

    Since you sir, have made the first hack the planet joke, you are now contractually obligated to fulfill your promise because:

    1)You have met and are currently co-located with yourself.

    You are the first person to make a "Hack the Planet" joke.

    Therefore, it is your duty and task to kick your ass forthwith.

    Yours truly,
    Ignignot

    --
    I submitted this story last night, and it didn't get posted.
  15. Alex Giving a Talk in London a Week Today by twoshortplanks · · Score: 4, Interesting
    Alex will be giving the London Perl Mongers a talk (and live demo) on his work in the evening of Thursday 9th September in central London. It's our normal technical meeting and alongside Alex, we'll be featuring talks by Simon Cozens (the current perl.com editor), Tom Husins, and I'll be talking about Perl Testing project.

    I'm just working thought the details of the venue now and I'll post a follow up to this thread once I've sorted them out. As always, we're pleased to welcome new faces. Oh, and if anyone wants, they can pop along to the pub for our monthly social tonight.

    Slashdot, your local friendly pub invite list.

    --
    -- Sorry, I can't think of anything funny to say here.
  16. Re:Unbelievable by yaxu · · Score: 4, Informative

    If I may comment as the author of the article... It's not that dangerous, to be honest. I make a change, then press ctrl-x, which re-interprets the code into a dummy 'package.' If that doesn't cause compile-time errors, then it interprets the code into the live 'package.' So all I have to worry about is run-time errors, which are pretty rare. As I'm generally running a lot of scripts at the same time, it doesn't matter if one of them drops out or goes mental. In fact, it usually sounds good. I just have to fix it, then break it again, then fix it again to make it sound intentional!

  17. Re:Perl by Anonymous Coward · · Score: 5, Informative

    Incorrect.

    cogsci.princeton.edu -
    Program - a sequence of instructions that a computer can interpret and execute;

    The text file itself is only a script. The script + interpreter is a full program (also worth nothing that several people have whipped up programs that allows you to compile Perl scripts in to native binaries)

  18. Perl code is hard to re-use, huh? by Anonymous Coward · · Score: 5, Funny

    Guess I'm a genius for using modules from CPAN, and I didn't even know it.

  19. Me too by TheCrunch · · Score: 4, Funny

    I've been doing this for ages. I tried Techno but my code usually generates Blues.

    Well.. bluescreens.

    sorry.

    --
    My life is one big siesta in which I'm dreaming I wished my life was one big siesta.
  20. Re:Alex performs live on stage to program his musi by andrew_0812 · · Score: 4, Informative

    No, if you would bother to RTFA, you would see that he is has written a multi-threadded text editor for writing perl. One thread is the editor, the other thread runs the code constantly. He writes perl code to generate musical patters. He has a system set up so that he can have multiple programmers working at the same time and it will all be in sync, you can even change the temp and all programs will sync up.

    I don't know about programming on stage, but the concept of synthesizing music in perl is quite interesting.

  21. INAPH and have don't have MIDI by Kalak · · Score: 3, Interesting

    INAPH, but I'm curious to experience the music. Since I live in BFE, I'm not likely to go to any perl hacking nightclubs (plus, married with 2 kinds, who am I kidding, I'm not going to any nightclubs).

    I want to hear the music!

    Talking about audio w/o at least a sample is like talking code w/o a Hello World at least. So some perl hacker out there want to take his code snippets and to the right thing and put a MIDI file up somewhere for us to listen to? mp3?

    Don't make me get curious enough to dive into Perl for fun. I do too much coding at work, and I don't want to be a coder at home.

    --
    I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
  22. Alex has been doing this for years by babbage · · Score: 4, Informative
    Alex McLean and Ade Ward have been performing live Perl music under the name Slub for several years now. Quoting from Alex's website:
    Behind the scenes, slub is a fairly idealistic project. We make music using entirely self-written software. Every aspect of slub composition and synthesis comes from our fingers. Many interoperating pieces of software work together to generate the music live, using a handmade client/server protocol. The software sampler/synth is written in C (by Ade), the server and synch code is in Perl (by me) and a whole slew of composition scripts and apps are written in Perl and RealBasic. The whole system is distributed across Ade's powerbook and my debian Linux laptop (we stopped short of writing our own operating system).

    Poke around and you can probably find MP3s of their music -- it's interesting stuff.

    In addition, the two of them have written some papers & software on the programmatic generation of art, whether that be music, graphic arts, software itself, etc:

    Much more of Ade's software is available from Signwave.co.uk.