Sonic Pi 2: coming soon


During the last few weeks I have been looking at the latest betas for Sonic Pi version 2, and I am very excited about the new facilities that this program has to offer. With this second version it is really coming of age. and added icing on the cake is that a version for Macintosh is also  under preparation.
Version 1 allowed users for the first time easily to explore creating music on the Pi, without the addition of extra equipment and also using an easy programming language (based on Ruby). The program has been pushed heavily in schools and some lesson plans were produced to support this process. However the first version had some limitations. Although you could write polyphonic music with more than one part at a time sounding, the thread structure used for this didn’t synchronise the parts together very well, and they could get out of step after a few bars. Also, the large fixed typeface chosen in the editor, which was good for use with an OHP in the classroom was annoying when you started to write lines of any significant length or number, because of the large amount of scrolling required to see them. Also when you had written your masterpiece there was no easy way to record it for posterity, either as a source music file or as an audio file. Also it was all to easy to overtax the Pi’s processing power if you tried to write more than 2 or 3 parts together.

I am happy to say that all these issues have been addressed by Sam Aaron in developing version 2, Thread synchronisation is now perfect, and the program has been streamlined so that it is now possible to play six or seven parts together, which can also be helped by setting a moderate overclock on your Pi and by using the option to switch off the output messages while a program is running. The text size can be altered at will individually for each of the 8 workspaces in the program. You can save an individual workspace as a text file and also record a wav file for a piece as it is playing.

Another major improvement is that you can now enter notes symbolically using notation such as :c5, :ds6, :bb3 for a C in octave 5, a D sharp in octave 6 and a B flat in octave 3, rather than using midi numbers such as 48 or 72 as was the case in version 1.This makes it much quicker to enter music.

However as well as these improvements, there is a major change in emphasis in version 2. Not only can you transcribe printed music to play ( I have successfully done this with a variety of pieces from The Beatles and Sandie Shaw songs, to Scott-Joplin Rag Time and a complete movement of a Bach Brandenberg Concerto) but also you can now play with pre-recorded samples bundled with the new version. There are drum samples, guitar samples, rubbed wine glass samples and others beside. There are quite a few commands to master to make full use of these, but a comprehensive help system is now included with the program, with sections to list the synths and samples and their characteristics, a section to describe the programming language commands, and a section of examples to try out. At the time of writing it is this help documentation section that is being worked on.

Live coding
One of the novel features that can be used by the new program is to  define a function of several notes or samples to be played and then to start that function playing in a separate loop. If you then comment out that loop leaving it running it is possible to alter the definitions within the function  and rerun the program so that you are effectively tweaking the sounds you are producing in real time with the original loop which is still running playing your new sounds. You are carrying out real time creative music making! This feature is possible in Sonic Pi 2 because unlike the first version it does not start a new process on each run, rather it starts a server on app launch and layers or adds each new run to the currently running server process (unless of course you push the stop button).  You can play with attributes such as the pitch of a note, and cause it to slide in a defined time to a different value. You can do the same with the position in the stereo image of an instrument, causing it to pan from left to right in real time. There are also a range of effects filters such as reverb which can also be applied and altered. In fact, the program is limited only by your imagination! There is an example of this in the Sonic Pi article by Sam Aaron in the MagPi issue 23 here which I would encourage you to look at.

If you enjoy programming, you can use features from the Ruby language with the program.
As an example I wrote a program for Sonic Pi which uses it as a morse code tutor. You can type in a sentence and it will play you the morse code translation at whatever pitch or speed you specify.

Once the release version of Sonic Pi 2 is out, I hope to publish some of these programs and write one or two tutorial examples based on my own learning curve with this excellent program. In the meantime The Release Candidate 11 file is available at if you want to get stuck in now. To whet your appetite here is an mp3 recording of Sandie Shaw’s Puppet on a String song (winner of the Eurovision Song Contest in 1967) which I have written for the Pi. It is produced form the original avi file recorded by Sonic Pi 2. It plays 5 parts together, and is complete apart from the 2 bar intro. There is one issue with the RC11 beta which is that the source music file must be under about 9000 bytes or it won’t play. Sam is aware of the problem and what needs to be done to overcome it, and this should be fixed in the final version when it is released.