I have been learning Sonic Pi, a piece of software created by Sam Aaron, where you use code to make music, “the live coding synth for everyone” as it describes itself. Basically, you type code into an interface, press run, and it plays the music that you’ve told it to do using your code.

I have done some Sonic Pi before but I recently went to a workshop, which got me completely addicted to it. I think this was because: a) it’s amazing to type something, press a button and hear  music that YOU have created, and b) because it’s so amazingly simple! Don’t believe me?  Download Sonic Pi from the link below, and copy this code into it:

in_thread do
live_loop :Q do
sample :loop_breakbeat
sleep 1.9
end
end

in_thread do
use_synth :tb303
live_loop :W do
play choose(chord(:E3, :minor)), release: 0.3, cutoff: rrand(60, 120)
sleep 0.25
end
end

If you don’t want to download Sonic Pi, you’ll just have to take my word for it: the music has a drum beat, PLUS a melody, which uses random notes, and has just 13 lines of code.

The Sonic Pi software is available free at http://sonic-pi.net/, and there is even a tutorial included with it. Just click the help button at the top left of the screen and it will pop up.

So what are you waiting for? Get jamming!

If you code some music that you really like, copy the code into a comment and I will paste it into Sonic Pi and listen to it.

Advertisements