# In Theory: Part 1

In Theory: Part 1

Translating the Fundamentals of Music into the Language of Math

by Ryan Vitale

Where do math and music intersect? In a pretty ambiguous sense they both rely heavily on structure, symmetry, and order. With the abstraction available in modern math it turns out that relationships between math and music can be made precise. It’s even possible to inject some mathematical structure into music and come up with some interesting new melodies, chord progressions, motifs, rhythms, and so on.

I want to introduce some ideas over these articles that hopefully will provide some new tools to create music you wouldn’t have otherwise, and give another perspective on how music works. If you’re not analytically/technically minded that’s fine; the main tools will eventually boil down to manipulation of 2 and 3 dimensional shapes.

The first thing we need to do is translate musical concepts and language into the mathematical realm. Music is fundamentally a bunch of sound waves adding and subtracting from each other, so let’s see what pitches are in terms of these waves. Sound waves are very google-able if you want details, but basically they’re pressure waves that move air particles back and forth. How quickly the air molecules oscillate (their frequency) affects the pitch we hear. A higher frequency will yield a higher pitch of sound. [pullquote]If there’s a fixed frequency/pitch and then this frequency is multiplied by 2, we hear exactly the same “kind” of pitch again. This is called the octave interval.[/pullquote]

For example, when we move through the typical musical alphabet, we may go C-D-E-F-G-A-B-C. Each of the pitches between the two C’s is a different “kind” of pitch which belongs to a certain pitch class. The two C’s are in the same class of pitches; they have the same quality of sound to our ears but are at different frequencies. The first simplification we make when we talk about music is then to use the periodicity of the octave and then separate the octave into classes of pitch. All of the frequencies (very infinitely many) are represented in one octave, and then we choose finitely many of them by chopping the octave up into some finite number of pitch classes that are equally spaced by sound. In Western music we usually chop it into 12 parts called the chromatic scale, so that each of the adjacent notes sound equally far apart.

There’s a formula to figure out any pitch once you pick a reference frequency (like when we tune to A = 440 Hz) and decide how many parts to chop the octave into:

Where i tells you how many steps away from the reference frequency you are, and m is the number of tones you want to chop the octave into (which would be 12 if you want the standard chromatic scale). Pitch and pitch class are different things entirely.

[pullquote]On a piano every key is a different pitch, but all of the pitches belong to one of twelve different pitch classes. The A at 440 Hz and the A at 880 Hz are different pitches which are both in the same pitch class.[/pullquote]

Now by the formula above, we can pick how many steps we want to the octave and actually figure out the right frequencies for our pitches. With this we can build music from the ground up. Aspects of music theory come from the number of pitch classes we chop the octave into; for example in the 12-tone chromatic system we get a whole tone scale since 12 is even. A whole tone scale doesn’t exist anymore if you choose 13 tones to the octave. In the 12-tone chromatic scale the interval of a 5th (ascending or descending) gives us the famous circle of fifths. If we choose 13 tones, since 13 is a prime number, we end up getting a music theory where every interval makes a perfect cycle because no positive numbers divide evenly into 13 besides 1 and 13. This works for every prime number of pitch classes.

We get to then use number theory to study music. You can treat the pitch classes as being integer numbers and use addition and multiplication on the pitches. Then you can reduce the integers to something called modular integers which form an object called a group in abstract algebra. There are a lot of fun things to do with groups because they have some very nice properties/consequences:

1) If I mix two things in a group together I get another thing in the group, which will give us diatonic music.

2) Groups can be thought of as sets of permutations, which means we can use them to rearrange notes in a structured way to get melodies, or chords in a structured way to get chord progressions.

3) Groups are often geometric in nature or can be thought about that way, so we can do things like attach notes to a surface like a cube and then rotate the surface around in space to create melody. For a simple example of this attach a triad like C E G to the corners of a triangle so that rotating the triangle inverts the triad for you.

This first article was mostly to introduce the connection between math and music at a fundamental level, but later on we’ll be able to dive into the practical stuff, throw pitches onto geometric shapes and move/alter the shapes to actually make music. The algCOMP file that you are free to listen to was composed purely using algebra and you’ll see all the methods that went into creating it as well as plenty more. This at least gives a taste of what you can get from using the language of math: generalization and a big new toolset to use in making music.

Listen to the demo: