Music and Math

Once upon a time, a 12 year old Eric blew out the amplifiers as he shredded along with the middle school band to Deep Purple's "Smoke on the Water". It was the crowning moment of my rock and roll career. That career started when I was very young in a program called Kindermusic, which was a pre-school age band that taught me the basics of rhythm. Then, I became a roadie for my mother's professional harp/organ business. After a disastrous flirtation with the piano and the elementary school choir, I finally clicked with the guitar in middle school, resulting in my catapult to star-dom. In high school, I dabbled with both the classical guitar classes and jazz bands offered by the school, but never really returned to rock and roll. In college, music fell to the wayside as I pursued my degree and other extracurricular activities, but I would sometimes open up my weathered volume of The Christopher Parkening Method and revisit my favorite pieces. In the last two months, I've been making concerted efforts to practice more. In the process I have become re-immursed in the processes and joys of music itself, and have been coming to appreciate the fundamental connections between mathematics and music.

On the lowest level, music is the combination of different sounds, which are vibrating waves of air that can be modeled by physics. These sounds come from a myriad of sources, such as human voices, drums, or the plucking of strings. Each of these methods produce different types of sound waves that come attached with their own mathematical models. For example, the motion of a guitar string can be accurately modeled by the classical wave equation with the appropriate boundary conditions. These vibrations produce the corresponding vibrations in the air that we hear. Now, the resonant frequency/note of the guitar string depends on the length, circumference, and material of the string itself, and the physicla body of the guitar is designed to amplify a set of 6 basis notes. Frets are placed at precise intervals along the length of the string so that when I shorten the string at the frets it produces another resonant frequency. And thus music is produced out of physics.

On a different level, the notes we "like" to hear are a resonant frequency of our bodies, a concept known in music as Consonance and Dissonance. This has to do with how our ears work, and also how the brain processes the information-each of which have deep and rich mathematical exploration. Interestingly, it also has a cultural component in that certain cultures (like European Classical Music) hate sensory dissonance in music while others (e.g. Indonesian gamelan) celebrate it.

Moving beyond the physical mechanisms of music, the way we write and structure music is inherently mathematical. A piece of music is a function of time and user inputs (plucking strings, blowing a trumpet, etc) that produces intensity and frequency of sound (and if we're getting philosophical, emotions and feellings and stuff). While the output is continuous, it's impossible and silly to hold notes for an infinitesmally small time, so we can model both the inputs and outputs with discrete elements. Time becomes broken up into measures and beats, and discrete levels of user input are tied to each beat. The output "notes" represent the dominant frequency components played on that beat, and notes are separated by intervals representing the differences in frequency. From this set of assumptions a whole music theory has been developed that is not unlike the theory of math. For example, chords - the backbone of composition and rocking out - are defined as sets of notes played that obey a given set of intervals. To me, thinking about the chord progression of a piece is analogous to the Fourier transform in mathematics because both ideas give information about the structure of the function they are describing.

This idea of music as a function (or dynamical system if you set up the definitions right) has led to a lot of interesting ideas. This paper by Diana Dabby uses a piece of music as input to a chaotic system, which broadly means that changing initial conditions give wildly different results. Bach goes into the system, and a new "variation" on Bach's theme comes out, putting a new twist on an old classic. The entire development of electronicly generated music also uses this idea. Filters like auto-tune take the singer's voice as an input function and shift the frequency of the note, or track editors can be used to take these music functions and peform arbitrary operations to every note. There is even software avialable that can make your garage studio sound like you're playing in any concert hall in the world that relies on mathematically modifying the original music.

On the side of composition, the rules and ideas presented in music theory are closely linked to graph theory, with notes as nodes and intervals as edges. This is also extended to other concepts like the circle of fifths. Just like in math, symmetric structures are considered beautiful, and both the graphs that emerge from music theory and musical compositions themselves tend to behave under symmetry conditions. Many musicians are also mathematically inclined. Andrew York (my favorite contemporary classical composer) even wrote a suite of called the "Equations of Beauty" that reflect different mathematical concepts.

In the end what this all boils down to is that music is fun.

© 2015 by Eric Cawi. Proudly created with

  • Twitter Social Icon
  • Facebook Social Icon