top | item 11033953

Aerodynamic by Daft-Punk in 100 lines of code with Sonic Pi

379 points| edouardb | 10 years ago |aimxhaisse.com

69 comments

order
[+] datajeroen|10 years ago|reply
[+] runeb|10 years ago|reply
Warning; turn down your volume before clicking on these examples. I'm pretty sure my tinnitus got worse just now :(
[+] yaxu|10 years ago|reply
Genuinely interested - what makes this stuff more 'hacker' than the original post? I don't see it.
[+] justinclift|10 years ago|reply
You're using GitHub for hosting a straight out commercial advert? That seems... not positive. :(
[+] mitchtbaum|10 years ago|reply
Very cool.

Why do you modify your code as it plays? Could you simplify and abstract your expressions to call them along a predictable flow pattern? This reminds me of Knuth's beautiful representation of recurrence relations: https://en.wikipedia.org/wiki/The_Complexity_of_Songs

(Aside: His later work on Constraint Based Music Composition https://news.ycombinator.com/item?id=9512962 also offers some interesting insight as to what could come from algorithmic musical composition.)

[+] samaaron|10 years ago|reply
You don't need to modify your code as it plays. However, if you do you turn what's a more traditional composition style workflow into a much more exciting, expressive performance workflow.

When I gig with Sonic Pi all I do is modify the code on-the-fly. It allows me to react to the crowd, the environment and my feelings :-)

[+] nibnib|10 years ago|reply
As well as including an aspect of live performance this is the most natural way to experiment and try ideas in music. Changes are best heard in immediate context.

It's a case where the Edit, Compile, Run Cycle doesn't fit the medium well :)

[+] moomin|10 years ago|reply
The answer's cultural: it's part of music live-coding. You work with some pre-prepared bits and construct them on the fly. A bit like... how Daft Punk performed live. (Although they used Ableton Live, I believe.)
[+] samaaron|10 years ago|reply
Great work with the tutorial! Thanks for jamming with Sonic Pi and sharing the live coding love <3 <3
[+] aimxhaisse|10 years ago|reply
Thanks a lot for Sonic Pi and Overtone!
[+] jsingleton|10 years ago|reply
FYI there's a regular feature on Sonic Pi (by the creator) in the official magazine. It's usually the only article in Ruby as the rest are normally in Python.

It's a free PDF download but you can buy it to support them: https://www.raspberrypi.org/magpi

See page 48 (page 50 of the PDF): https://www.raspberrypi.org/magpi-issues/MagPi42.pdf

[+] justinclift|10 years ago|reply
Yeah, I wish the language syntax in Sonic Pi was less Ruby, more Python. But, seriously disliking Ruby is just a personal hangup. ;)
[+] baldfat|10 years ago|reply
Here is the video from OSCON in Amsterdam with the creator of Sonic Pi - https://www.youtube.com/watch?v=ENfyOndcvP0

He is a very good speaker and got me excited to try to do some of this with my 9 year old daughter.

[+] noir_lord|10 years ago|reply
Agreed, for a short presentation that was one of the best speakers I've seen, he mentions he works at a university in front of students so perhaps he is comfortable in front of crowds and that combined with his obvious passion for the subject shines through.

Wish I spoke that well, I'm not bad anymore but I'm also not that fluid.

[+] duncanawoods|10 years ago|reply
I'm interested in taking a closer look at one of Sonic Pi, Supercollider, WavePot, Chuck, CSound etc.

Can anyone suggest how to choose which one to invest some time in?

[+] gosub|10 years ago|reply
I am a SuperCollider fan, too. For me it's the sweet spot between a modern programming language and a deep and performant synthesis/sequencing platform. SonicPi is perfect if you wan to start making music immediately, but consider that underneath is just another language interface for the supercollider synth server, so at some point you will want to go full SC, that is dialect of Smalltalk with some functional ideas. CSound is the oldest/most powerful/most frustating of the bunch, but at the core is composed of two parts: a description of the sound generators/effects graph and a list of notes/events. If you enjoy coding in assembly, CSound will be fun. Chuck has a very nice sync model (SonicPi is similar), but the language is very imperative, not my favourite.
[+] widdershins|10 years ago|reply
I'm a SuperCollider fanboy. It can be very expressive and terse, as sc140 tweets show. You can use it for livecoding. It also now has a pretty good IDE written in Qt, and you can make your own GUIs in Qt with it too.

I will admit that I haven't tried Sonic Pi yet though.

[+] jm547ster|10 years ago|reply
It very much depends what your end goal is. Are you just looking to experiment and make some sounds? Would you like to embed one of these as a sound engine in another application that you are developing? Certain devices you are targeting?
[+] bwanab|10 years ago|reply
You could do worse than to play around with Sam Aaron's other project Overtone which is built on top of Supercollider.
[+] canyonero|10 years ago|reply
I've been listening to a lot of Daft Punk lately and have been building some toy synths lately with the Web Audio API in JavaScript. I think I'll take the weekend to mess around with Sonic Pi.

Great work, this is super cool!

[+] jsmeaton|10 years ago|reply
Awesome articles, thanks for writing them. I used to fool around with FL and Reason about 10 years ago but wasn't very good at all. I think I could have a lot of fun with this.

I especially liked how the author visualized sounds to be able to replicate them. I always assumed you just had to have a good ear.

Really impressive stuff, thanks.

[+] kriro|10 years ago|reply
I'll agree. The visualization helped me quite a bit. Never heard of Sonic Pi before this. It seems really cool. I also love that they have a dedicated "how to contribute" page with examples for non-technical stuff as well: https://github.com/samaaron/sonic-pi/blob/master/HOW-TO-CONT...

Prewrite some code, play around with it live...love it. Is there a curated list of people using this for live performances? I'd love to attend one of those.

[+] agounaris|10 years ago|reply
I've just learned about sonic pi yesterday and today this is first on HN ... wtf who tracks me? :P
[+] runeb|10 years ago|reply
Does anyone know of similar programs where the output is MIDI notes that you can save to files or use directly in more traditional audio software like Ableton Live?
[+] pierrec|10 years ago|reply
If you want to live-code directly in a DAW from a plugin, there is Lua Protoplug. It's completely centered on being a plugin, so your script processes blocks of sound/MIDI as requested by the host (here's a MIDI in/out example [1]). And yes, I know, I haven't pushed a commit in a few months. I still have many ideas and improvements for when I get back to it though!

[1]: http://www.osar.fr/protoplug/api/examples/midi-chordify.lua....

[+] moul|10 years ago|reply
Are you using your tool here https://github.com/aimxhaisse/dummy-wav2pi for this song ?
[+] aimxhaisse|10 years ago|reply
Unfortunately no, I did this code while trying to reproduce the bell sound, I thought it'd be easier to reproduce it by extracting the active frequencies of the original sample, but I could merely obtain the timbre of the instrument. I guess it needs more work (it doesn't take into account the envelope of the bell) and more tweaks.
[+] EugeneOZ|10 years ago|reply
Move all moving parts to config (maybe inside this file even) to avoid jumps between code parts.

Very impressive - not only work itself but also your feeling of rhythm.

[+] danyim|10 years ago|reply
The only thing that bothers me is that the bass track is off by a note. There's a phrase in there that is supposed to go down the scale, but instead it plays the same note three times. Otherwise, this is truly an amazing recreation of the song.

You should tweet this to Daft Punk and see what they think!

[+] 7373737373|10 years ago|reply
This is awesome!

Knowing nothing about this space, is there already a program that uses (wave based) sound simulation to allow music programming in an arbitrary 3d environment? This could go beyond mono and stereo :)

[+] unwind|10 years ago|reply
Something like Ambisonics https://en.wikipedia.org/wiki/Ambisonics perhaps?

I once worked with a brilliant audio developer/wizard who used Ambisonics (among other things).

Watching him position his desk when we switched to a new (large and open) office space is something I'll never forget. He walked around in the middle-ish of the room, snapping his fingers and listening. Suddenly he said "This is it, I'll sit here", and so he did. :)

[+] squeaky-clean|10 years ago|reply
I'm not sure I get what you mean by arbitrary 3d environment, but I know BT's album "This Binary Universe" is composed for 5.1, and the first track "All That Makes Us Human Continues" is written entirely in CSound.
[+] pcx|10 years ago|reply
For Daft Punk buffs like me, this is gold. Awesome stuff, kudos!
[+] ilovefood|10 years ago|reply
I totally love this! Great job man!