Sonic Pi random sequencing
I bought a Raspberry Pi when they first came out, with plans to turn it into a MIDI arpeggiator or something similar. Like many of my ideas though, I never actually got around to doing anything about it so the Pi has sat in a drawer for the last couple of years, never once being powered on.
I then read a post on lifehacker.com about adding a mini touchscreen to it. A few days later, and I became the proud owner of an Adafruit PiTFT which has given the abandoned Pi a new lease of life!
Break the code
This evening, I’ve been dabbling with Sonic Pi, a simple audio programming language that comes pre-installed on Raspbian.
With very little effort, I managed to get a nice, random sequence generator up and running in 5 lines of code:-
with_tempo 240
with_synth "dull_bell"
loop do
play_pattern [45, 50, 60, 72, 79, 84].shuffle
end
Version 2.0 of Sonic Pi is currently in Beta and promises to do a lot more than simple pattern playback including sample manipulation, more synthesis models and some effects processing too. Definitely worth checking out if you already have a Raspberry Pi and maybe an excuse to get one if you don’t!
Follow Sonic Pi’s twitter feed for more info about Version 2.0