Getting Started with Sonic Pi
This documentation will help you get started with the Sonic Pi app. We'll show you how to install it on your Raspberry Pi, to launch it and finally how to program your first musical composition.
Installing Sonic Pi is simple. Open up a Terminal application and type:
sudo apt-get install sonic-pi
You will see all the dependencies download and install. You'll be asked to enable realtime mode for something called Jack. Simply say yes at the dialogue to continue.
Sonic Pi requires a windowed environment. Make sure you're either booting your Pi straight into X11 or type
startx at the terminal prompt after you log in. The Sonic Pi application can then be launched using the 'start menu' at the bottom left of the screen.
Your first sound
The first command to learn is
play this takes a number as a parameter. For example:
play 60 into the text pane and pressing the play button. You should hear a simple bell-like pling sound! Remember to plug your headphones or a speaker into the RPi!
Try changing 60 to other numbers. What happens if you choose a number too low or high? You might be interested to know that these numbers are MIDI numbers. See the following link for how MIDI relates to a piano and more standard note names: http://www.phys.unsw.edu.au/jw/notes.html
Your first piece
The next command to learn is
sleep which also takes a number as a parameter. In this case the number doesn't represent pitch, it represents time:
This will force the program to pause for one second. You can use
sleep to add delays in your composition allowing you to create a melody. Try writing a bunch of
sleep commands such as:
play 60 sleep 0.25 play 62 sleep 0.5 play 66
Go ahead and start writing your own pieces!