# Fine Tuning

One of my hobbies is music. I’m particularly interested in the mathematics of music. That may sound a bit odd in our culture where music is an arts subject. But for  most of western culture music was a discipline of the sciences.

Anyway. Here’s a curious thing. In western music we divide octaves into 12 notes. We then take a subset of these notes (a scale) to form the basis of a piece of music. The fact we split the octave into 12 isn’t an accident.

An octave itself is a doubling of the frequency of a note. So imagine a string that vibrates and creates a note. Its ends are fixed. It can wobble as a whole length, or it can set up two smaller wobbles with the center point not moving. That second pattern will sound an octave above the first. Hearing the octave along with the original sound is so common that we naturally ‘hear’ the two pitches as being the same note. So it makes sense musically to group pitches into octaves. Double the frequency and you get a note that ‘feels’ the same as the first note, just higher. This sense of equality is then reinforced by listening to music all our lives that uses this equality for effect – strengthening our ability to listen for it.

As well as doubling, you can have any whole number multiple of the original frequency. These are called harmonics (the octave is the second harmonic and the original note is the first harmonic). Four times (fourth harmonic) is obviously two octaves higher. But the third harmonic is the interesting one. If you split the octave into 12 equally spaced notes, the seventh of those notes will be, approximately, the third harmonic. In other words, with 12 notes you get the third harmonic as part of your scale. And in fact this is a crucial feature of western music, because this seventh note is one of the most important (it is called the dominant note, in fact). Now there are as many harmonics as you care to generate, but only the first three harmonics (and their doublings and treblings) are part of the western 12-note scale.

Even then I said approximately. We tune our instruments nowadays to an ‘equal temperament’ scale where the 12 notes are equally spaced through the octave. Historically tuning was done by harmonics, so the scale was tuned so the third harmonic was the 7th note. Either way you’ve got a small error somewhere, either the harmonic is slightly out, or the notes aren’t equally spaced.

How much error? Well it turns out to be just less than 2%.

And here is the fascinating bit, at least for me. 12-notes in the scale is the best way of dividing an octave so it gives you your (approximate) third harmonic. If you do the math, then the next number of divisions that would give you as good a fit would be 41 (and in fact there is a reasonably useful 41-note scale that makes use of this, but it is a bit combersome).

Isn’t it amazing that the laws of mathematics were created so that the third harmonic was almost exactly on a 12-note scale? Certainly none of the great works of music: the Messiah, the Requiem, La Bohem, or Lady Gaga would have been possible without it. They must have been designed that way to allow the western musical tradition to flourish.

[Incidentally, and with geeky irrelevance, if we wanted a scale with less than 2% error for both the third and fifth harmonics, then we’d need a scale with 1,783 nodes per octave. If we want the same accuracy with the seventh harmonic too, it would have 18,355 notes per octave. I don’t know how small a pitch difference we’re capable of discerning, but I’d guess that would be well below most people’s perceptual boundary. – Those higher harmonics do crop up in some kinds of music, but they aren’t part of the scale.]