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."
C makes it easy for you to shoot yourself in the foot. C++ makes that harder, but when you do, it blows away your whole leg. -- Bjarne Stroustrup
I like perl (Score:5, Interesting)
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)
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
Perl code is hard to re-use, huh? (Score:5, Funny)
Re:I like perl (Score:3, Insightful)
Re:I like perl (Score:2)
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
Re:I like perl (Score:2)
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
Re:I like perl (Score:2)
Probably because any time there's a discussion like this, posts talking about real-life perl issues rapidly get modded -1 Flamebait [slashdot.org].
Re: (Score:2)
Re:I like perl (Score:2)
Second - I'm sure that many of you can post the answer. That's not why I'm posted this - I've moved on and its not a huge deal. Just for the record so you don't feel that I'm asking for code help by complaining about something (although that's probably a very effective way to do so...)
Re:I like perl (Score:3, Interesting)
@lst = sort { $a $b } @unsorted_lst;
Or the 30 or so lines of code it would take to do the equivalent sort in C?
Re:I like perl (Score:3, Insightful)
Re:I like perl (Score:2, Informative)
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)
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
Re:I like perl (Score:2, Interesting)
I don't see that as a bad thing. Writing routines to draw boxes, circles, requesters, dialogs, or windows is a significant load on programmers. Eventually programmers created libraries such as the svgalibs and evolved towards X11. X11 inherited additional functionality through interfaces such as GTK, Qt, GDK, KDE libs, or whatever Windows uses. The area isn't really my forte but it shows that i
Bah! (Score:2, Interesting)
Re:I like perl (Score:2)
hmm (Score:5, Insightful)
Re:hmm... Perl in a **nightclub** (Score:5, Funny)
I do not think that word means what you think it means...
-- james
Re:hmm... Perl in a **nightclub** (Score:2)
I'm so old that in my world Perl's a singer, and as I recall, she stands up when she plays the piano.
Re:hmm... Perl in a **nightclub** (Score:3)
Nightclub in North America == discotheque
Nightclub in Europe == Nudie bar
Found out the 'hard' way in Austria.
Re:hmm... Perl in a **nightclub** (Score:2)
Re:WTF are you talking about (Score:2)
Re:hmm (Score:5, Funny)
Why not? (Score:5, Funny)
uhh... (Score:2)
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)
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
Re:Hmmmm.. (Score:5, Funny)
The Slashbot Collective Hivemind
white boy (Score:5, Funny)
@P=split//,".URRUU\c8R";@d=split//,"\nrekc
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^
close$_}%p;wait until$?;map{/^r/&&}%p;$_=$d[$q];sleep rand(2)if/\S/;print
till you die
Re:white boy (Score:5, Funny)
Execution of white boy aborted due to compilation errors.
Old CS Student Trick (Score:2)
Classmate of mine convinced a teacher to give him full credit and the rest of us who traced the stupid code, ADA by the way, -1 for not reading closely enough.
Re:white boy (Score:4, Informative)
@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;($
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q]; sleep rand(2)if/\S/;print
Re:white boy (Score:2)
You blew it man (Score:5, Funny)
Re:You blew it man (Score:2)
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)
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
Re:You blew it man (Score:2)
Re:You blew it man (Score:2)
Alex performs live on stage to program his music ? (Score:3, Interesting)
Did he actually mean , "Alex performs live on stage to program his music" or did he mean the other way around ?
Re:Alex performs live on stage to program his musi (Score:2, Informative)
So he performs his music by programming it live on stage. If that helps.
Re:Alex performs live on stage to program his musi (Score:3, Insightful)
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?
Re:Alex performs live on stage to program his musi (Score:5, Informative)
I don't know about programming on stage, but the concept of synthesizing music in perl is quite interesting.
Music and programming (Score:3, Insightful)
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.
Re:Music and programming (Score:3, Insightful)
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
Re:Music and programming (Score:2)
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)
Re:Music and programming (Score:2, Informative)
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
Obligatory Swordfish Reference (Score:3, Funny)
Just goes to show (Score:4, Funny)
Re:Just goes to show (Score:4, Funny)
I prefer: You can lead a geek to a nightclub, but you can't make him get a life.
Doug
Drinkin' and Codin' (Score:2, Funny)
Kind of like a Dantean descent into hell it was...
I Do Both, But Not Simultaneously (Score:5, Interesting)
Re:I Do Both, But Not Simultaneously (Score:3, Informative)
Re:I Do Both, But Not Simultaneously (Score:2)
DJ Medieval
Re:I Do Both, But Not Simultaneously (Score:2)
But, seriously, I've been looking at the replies to my original post, and it further solidifies my belief that most DJs are too concerned with the technical side and not enough with the programming (choosing material) side.
When I first started bringing a laptop, I thought it might b
Perl's a Singer (Score:2, Funny)
Yah, Perl, night club.... Elkie did it first!
There are better languages for this, like ChucK (Score:5, Informative)
Re:There are better languages for this, like ChucK (Score:2)
Can't wait to waste a few hours trying this out.
Re:There are better languages for this, like ChucK (Score:2)
...and if you want to write regular, non-live electronic music, try the language Csound [csounds.com].
Re: (Score:2)
Unbelievable (Score:2, Interesting)
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)
Patterns (Score:3, Interesting)
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.Re:Patterns (Score:2)
OK, its late, the Reactor is about to go critical, and you have a couple of minutes to find the fault.
... and you didn't write it - enough with the fear already!
You discover its in some Perl code - There's the trepidation for you.
Re:Patterns (Score:3, Insightful)
I would imagine you have an equal chance of doing that coding it in Perl as you would have writing a score for an Orchestra or plucking the strings of an electric guitar. All those are methods of making music but in the end it's only the music which counts.
Re:Patterns (Score:2)
"Structured" Perl (Score:2, Interesting)
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!"
The first rule of Nightclub (Score:2)
Re:The first rule of Nightclub (Score:2)
Wait, that doesn't make any sense.
Note... (Score:2, Informative)
Alex Giving a Talk in London a Week Today (Score:5, Interesting)
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 (Score:2)
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).
Waitaminnit... (Score:3, Funny)
Programmes? Programmes? By god I smell a limey in our midst! Get 'im!
Re:Waitaminnit... (Score:2)
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.
Re:Waitaminnit... (Score:2)
Me too (Score:5, Funny)
Well.. bluescreens.
sorry.
and now, the deluge of "hard coded" jokes (Score:2)
Use CSOUND (Score:3, Interesting)
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...
Re:Use CSOUND (Score:2)
So in fact he could
Re:Use CSOUND (Score:2)
Lost me at the first sentence (Score:2, Funny)
Then either your dancing or your programming needs some serious help.
So let's hear it... (Score:2)
(maybe later when the risk of
INAPH and have don't have MIDI (Score:4, Interesting)
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.
Nerds ahead of their time... (Score:2)
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.
Freebird (Score:2)
Alex has been doing this for years (Score:5, Informative)
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].
Ohhhmygod (Score:2)
Strong Bad's "techno" song... (Score:2)
Error in article (Score:2, Insightful)
This is cool but... (Score:2)
mp3? (Score:2)
live programming performances? (Score:2)
Code reuse (Score:2)
"Thank you, thank you, I'll be typing in this same function all week..."
more like (Score:3, Funny)
Re:I swear to God... (Score:5, Funny)
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
Re:Perl (Score:5, Informative)
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)
Re:Perl (Score:2)
The text file itself is only a script. The script + interpreter is a full program.
Surely by that definition, script + interpreter + kernel is a full program? You can't boot the interpreter direct, unless you're running a BBC Micro or something... It's GNU/Linux, not just GNU ;-)
Not-so-obligatory Short Circuit quote (Score:2)
Re:Perl (Score:2)
By that logic, you would also have to include the operating system and libraries. Note that the definition you cited says nothing about
INSIGHTFUL ?!? (Score:2)
God damnit. I love Slashdot.
--LordPixie
Re:One Hit Too Many of Ecstasy (Score:2)
Gimme a break, aren't we deeply seated in "the future"? I figure, everything has evolved due to tech, especially music. These guys [lightsuit.com] have made some rather interesting displays with LEDs. I've been to their parties, and some of the music that I've seen there is stuff you don't see in a nightclub -- video scratching, accelerometers coupled to synths and other gadgetry, stuff I've never seen before or heard of, and only just kinda won
Re:One Hit Too Many of Ecstasy (Score:2)
I almost agree with you there if you are thinking about some "Dave-Double-Decks" wedding DJ, but if you are talking about some of the (not so) new breed of superstar DJ's who mix tunes and beats to improve on originals and move into live mixing that is more akin to sampling, then I would have to go blow my whistle with the "disagree" crowd.