Sonic-Pi enables you to compose and play tunes and music on your Raspberry Pi using what is commonly known as ‘Midi – Values’. All recent distro’s for Raspian have Sonic-Pi preinstalled and present on the desktop after you have booted up and logged in to GUI. Sonic-Pi uses Ruby as a programming language and is known as a object oriented scripting language. If you need to install it start up LX Terminal and type in the following code:
sudo apt-get install sonic-pi
UPDATE; Sonic Pi now comes pre-installed with the new Raspbian Distro’s.
You also need a pair of headphones or a speaker plugged in to the audio out jack.
Once installed you can start up Sonic-Pi ; test your setup by typing the following command:
Press Run, you should now hear a single ‘beep’. OK so it works let’s try this sample code for starters: Pay careful attention to indents and spacing (white space).
play 52 sleep 0.5 play 55 sleep 0.85 play 64 sleep 1 play 64 sleep 0.7 play 55 sleep 0.2 play 59 sleep 1
More tutorials and examples from these websites: