Math, Music, and the Matrix
February 20, 2017 Think THF
This scene could almost be a slick DJ club set, but there are no knobs, decks or instruments in sight. Yet the code is real, and it’s all live.
This is the world of live-coding music, an art form in which performers create music by programming computers on the fly, in front of an audience, writing and revising instructions that trigger and manipulate sounds, rhythms and effects in real time.
THE MATH OF MUSIC
When it comes to expressing musical ideas, computer programming might seem an unlikely outlet. But computer science is grounded in math, and music, with all of its messy, imprecise human expression, is largely built on mathematical relationships — harmonic structure, rhythmic patterns, and at its most fundamental, the unique combinations of sine waves that make up the sounds all around you, from birdsong to the roar of a jet engine.
We’ve been exploring parallels between music and math since the days of Pythagoras. Today, musicians and composers are able to use computers as tools to interpret and express these values and relationships.
“It’s clearer through coding that music can be expressed as essentially patterns of numbers that are processed and transformed in various ways — and that we can add expressivity by changing the sounds we are using and shaping the structure of our sounds,” said Shelly Knotts, a composer, experimental artist and live coder in the United Kingdom.
As a live coder learns to anticipate these mathematical relationships, his or her ears learn to “hear” the relationships, much like in traditional music theory training. Live coders often write code that they can hear in their heads — which, at a fundamental level, relates to Beethoven’s ability to continue composing even after he had completely lost his hearing.
BREAKING DOWN BARRIERS
Live-coding languages and styles vary. Most performers create music entirely on the fly, constructing ideas from scratch; a few mix in precoded elements, DJ-style. But they all embrace the movement’s overarching philosophy that live coding should be inclusive and accessible to everyone.
For most live coders, exposing their code is part of the performance and serves to demystify their process, forging a connection with the artist through his or her “instrument,” explained Sam Aaron, a British researcher, software architect, educator and live coder. “Why is it important for a guitarist to let you see his or her guitar? People have all held guitars; most of us are not very good at it, so when you see someone who’s good at it, you can appreciate the virtuosity.”
There’s no denying that projecting computer code adds a compelling visual element to a performance, but if you’re not paying attention to the language itself, you’re missing the point. “It’s like saying Jimi Hendrix made amazing music, but he had a fabulous wooden necklace,” added Aaron.
Live coding challenges preconceived ideas about the programmer’s experience by bringing a traditionally solitary process into a participatory realm. “It’s like writing, really; you don’t generally write in a social way,” said British musician and researcher Alex McLean, member of the live-coding band Slub and cofounder of TOPLAP, an organization formed in 2004 to bring live-coding communities together. “I think live coding is not necessarily showing programmers as something different, but rather a different way of interacting with the computer; it’s very different, working alone on a piece of text and having people in front of you, listening intently,” added McLean, who is also credited with co-inventing the algorave, a rave-like club event based around live coding.
Since its inception about 15 years ago, live-coding culture has been rooted largely in Europe and the U.K., but the movement is slowly building international interest through festivals and other live events, long-distance collaborations over video and social media, and creative partnerships with more mainstream artists. But the most powerful force for longevity is education, and right now, it’s Aaron holding the key.
CRACKING THE CODE
“I want to make sure the leap from code to music is as small as possible and as clear and simple to as many people as possible,” said Aaron, a passionate advocate for unearthing the creative potential of programming languages. He spends his days as a researcher at the University of Cambridge in England and his nights performing live coding.
In 2012, Aaron created Sonic Pi, a simple yet powerful open-source programming environment designed to enable users at any level to learn programming by creating music and vice versa. Sonic Pi is used all over the world; it runs on any computer platform including Raspberry Pi, the $40 credit card-sized computer designed for DIY projects and for promoting computer science in schools and developing countries.
“Music really helps by wrapping the math concepts and computer science concepts into something that has direct meaning to kids, which is making music,” Aaron said. “And making the kind of music, hopefully, that they listen to on the radio or stream.”
The case for building these new learning paths to computer science is strong. Understanding basic programming improves logical thinking and provides a fundamental understanding of technology we use every day.
“Teaching people what coding is — how precise a language has to be for a computer to understand it — gives people an appreciation of an execution of semantics in a program, affordances of a system, interaction with a system,” said Aaron. “People are telling kids to learn how to program because they can become professional programmers. It’s like saying we should all do sports in school so we can become professional athletes. You don’t teach math because you’re training the future mathematicians. There’s a level of math that’s useful to all of our lives."
Sarah Jones is a writer for The Henry Ford Magazine. This story originally ran in the March-May 2017 issue.
computers, technology, music, by Sarah Jones, The Henry Ford Magazine