Sonic Pi is a free programming environment that lets you create music and other sounds with code. Sonic Pi is included on the Raspbian operating system for the Raspberry Pi, and you can also download it for free for macOS, Windows, and Linux.


sonic pi

Key features:

  • Text-based programming based on the Ruby language

  • Library of samples and synths included

  • Use MIDI numbers or letter names for notes

  • Friendly editor with syntax highlighting, command completion, and helpful error messages

  • Live-coding (change your code as it plays)


To complete the Sonic Pi projects, learners will need computers with speakers or headphones.

If you want to use Raspberry Pis, then you’ll need either an HDMI monitor with speakers or headphones/speakers connected to the audio jack or USB port.

If you want to use headphones, then make sure that learners know how to set the volume to a comfortable level.


Downloading and installing the Sonic Pi editor


Using Sonic Pi on Raspberry Pi

Sonic Pi is included in the Raspbian operating system. You can find it in the Programming section of the menu.


Image result for raspbian programming menu


Sonic Pi for Windows, macOS, and Linux

Sonic Pi is available to download for free. If you can’t easily get software installed on your Code Club’s computers, you may find the ‘Sonic Pi Portable’ version useful, as it will self-extract and run from a USB stick or a folder — no installation necessary.


The Sonic Pi editor


screenshot


The Sonic Pi editor has a set of buffers (editor windows, which work like browser tabs) that you can easily move between. The editor has lots of friendly features for beginners: built-in help, syntax highlighting, command completion suggestions, and helpful error messages. The Log Viewer output window is useful for understanding complex programs, because it shows which sounds were played at which time.


Sound settings


You can adjust the volume for Sonic Pi using the Prefs menu.


screenshot


Saving and loading


Sonic Pi programs can be saved (as .txt text files) and loaded in the editor.


screenshot


The editor also automatically saves and loads the contents of the buffers.


Recording


Sonic Pi lets you save music or sound as .wav files. Click on Rec and then on Run to start recording; click on Rec again to stop recording.


screenshot


Note: you can import .wav files into Scratch as sounds for sprites or the stage!


More resources