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

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:

play 50

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:

Sonic Pi homepage

 

Sonic-Pi cheat sheet.(pdf)

 

Linux User Tutorial

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s