Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Perl Programming Media Music

Live Nightclub Hacking 236

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."
This discussion has been archived. No new comments can be posted.

Live Nightclub Hacking

Comments Filter:
  • I like perl (Score:5, Interesting)

    by Slashbot Hive-Mind ( 810267 ) <slashbotofborg@hotmail.com> on Thursday September 02, 2004 @09:45AM (#10138071) Homepage Journal
    '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.
    • Re:I like perl (Score:2, Insightful)

      by Ignignot ( 782335 )
      Yeah um... I'm gunna go ahead and disagree with you on this one.

      The true value of any code is its current use combined with its reusability. Yes, it is nice to be able to write some code that does something useful quickly. But that code that can be used again and again is extremely valuable - and is especially valuable when other programmers can also reuse your code. Perl is hard to reuse when you wrote your own program. For someone else to understand it is a nightmare. And yes, I've written software
      • by Anonymous Coward on Thursday September 02, 2004 @10:24AM (#10138475)
        Guess I'm a genius for using modules from CPAN, and I didn't even know it.
      • Re:I like perl (Score:3, Insightful)

        the ability to read different programming languages is the same as being able to read different human languages. It's a matter of differing grammar, syntax and character notations. Not everyone can grasp chinese or russian or hebrew, but does that make them valueless languages? I didn't think so. You'll especially run into problems if you try and read/write chinese as if it were english, or perl as if it were C.
      • or something very well defined and documented

        Isn't that the same thing with all programs in any programming language? If you have an esoteric line with no comment around it to back up the twelve operations that its doing, then it is going to be confusing no matter what its written in.

        I think the thing with perl is that it can be almost too powerful for the amount of time that you have to put into writing a script, therefore if you only spend 5 minutes writing it and it would take you 10 minutes to write
      • As a prior poster already commented on CPAN is a paragon of code reusability. I never program anything significant without relying on someone elses work via use of a CPAN modules.

        Only assembly rivals perl in incomprehensibility

        Uh! Perl is on the other end of the spectrum from assembly.

        I place Perl on the same tier as Matlab (or Octave). If you are working with vectors of numbers use Matlab if you working with strings use Perl.

        It seems that there is alway a segment of the population that knee jerks
        • It seems that there is alway a segment of the population that knee jerks about Perl poor maintainability but they never really provide good examples or specifics - it is always their "informed opinion".

          Probably because any time there's a discussion like this, posts talking about real-life perl issues rapidly get modded -1 Flamebait [slashdot.org].
      • Comment removed based on user account deletion
    • Re:I like perl (Score:2, Informative)

      by jallen02 ( 124384 )
      Though, think about the thousands of little Perl scripts that do this and that, each one using some little syntax trick or another. The end result is that to REALLY understand all the scripts out there you have to basically learn all of the dialects of Perl. Its like learning several child languages that are all a part of this twisted parent language. It kills me to have to remember syntax rules like that.

      Compare that to almost any python script out there. The syntax is the same, the program can still "do
    • Re:I like perl (Score:2, Insightful)

      by maximilln ( 654768 )
      It might as well be a strict-typed language and barf on an expression such as "2" + 2!

      That's my personal preference. I don't want the language that I use to try and make assumptions about what to do with the combination of different types of variables. As a programmer I feel that it enforces a valid and advantageous logic of purism when the language requires that the programmer be constantly aware of delineations between variable types. This mindset encourages the programmer to constantly think about w
    • Bah! (Score:2, Interesting)

      by BarryNorton ( 778694 )
      Imagine what one could do with a real language... http://haskell.org/libraries/#music [haskell.org]
    • 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

  • hmm (Score:5, Insightful)

    by TedCheshireAcad ( 311748 ) <ted@fUMLAUTc.rit.edu minus punct> on Thursday September 02, 2004 @09:45AM (#10138074) Homepage
    I usually go to nightclubs to dance and meet women, but I guess this is the Slashdot Way.
  • Why not? (Score:5, Funny)

    by arose ( 644256 ) on Thursday September 02, 2004 @09:46AM (#10138079)
    What else would a geek do in a nightclub?
    • ...dance? ...Meet women?

      I mean, a nightclub is an essentially dark room with flashing lights and some music where you're free to go dance with girls anonymously.

      It's all a self-esteem thing. Just go dance. You'll enjoy it.
  • Hmmmm.. (Score:3, Funny)

    by maggeth ( 793549 ) on Thursday September 02, 2004 @09:47AM (#10138093)
    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

  • white boy (Score:5, Funny)

    by smaksly ( 751439 ) on Thursday September 02, 2004 @09:47AM (#10138103)
    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
  • by not_a_product_id ( 604278 ) on Thursday September 02, 2004 @09:50AM (#10138136) Journal
    geek gets into a night club with real live women and what does he do? He programs perl. jeez
    • > geek gets into a night club with real live women and what does he do? He programs perl. jeez

      Geek gets into nightclub, gets paid to program perl! And all you want to do is talk to the humans. WTF? :)

    • Re:You blew it man (Score:3, Insightful)

      by Alsee ( 515537 )
      Good joke, but on the seirous side this guy *is* up on stage in front of throngs of dancing women. Hot stimulated women, in a room saturated with pheromones to boot. In a sense the DJ is Alpha Male of the club. Alpha Male, ding ding ding!

      I'm a geek's geek. I was head of my highschool chess team. I was embarassingly old when I had my first date. I nearly max out the introvert scale on personality tests. But let me tell you from experience, when you wind up in Alpha Male position of a social event none of th
    • You're supposed to give her a PEARL necklace.
  • by Gopal.V ( 532678 ) on Thursday September 02, 2004 @09:53AM (#10138166) Homepage Journal
    > Alex programmes live on stage to perform his music

    Did he actually mean , "Alex performs live on stage to program his music" or did he mean the other way around ?
    • He writes code, live on stage, within an existing framework which interprets the code as he types it and that makes the music.

      So he performs his music by programming it live on stage. If that helps.
      • He writes code, live on stage, within an existing framework which interprets the code as he types it and that makes the music.

        So he presses keys in various combinations and the program interprets this as notes or chords, the combined whole being called music (depending on how drunk/musical you are)?
        Hmmmm. Isn't that rather what a piano does?

        • by andrew_0812 ( 592089 ) on Thursday September 02, 2004 @10:43AM (#10138681)
          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.
  • by ryg0r ( 699756 ) on Thursday September 02, 2004 @09:55AM (#10138177)
    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.

    • I'm not having a go here, but by your logic the only real musicians are those who make music using only their own bodies: to you, Jimi Hendrix was only a singer - his guitar skill was meaningless as it was the guitar that made the noise, not Jimi. Miles Davis was a talentless hack and The Beatles were a mediocre a capella band ;)

      True, the guy is coding the software that makes the music, but if he didn't code it exactly the way he did, the music would be substantially different. The same way a musician ha

    • 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.

      Don't people want to actually see the person on stage actually doing something live though? Music performed by computers sounds all well and good, but watching a computer do something isn't very interesting. Bring on the modulars [google.com] :)

      (Shameless plug for my free music [beautifulfreak.net] in Ogg Vorbis format)

    • It is now the result of a script that is the result of a persons creativity. What difference does it make? What matters is the result, and the result will still depend on the composers ability to manipulate the music, whether that is done by playing directly on an instrument or modifying a program to change the way the program plays the instruments.

      Besides composition has always been highly rule based, and even classics like Mozart toyed with generative music. There's a lot of music out there that is clea

  • by Anonymous Coward on Thursday September 02, 2004 @09:58AM (#10138215)
    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.
  • by wackysootroom ( 243310 ) on Thursday September 02, 2004 @09:59AM (#10138223) Homepage
    You can take the geek out of the nightclub, but you can't take the nightclub out of the geek.
  • Not sure about hacking Perl in nightclubs, but I did drink a fifth of gin while trying to debug a friend's Perl script.
    Kind of like a Dantean descent into hell it was...
  • by Greenisus ( 262784 ) <michael@mayoGIRA ... minus herbivore> on Thursday September 02, 2004 @10:01AM (#10138250) Homepage
    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.
  • by mo^ ( 150717 )
    She Stands up when she plays the Piano... In a night club...

    Yah, Perl, night club.... Elkie did it first!
  • by Trepidity ( 597 ) <delirium-slashdot@@@hackish...org> on Thursday September 02, 2004 @10:01AM (#10138255)
    ChucK [princeton.edu] is a "concurrent, on-the-fly audio programming language", designed from the ground up precisely for this application: live programming of generative music.
  • Unbelievable (Score:2, Interesting)

    What no one has touched on is that coding, hard in and of itself, and writing music on the fly, also very hard, and doing it live leaves no margin of error.
    What if he makes a keystroke error? Wouldn't that have the possibility of destroying his whole set?
    This is just too incredible for words.
    • Re:Unbelievable (Score:4, Informative)

      by yaxu ( 637556 ) on Thursday September 02, 2004 @10:13AM (#10138371)
      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!
  • Patterns (Score:3, Interesting)

    by UncleBiggims ( 526644 ) on Thursday September 02, 2004 @10:06AM (#10138299)

    A good friend of mine often compares programming to music. He studied jazz improvistion at the college level and is now a programmer... so I feel like he has a good insight into this sort of thing. One quote that really made sense to me was, "Traditional jazz improvisation is all about trying to fit creative and spontaneous music composition on top of somewhat predictable chord progressions."

    This is what many programmers try to do... develop creative solutions using predictable software design patterns. I guess Alex Mclean has found a way to be creative AND spontaneous with his coding.
  • I was hired to write a program to parse and modify some Postscript files. Perl was the obvious choice. So I learned Perl for the job, wrote the script, etc...

    As you may know, Perl can be very unreadable and I don't write unreadable code. It was all broken down into functions etc.., all fully commented. Probably slow, but we didn't care, it was maintainable.

    So years pass, a friend is learning Perl so I show it to her. Her first comment was, "That doesn't look like the Perl the guys write at work!"

  • 1) You do not talk about nightclub :)
  • Note... (Score:2, Informative)

    ...that the article is all about the modules you can use to generate sounds from Perl (which isn't clear if you don't read it - the Nightclub + Perl Programming idea is way overemphazised in the original post...)
  • by twoshortplanks ( 124523 ) on Thursday September 02, 2004 @10:13AM (#10138367) Homepage
    Alex will be giving the London Perl Mongers [pm.org] 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 [pm.org] for our monthly social tonight.

    Slashdot, your local friendly pub invite list.

    • Full details have now been finalised. We're meeting at BUPA House near Holborn.

      Find out more (including how to sign up so you can attend) from the message [pm.org] I posted to the London.pm mailing list.

      See you there (if not in the pub tonight).

  • by nanojath ( 265940 ) on Thursday September 02, 2004 @10:27AM (#10138493) Homepage Journal
    Alex programmes live on stage

    Programmes? Programmes? By god I smell a limey in our midst! Get 'im!
    • On TV, I watch programmes; at a football match, I might buy a programme. But on a computer, I run programs.

      Similarly, my back would be in great pain were I to slip a disc, but in /etc/fstab I mount disks.

      I'm happy enough to use the American spelling for computer jargon; that usage evolved in America, and so the older British spellings do not necessarily hold.

      • Indeed, I would not write a "computer programme". As for disc/disk - it was my belief that disc was for any round object (e.g. compact disc), but computer hard drives were hard disks. BTW, you can tell you program graphics too much if you start trying to use "color" everywhere, the US spelling being prevalent in all programming.
  • Me too (Score:5, Funny)

    by TheCrunch ( 179188 ) on Thursday September 02, 2004 @10:32AM (#10138553) Homepage
    I've been doing this for ages. I tried Techno but my code usually generates Blues.

    Well.. bluescreens.

    sorry.
  • Geek DJ meets girl, but she's not like the dance floor... Geek DJ's not used to prolonged "hard coding" ha ha ha, et al.
  • Use CSOUND (Score:3, Interesting)

    by adam872 ( 652411 ) on Thursday September 02, 2004 @10:50AM (#10138779)
    Real men use CSOUND for "programmed music" :)

    Seriously, csound is designed as a programming language for music and is phenominally powerful and can be used in real time. If I were hacking code for music onstage, that is what I would use. Having said that, I'd rather use my guitar or synth(s) as they are the ultimate in "live composition" instruments...
    • From the article:

      Software synthesizers are now commonplace and reliable, thanks to the increasing speed of computers and improving latency times of operating systems including the Linux kernel. Most music software is still controllable by MIDI, but for a faster and more modern alternative, have a look at Open Sound Control (OSC).

      OSC is an open network protocol for music, and is well supported by the best free software music applications including pure-data, SuperCollider and CSound.

      So in fact he could

  • "I've found the experiences of dancing and programming to have a great deal in common."

    Then either your dancing or your programming needs some serious help.
  • Any chance of an MP3 link?
    (maybe later when the risk of /. effect subsides?)
  • by Kalak ( 260968 ) on Thursday September 02, 2004 @11:07AM (#10139025) Homepage Journal
    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.
  • So, live programming of music...

    That must have been what Lewis was doing on that TRS-80 at the end of Revenge of the Nerds, in the talent contest, as he was working the keys so fast.
  • Hack Freebird!!!
  • by babbage ( 61057 ) <cdeversNO@SPAMcis.usouthal.edu> on Thursday September 02, 2004 @11:25AM (#10139266) Homepage Journal
    Alex McLean and Ade Ward have been performing live Perl music under the name Slub [slub.org] for several years now. Quoting from Alex's website [yaxu.org]:
    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 [signwave.co.uk].

  • That guy needs to get out more...er..stay in more...er never mind.
  • When reading this article, did anybody else get the song from the Strong Bad "Techno" email start playing in their head? Because when he starts talking about "programming" a song live, that is how I imagine it must sound like. :)

  • Error in article (Score:2, Insightful)

    by djfray ( 803421 )
    The article says that all modern musicians make their music on the computer. Certainly, this is true to a certain degree for electronic musicians(techno and the like), though I dabble in this and I often find myself sitting at my Grand Piano when working on a riff. Computers play a large part in recording of modern music, but I think you'll find that physical instruments still play an enormous role in it.
  • So, uhm, now I've read two pages about how someone hacks up music in perl. But I still have no idea what it sounds like. Anyone have a link?
  • well, this explains the groupies at work...
  • If this guys codes live in front of an audience, I'm guessing he's not really big on code reuse.

    "Thank you, thank you, I'll be typing in this same function all week..."

BLISS is ignorance.

Working...