Latest Research News

Programming Music. Sam Aaron and Sonic Pi

2018-05-22 Sam Aaron, a scientist at the University of Cambridge, developed the music program ‘Sonic Pi’. This May, he was Leuphana’s guest at the invitation of Prof. Dr. Rolf Grossmann, Professor for Digital Media and Auditive Design. The open source application ‘Sonic Pi’ enables music programming, and finds its application not only in computer science lessons, but also in live performances.

No matter what shape it takes – an app, a website, a self-propelled car, a console game – when it's digital, it's been programmed. All programs, codes, are digital. Nevertheless, the knowledge about what programming actually entails, remains rather sparsely known. Sam Aaron’s advice is to “[i]magine programming like baking a cake, “. Certain things enter into the baking process (flour, oven, sugar, etc), they are at your disposal, as well as a recipe that lays down the order, in which to use these things (“Take a teaspoonful of sugar, put it in the bowl. “). Some of the instructions are linked to each other (“Check if the oven is hot. If not, wait until it’s reached the right temperature. Then put the baking tin into the oven“). This is exactly how programming works. “An algorithm is just a list of things to do, “ says Aaron. The difference is that it is produced with on and with digital commands and digital things, which execute these commands.

‘Sonic Pi’ is a software environment for entering program code that Sam Aaron originally developed for the Raspberry Pi, a mini computer from the maker scene. The code entered in ‘Sonic Pi’ can be used to create music directly. As a user, you enter ‘play Cis’, whereupon the sound Cis is generated and played through a loudspeaker. Sam Aaron developed ‘Sonic Pi’ to introduce children and young people to programming in a playful way. Aaron comments on the enthusiasm of his students “It's the difference between ‘today we learn how to code’ and ‘today we’re going to make music and our instrument just happens to be code’ “. Meanwhile, in recent years, the program has also become increasingly popular with musicians. The environment now runs on all platforms (Windows, Linux, Apple) and is the world's most widely used software for live coding in the music sector. Aaron himself performs with it and uses it in his live performances.

At the right time

The combination of music and coding makes it possible to better understand certain aspects of digitality. On the one hand, it extends the programming range by adding the term ‘rhythm’. “Most programmers don't care about time,“ Aaron says, “they just care about speed.“ Most programs are optimised for speed. When played on computers more powerful than those, for which they were programmed, they run faster. This is good for some programmes, but problematic for others. Old computer games are impossible to play on new computers, as they make them run too fast. Likewise, music should not be played as quickly as possible, but in a compositionally meaningful time frame. “‘Sonic Pi’ does not try to make things fast,” Aaron pointed out, “but to make them on time. “

On the other hand, Sonic Pi also contributes to a better understanding of the essence of music. Does digital music count as fully fledged music, compared to a sonata played on a violin, for example? Aaron points out that the term pair digital-analogue is generally equated with discrete-continuous: What can be traced back to discrete information packages is considered digital. According to this way of thinking, however, a piano or clarinet, for example, should also be digital – one can only play clearly separated tones on it. A synthesiser, on the other hand, can produce an infinite and arbitrarily divisible amount of tones – does that make it an analogue instrument? Technological progress may have made this distinction obsolete.

Digital alphabetisation

‘Sonic Pi’ has become accomplished as a learning tool in the classroom and has even earned a positive mention in ‘Rolling Stone’ magazine for its performance function. But why is the ability to program so uncommon in society so far? If you look at the whole history of mankind, after all, until recently, reading and writing were scarcely generalised skills. When broad literacy finally became established, people did not apply their writing ability to producing epics and business plans, but for everyday things, such as shopping lists. Maybe programming should shed its nimbus as “a difficult competence for important matters“ and its practical and creative parts should also be emphasised when it is being taught. In Aaron's words: “We don't teach sports in schools in order to make professional athletes. Also we shouldn't teach coding in schools to make professional programmers, but to use it.”

Grossmann adds: “The demand for ‘digital literacy’ first appeared in the 1980s. They tried to create a language for ‘digital natives’ by teaching children to program. That didn't work. It was poorly received, and then dropped. We are now in a second phase, one in which programming, ‘coding’, is taught in a playful way. It's a post-digital, fun approach, so to speak. And, it seems to me, much more successful than the first.“

Sam Aaron's visit took place in the context of a planned cooperation between ICAM and the University of Cambridge. 

The Sonic Pi interface is projected onto a video of a live performance by Sam Aaron. Taking up the ‘baking recipe’ comparison from above: on the left, one can see how the recipe is (re)written, while on the right one can see what is happening in the kitchen. 

The Sonic Pi website presents examples of simple codes and the sound they create. 

Author: Martin Gierczak. Translated by Beatrice Goutfer.