Review

Tech Reviews: Coding for the classroom

Dale Wills takes a look at a selection of tech for coding in the classroom, including Sonic Pi, Scratch, NeboMusic resources and Pure Data.
GORODENKOFF/ADOBESTOCK

I have a confession: I have become a coder. After years of working with software designers and marvelling at their pseudo-English magic spells, I have taken the plunge and joined the ranks of musician-coders. My first patch, a software synthesiser with a programmable delay feature, will shortly be gracing the London stage – watch this space!

Coding may not initially feel like a musical activity. We're more comfortable with abstract Italian terminology than the equally poetic linguistics of Pure Data or Max MSP. Would the world be a better place if we admit that precious few of us have ever used the word ‘conjunct’ outside of a classroom? Perhaps. But my journey into coding was prompted, like most things in my teaching practice, by curious and dedicated students.

We are all acutely aware that the rate of digital growth will create a landscape of jobs over the next decade which we can currently barely imagine. I am a particular fan of the Australian Department of Education's statement that ‘digital proficiency will be a foundation skill, as important as reading and numeracy. It will increasingly be the determinant of employment prospects and opportunity’.

Music and writing code for computing have more in common than we might initially realise. Writing code and writing music both rely on processes of decomposition; breaking down a function into smaller parts in order to understand how they work together. The cognitive processes and analytical and reflection skills are surprisingly similar. Both are also based on abstract linguistic processes in order to realise a result.

Scratch

There are a multitude of resources available for introducing coding to the classroom. Many of them already approach the subject from a musical perspective. One of the most accessible is Massachusetts Institute of Technology's phenomenal Scratch (scratch.mit.edu). This platform is completely free to access, aimed at Years 3 to 11. A potential starting point might be to have students code their own percussion instruments; drumkits, xylophones, pianos, or even branch out into imaginary or impossible instruments. There are numerous examples of these on Scratch, complete with the code running them.

Scratch comes with a range of tutorials, accessed from the menu bar, taking even the most uninitiated programmer from novice to script ninja in no time. I particularly like the breakdown of steps which the platform forces the first-time coder to go through; motion, looks, sound, and events all require their own set of instructions in order to make the virtual instrument sing. Once students are fluent in the basics of creating a virtual instrument, the next step is to feed MIDI information into the project, allowing them to build their own real-time sequencers and create musical results. The results can be astounding, especially when freed from the limitations of recreating real-world instruments or dealing with the restraints of human players.

NeboMusic resources

An amazing series of resources have been made available by NeboMusic (nebomusic.net) utilising a range of platforms, including MIT's Scratch. Many of the courses are built around commercial programming languages, introducing students to Java, Python, and Web 2.0 platforms such as Photoshop and Maya. I am a particular fan of students learning real world skills rather than simplified alternatives, and Nebo's resources certainly take students on that journey.

More than just hard skills, Nebo focuses on developing students’ imaginations. The programmes, particularly those aimed at higher years, pose interesting psychological and philosophical questions alongside developing a technical skill set. My favourite is ‘Computational Perception and Artificial Intelligence’, which challenges students to build generative sequencers and to use artificial intelligence to match references. The ‘Dr Who Template Matching Exercise’ is a particular masterstroke.

AI is a term which has been thrown around for years, with several commentators asking whether AI technology will replace us as teachers, and even as musicians, over the next generation. The question shows a fundamental misunderstanding of what AI is and how it functions. Artificial Intelligence, and particularly generative music making, are already significant components of music making. The better students can understand the role these tools play in creation, the more their imaginations become the only limit in their music making.

Sonic Pi

If you want an example of how coding is already firmly established in music making, look no further than Sonic Pi. Developed by Sam Aaron at Cambridge University, in collaboration with the Raspberry Pi Foundation, this platform was built specifically to introduce school-age learners to making music through coding. It has gone on to become the mainstay of several commercial artists including DJ Dave, Ben Smith, and Aaron himself.

The free platform comes with one of the clearest step-by-step tutorials for any coder, leaving the first-time programmer-musician with a solid basic technique. From there, the Sonic Pi website guides the artist through their first steps in classical, jazz, grime, and EDM production. The examples at sonic-pi.net show just how easy it is to make complete compositions with only a few lines of code – and some of the results are seriously beautiful. I can particularly recommend Vibe – a hybrid acoustic composition for orchestra and Sonic Pi by Charlotte Harding, premiered at the Royal Albert Hall in 2019.

One of the most exciting aspects of Sonic Pi is that it enables the performer to write and modify code live. This masterstroke puts performativity at the heart of making music with code and makes this platform ideal for collaborative music making. The buffer works with any platform; Mac, Windows, or the amazing Raspberry Pi machines for which it was developed. Sonic Pi is a powerful and accessible tool for any age group which deserves to be a classroom accessory in every music department.

Further resources for Sonic Pi abound across the internet. One of my favourites is the Music Programming Basics course from Mehackit (mehackit.org) which takes students (and teacher!) through a step-by-step tutorial sequence from downloading and installing Sonic Pi through to finishing your first composition. Supported by a series of video tutorials, this is a fantastic starting point for anyone worried about dipping their toes in the coding waters for the first time.

Pure Data

My first steps into coding as a musician were provided courtesy of Miller Puckette's indispensable Pure Data (puredata.info). Much like Sonic Pi, Puckette put the emphasis on creating and manipulating sound in real time, making Pure Data (Pd) a musician focused approach to coding. Pd is an almost limitless platform, enabling users to create real-time and precomposed music, design effects and processing plugins to work in conjunction with audio inputs, act as a generative sequencer or sampler, and constitute graphic scores and notation. One of my incredible students wrote a patch which converts photographs and images into sound, with some unexpectedly beautiful results.

Pd is perhaps the most versatile and powerful tool in this list. Like its cousin Max, Pd is designed to support other programming languages, so as students branch out into C, Python, Scheme and the host of others, Pd will grow with them. This can seem overwhelming, but the buffer comes with a series of predefined ‘objects’ – boxes on the screen which have defined ‘functions’. Once you have broken down the steps of what you want to achieve, simply connect the objects in the sequence in which you want them to function, sit back, and listen to your results. The app is powerful and intuitive enough that the novice user can start producing astounding results in just a few trial clicks.

Summary

As with much coming out of the software developer community, all of the resources listed here are open source and free to access. The only limit is the imagination of the user (and having access to admin permissions to install the coding platform on your machine!).

As music teachers, we're often left out of the cross-curricular initiatives. Our art is too easily seen as something separate from the mainstream curriculum with limited crossover potential. We occasionally speak to the drama department, reluctantly speak to English and modern languages, but the maths and computer science buildings are a dark region somewhere east of Mordor.

Coding offers an opportunity to embed maths, computer and logical skills at the centre of our curriculum. More than that, making music in this way opens a range of possibilities, limited only by the imagination and creative vision of our students. Any of the platforms above will introduce students to critical thinking, analysis and problem solving, and inventiveness – all of which are at the heart of music making.

The last word on this subject should go to Apple founder and music industry definer Steve Jobs: ‘Everybody should learn to program a computer, because it teaches you how to think’.

scratch.mit.edu

nebomusic.net

sonic-pi.net

mehackit.org

puredata.info

Find a helpful glossary of terms used in our music tech reviews here.




Related