There's Math behind the Music!
This is a lesson that shows the mathematical structure behind musical pitch. It is intended for a high school audience. The links in this document are all either image files or music files, with one exception, the executable file Wtune.exe that can be found here. In the case of music files, they are in mp3 format. If you're having trouble playing mp3's, you might want to pick up Winamp. Both Winamp and Wtune are free.
Disclaimer: I'm a professional math teacher, but not quite as professional a musician. While I certainly know what I'm doing when I'm playing,, I may be a tad off in some of my musical terminology. I apologize for any errors. Feel free to let me know at charlie.burrus@rice.edu.
Introduction
What is Sound? – it's waves or vibrations through the air (or whatever medium you’re in).
Compare with waves in water (which are actually transverse waves, which move up
and down as well as side to side and are therefore different from sound waves
but still very similar in many respects), or a wave through a crowd of people
when someone pushes at the back. Note that when a wave travels through the
air, the air itself doesn't travel very much, it just wiggles. There is a
pretty cool
java applet online that illustrates sound waves.
What is Volume? – how loud the sound is = how big the waves are.
What is Pitch? – how high or low the sound is = how frequently the waves hit your ear.
This does not mean that the waves are traveling faster, it just means
that there are more of them.
What is Timbre or Tone? – what kind of sound it is – we’ll get into this later.
Pass out Piano Keys sheet
How to Measure Pitch
Out of the concepts mentioned above, what we're really interested in today is pitch. Musicians use notes, or letters, to measure pitch. Play a melody in a few different keys; see how the melody is the same no matter what key you play in. This tells us that the notes relate to each other in similar ways. Notice from the piano keys that the notes repeat over and over, that they are cyclical. Notice also that all the black keys have two names: C# (C 'sharp') and Db (D 'flat') are the same note.
Play the octaves and see how all the C’s, A’s and D’s (in that order) are similar to each other. You can tell that even though the pitches are different, there’s something about them that sounds the same. We'll see why in a second.
Mathematicians measure pitch in hertz (Hz), or vibrations (waves) per second. Mathematicians generally refer to pitch as frequency. Fire up Wtune.exe, explain what it’s doing, and play the file with the ascending notes (the ascending notes are C, E, G, repeated three times). Notice that the frequencies, unlike the note names, do not repeat, but keep on getting bigger as the notes get higher. Notice also that these notes sound pretty good together. This is not by accident. These three tones are an example of a major triad, which we will go over in a bit.
Now let's look at timbre or tone. Play the file of the many C's. This is a C pitch played by several instruments. We can tell it's the same note each time, but we can also tell that it sounds very different each time. This is called timber or tone. When you hear a note, you're generally not just hearing one note, but a complex combination of several notes that are all related. These notes are called harmonics, or overtones. Play the construction of a note. The first tone, which is also the last tone, is a combination of the six tones that follow it. When combined, the tone sounds fuller and richer. Unless we specifically listen for the tones, we don't consciously hear them, but they're there just the same. Here is a visual illustration of this sound's components, including the final composite tone.
Now show the illustration of the plucked guitar string (footnote: I ripped this off from Catherine Schmidt-Jones' article from the Rice Connexions website). Notice that when a string vibrates, the shape of that vibration is a combination of lots of simple vibrations. Each one of these vibrations corresponds to an overtone or harmonic. Notice that in each illustration, the string gets "divided" into more and more equal sections. The length of the section and the frequency of the vibrations are inversely proportional (and we'll see more of that in a second).
Major Triads
Now take a look at Wtune, and play the construction of a note again. Watch the frequency of the different tones, and notice that they are all multiples of the first one. Check out the illustration of this note. The notes that correspond to these overtones are: A - A - E - A - C#. The notes A, C# and E make up a major triad, just like the C-E-G that we heard earlier. We noticed that the major triad sounded pretty good before, and now we can start to see why the notes sound good together. It's because that unless we hear a remarkably pure tone (like a sine wave generated from a synthesizer), when we hear a A we also hear a C# and an E within it. We might not consciously notice the overtones, but we hear them nonetheless. So when the other notes are added, it reinforces what we already hear, and it seems "right." Each of the 12 notes on the scale has two other notes that correspond to it that together form a major triad, and the relationships in frequency are all identical.
Editorial note: this is not to imply that all good music must be based on major triads.
The Circle of Fifths
Pass out Circle of Fifths sheet
So we've seen the notes laid out on a piano keyboard, in ascending order. We've also noticed that musicians see the notes in a cyclical pattern, with repetition occurring every 12 notes. Now we can look at the notes in a different order, what is called the "Circle of Fifths".
Look at the top "slice" of the circle, which corresponds to the note C. You'll notice that just inside the outer circle is another circle that has all the major triads that correspond to the notes. The last note of the C major triad, G, is also the next slice over if you move clockwise. The last note of the G triad is D, which is the next slice over, in the 2 o'clock position. This pattern continues all through the notes.
A little nomenclature: An interval is merely the relationship between two notes. Intervals are defined by how far apart the notes are. The intervals that make up a major triad are called a third (eg, from C to E) and a fifth (eg, from C to G). This probably originates from one of two places: either how the pianist plays the triad (with fingers #1, 3 and 5), or the order that the notes fall in a major scale. The major scale is not really relevant to our discussion right now, so I won't go into it, although how it originated would be interesting as well. Unfortunately, these terms can be quite misleading, since one way to find the third of a note is to step up four notes on the piano keys (don't forget the black ones!), and the way to find the fifth of a note is to step up seven notes. The interval from one note to the next note up with the same name (eg, from A to A) is called an octave.
So the Circle of Fifths gets its name from the order of the notes: as you go clockwise around the circle, the next note you run into will be the fifth of the note that you're on right now. The circle of fifths is vital for musicians that have to transpose from one key to another on the fly, or for those that do a lot of improvising.
But really what we want to do with the circle of fifths is look at how the
frequencies relate to each other. Let's recall what we heard earlier when
we listened to the overtones: C-C-G-C-E-G. We can listen to the
overtones of an A also, and note the frequencies and notes:
110-A
220-A
330-E
440-A
550-C#
660-E
If you've got a guitar, these are the harmonics for the A string. You can create this harmonics by plucking the string while holding your finger lightly in the middle of the string, then a third of the way down the string, then a fourth of the way down, etc.
Calculating Frequencies using Intervals
Let's look at those frequencies for a minute. We have three A's, with frequencies of 110, 220, and 440 Hz. We also have 2 E's with frequencies of 330 and 660 Hz. We can see pretty quickly that when you go up an octave, the frequency doubles. And we can see that since it's true for the A, the E, and earlier the C and G, this seems to be the case for all notes. Similarly, when you go down an octave, the frequency gets halved.
We can also notice that when we go from an A to the next E (either from 220 to 330 or from 440 to 660), we are multiplying the the frequency by 1.5 (or 3/2). Since this was also true for the C and G (and since all the notes seem to relate to each other in a very similar way), we can generalize and say that if you multiply the frequency of a note by 1.5, you go up a fifth.
So from these first two examples we see that if we look at the frequencies of the notes as a sequence, the sequence appears to be geometric rather than arithmetic. That is, to get from one note to a higher one, rather than add a certain amount to the frequency, we multiply a certain amount to the frequency. We could also say that this represents an exponential function rather than a linear one.
So what about thirds? When we went from A to C# we increased our frequency by 25%, so it can be said that if you multiply the frequency by 1.25 (or 5/4) you go up a third.
Now you can create the entire scale, from the frequencies we know. Imagine that we're going to design a synthesizer, and we need to know all the frequencies to assign to the notes. Get your Circle of Fifths handy, so you can have a quick reference to the triads.
Let's say that the frequency of C is c Hz. Later on when we figure out exactly what it is, we'll just plug in a value for c. We're going to find the frequencies of all the notes between c and 2c Hz (both of which are C's). A fun exercise for a class is to split into groups and come up with the frequencies separately. So here goes:
So here's a summary of the frequencies that we came up with:
You can extrapolate to notes outside of this interval by finding the note with the same name and multiplying or dividing the frequencies by two.
But Then...It Doesn't Work
The above example is just one way of figuring out the frequencies of the various notes. If several groups do this exercise at once, it will be very surprising if they all come up with the same answers, since there are lots of different frequencies that you can calculate that follow some of the rules. Unfortunately, there is no way to get frequencies that will follow all of the rules; the constraints that we have placed on our problem here make it impossible to find a solution.
Let's look for a second at our notes: they're all increasing in frequency, which is good, but they don't seem to be increasing very uniformly. This keyboard might sound OK if I'm playing something in the key of C, but it's going to sound lousy in other keys. For example, let's say that we look at the interval from E to G#. We know (once we check out the circle of fifths) that this is a third, so the ratio of the frequencies should be 1.25. But if we multiply 1.25c by 1.25, our answer is 1.5625c, which is not at all what we have for G# above. Both times we followed our rules, but the answers are quite different. If we played notes with frequencies of 1.25c and 1.6c (regardless of the value of c) as we have in our table above, the interval wouldn't sound like a third. This is not the only problem with our model above; there are lots of them.
An astute student might look at the circle of fifths and realize that if you go all the way around the circle, you will be multiplying your initial frequency by 1.5^12, which is 129.746. Since going around the circle puts you on the same note as when you started, the ratio of your new frequency to your original frequency should be a power of 2. 129.746 is very close to 2^7 = 128, but it's not equal. So even before we began our calculations we could have noticed that something was amiss.
So What Does All This Mean?
What all this means is that there was something wrong with our initial problem. Let's look at what we're trying to do here:
So the model that we came up with above seems to follow rule #2 well enough, since we had only one octave to deal with. Unfortunately, we saw that it doesn't follow rules #3 or #4 for all notes, and as a matter of fact, we saw from our examination of the circle of fifths that it can't follow #2 and #3 at the same time. So let's set aside rules #3 and #4 for now and just concentrate on rules #1 and #2. We noticed earlier that if we look at the frequencies of the notes as a sequence, the sequence is geometric. So we have a geometric sequence, and every twelve notes the frequency is doubled. If you'd prefer to talk functions rather than sequences, then what we have is an exponential function. There's a pretty good way to show this graphically: take the frequencies that we came up with above (or whatever frequencies your class comes up with) and extrapolate to the entire 88-key piano keyboard. You do this by knowing that the low A on a piano keyboard is 27.5 Hz, and starting from there. This is not a bad exercise for users of Excel. The resulting graph looks like this, and if your students have seen exponential functions recently, they should recognize this as being a pretty good approximation to an exponential function, but with some bumps in it (the bumps are more visible at the right side of the graph, where the frequencies are higher).
So let's figure out how to make the notes on our keyboard a nice, smooth geometric sequence.
A geometric sequence follows the pattern a×b^n for n = 1, 2, 3, ...
If every twelve notes the frequency is doubled, then 2[a×b] = a×b^13, which means that b^12 = 2. That means that if we multiply a frequency by the twelfth root of 2, then we get the next note. Let's look at what that looks like in the context of our prior example:
So what this means is that in order to meet the first two rules stated above, we have to be satisfied with an approximation of the next two rules. In this sequence, the ratio of frequencies of two notes that are a fifth apart is about 1.498, rather than 1.5. And the ratio of frequencies of two notes that are a third apart is about 1.26, rather than 1.25.
The Equal Tempered Scale
This "approximation" to perfect harmonics is called the "equal tempered scale," and it was developed so that keyboard instruments such as the piano could play equally well in any key. Unfortunately, for some musicians with finicky ears, it could also be described as the piano playing equally badly in any key. Unlike other instruments (such as the violin, viola, or even the guitar), the piano cannot play "in between" the notes, and cannot adjust the notes from one key to the other. So equal temperament is really the best you can get for the piano, as long as you stick to the traditional, 12-tone scale. There are other scales with more tones that have been suggested, but Western music in particular seems quite stuck to the 12-tone scale.
By the way, once you've "tempered" the scale, if you graph the frequencies of the 88-key piano keyboard, you get a much smoother function than we did in the example above. This time, the graph looks like this.
Student Work
When I have taught this lesson, I had the students first come up with some major triads (before I passed out the circle of fifths). But the major part of the students' work was in the creation of the frequencies. I had them work in groups to determine what all twelve frequencies would be (as was done above). Depending on the sophistication level of the student, they can come up with the ratios, as we did above (always keeping the variable c as part of the frequency), or they can come up with the actual frequencies themselves. When doing actual frequencies, it's good to use the notes between A and A, since the frequencies of A are nice, round numbers: 55, 110, 220, 440, 880, etc.
I had them do two presentations: the first one illustrated the frequencies. The illustrations had to be clear and reasonable, and the students had to be able to back up (show how they got) each frequency. After comparing different "right" answers and finding that we could get wildly different answers depending on what method we used, they had to go back to the drawing board. As a class we determined that we had to scrap the ratios of 1.25 for a third and 1.5 for a fifth, and that the frequencies had to have the form of an exponential function. The students had to figure out what the ratio was between the steps, and then illustrate their findings again. This time, there was such a thing as a right answer.
Helpful Links
Here are some resources on the internet that have very helpful information. The last two links are to the RUSMP home page (where I delivered this presentation) and my home page.
Piano Tuning Math
Math and the
Piano, from Dr. Math
Mathematics and Music
The Circle of Fifths
(from Rice Connexions)
Sound, Physics, and Music
(from Rice Connexions)
The Mathematics of
Piano Tuning (from American Mathematical Society)
Just vs. Equal Temperament