Teaching Sonic Pi with
The Curiosity Hub


The Curiosity Hub run lots of awesome STEAM (Science, Technology, Engineering, Arts and Maths) workshops to teach these skills in imaginative and exciting ways. Thus I was really pleased when Founder and Lead Educator Jacqueline asked if I would join her in running a 'Create your own Digital Music with Sonic Pi' workshop.

What is Sonic Pi?

Sonic Pi is free to download and provides an environment for creating music using computer code. It began as a research project by Sam Aaron at Cambridge Uni to improve computing and music lessons within schools. I think it is an amazing way to teach coding skills in a creative way. Part of the reason for this is that it removes the ‘fear’ of learning to code because kids that have never done any coding before probably don’t realise quite how many programming constructs they are covering as they are too busy getting excited about all the cool sounds they are making. It was endearing to see that the children were genuinely excited, their facial expressions displayed sheer awe when they heard the sounds they were producing and they were very keen to show each other what they had created. The idea is that children don’t just sit back and learn about music, they can actively be musicians even if they do not already play an instrument. This could then open the door to discover a path they may have otherwise dismissed.

The workshop

There were 4 attendees at the workshop, aged between 9-12. A couple already played an instrument and a couple had done a little coding before. The workshop began with a discussion about how we hear sounds from both acoustic and electronic sources. They seemed quite clued up on acoustic sounds but how we hear sound from an loudspeaker was more of a mystery. We spoke about whether anyone played any instruments and the kind of music they liked to listen to and why. I was quite impressed with their musical tastes and I suppose secretly quite surprised that they knew about a lot of electronic music that I had never heard of. They said they mostly found music on Youtube and I experienced feeling old, maybe for the first time when I told them about how we listened to the CDs on the wall in HMV to listen to new music… but this ability to listen to and share music using technology definitely ties into the ethos of creating and sharing music with Sonic Pi.

We then showed them the Sonic Pi environment and asked them to get used to running and stopping sounds and noticing that the program was outputting information to the log once running. They then copied in examples that came with Sonic Pi and ran them. After this they took it in turns to describe their favourite example and why they liked it. We then listened to the first minute or so of 'Time' by Chase and Status and talked about the different layers of sound and how they were being used to build up the song. We spoke about how Time begins with vocals that are treated with lots of echo/reverb which gave the impression of the singer being alone, the build up of vocal layers, repetition, call and response and finally how the drums speeding up to create a burst of energy and realisation.

This was to demonstrate that in a radio friendly pop/dnb song there is still a lot going on and if we listen carefully then we can identify and use these ideas to construct our own music. We then described synths and samples and demonstrated the classic that is the amen break. Using Sonic Pi we slowed down the rate of the Amen Break and discussed how it now sounded a bit funkier and actually now sounded like the drum beat in ‘You Know I’m No Good’ by Amy Winehouse. We ended the introduction reflecting about how programming is an amazing way to make music as a slight change of a parameter can completely change the way something sounds, giving us loads of control and endless creative possibilities.

We then worked through some worksheets. The children kind of went through in order but were quite keen to skip ahead to the parts that covered the things wanted to create, but I thought this was great because they were already thinking ahead as to what they wanted to add to the sounds created and were thinking about how this would be achieved, may it be through changing certain parameters or adding loops/threads. Inevitably they came across syntax errors. At first they would be quite quick to say ‘It’s not working’ and immediately ask for help, but after reading through error messages with them they were able to start debugging for them selves. At the end of the session the children took it in turns to share some of the music they created with each other and their parents. They took home a Certificate of Coding and Musical Excellence and the Coding and Music Journals that Jacqueline created for them as well as the worksheets so hopefully they will continue to create music at home.



In 2 hours not only had the children been exposed to sound waves, ADSR, amplitude, rate, panning, midi notes, synths, writing melodies, samples and analysing existing music but they had also learnt firstly what coding was, and then running a program, debugging a program, syntax errors, constructs such as loops, iteration, blocks, threads, parameters and randomisation. All done in a really fun, creative ‘non textbook reading’ kind of a way. It’s worth mentioning as well that no matter what your age, if you are new to programming, this is a great way to learn about all of these programming constructs in a practical way because they are most likely going to help you in which ever language you go on to use.

The language of Sonic Pi is created using Ruby and SuperCollider. I use Ruby day to day at work and I studied Music Informatics at Uni where we used Super Collider... so Sonic Pi is very appealing to me! My old blog about computer music is somewhere on the depths of the internet if anyone is interested. I am aiming to get more involved with music computing in my spare time so if anyone has any ideas for collaboration then please email me!