Desafinado, Part Three: Too Many Fifths

Last time we established the diatonic scale which has the nice property that there are five tone intervals and six fifths:

Note Frequency
A 220.000
B 247.500
C 260.741
D 293.333
E 330.000
F 347.654
G 391.111

and then double for the next octave up and so on.

But it’s a little weird in that B doesn’t have a fifth above it, just E a fifth below it. Similarly, F has no fifth below it. If there were any justice in this world, B and F ought to be fifth’s of each other. But they’re not quite right! A fifth above B is smack between F and G. Similarly, a fifth below F is between A and B.

We stuck E and B between two other notes. So let’s do it again. The fifth below F is a little bit below B, so we’ll call it “B flat”, or B♭. A fifth above B is a little bit above F, so we’ll call it “F sharp”, or F♯ In our first octave we have

Note Frequency
A 220.000
B♭ 231.769
B 247.500
C 260.741
D 293.333
E 330.000
F 347.654
F♯ 371.250
G 391.111

Gah. This doesn’t solve anything. Now we’ve got two more notes missing a fifth. Well, let’s add them. A fifth below B♭ is E♭, a fifth above F♯ is C♯. And again, we’ve got the same problem! A fifth below E♭ is A♭, a fifth above C♯ is G♯, and our first octave and a bit now looks like this:

Note Frequency
A♭ 206.017
A 220.000
B♭ 231.769
B 247.500
C 260.741
C♯ 278.438
D 293.333
E♭ 309.025
E 330.000
F 347.654
F♯ 371.250
G 391.111
A♭ 412.033
G♯ 417.657
A 440.000

Hold on a minute here. This is getting ridiculous. A♭ and G♯ are less than 2% apart, and seem to have gotten out of order — how is it that A♭ is lower than G♯?

This is a mess. In two octaves our stringed instrument now has over 25 strings and we don’t seem to be slowing down at all as far as adding new ones goes!

We could keep on doing this literally forever. Why? Because as the Pythagoreans discovered, there are no whole number ratios that can be squared, cubed, or put to any other power such that you eventually end up with two. We are never going to multiply any new note by any combination of 2/1, 1/2, 3/2 or 2/3 and end up with a note that we’ve already got in any other octave. The system is not closed.

Look at how close A♭ and G♯ are. Wouldn’t it be tempting to just “split the difference”, set them equal to each other, and be done with it?


Let’s throw out that A♭ in there and look at the ratios of successive notes — not as whole number ratios, but as percentages.

Note Increase
A♭ 7.0%
A 5.3%
B♭ 6.8%
B 5.3%
C 6.8%
D 5.1%
E♭ 7.0%
E 5.3%
F 6.8%
F♯ 5.3%
G 6.8%
G♯ 5.3%

Each note on this scale is between 5.1% and 7.0% higher than the previous note. What if we made every interval the same percentage? What percentage would it be? We need to double in frequency over an octave, and have twelve steps to do it in. The twelfth root of two is about 1.05946. Suppose we redo this twelve-note scale so that every note is 5.946% higher than the previous. What do we get?

Note Frequency Difference
A 220.000 0.00%
A♯/B♭ 233.082 0.57%
B 246.942 -0.23%
C 261.625 0.34%
C♯/D♭ 277.183 -0.45%
D 293.664 -0.11%
D♯/E♭ 311.127 0.68%
E 329.627 -0.11%
F 349.228 0.45%
F♯/G♭ 369.995 -0.34%
G 391.995 0.23%
G♯/A♭ 415.305 -0.56%
A 440.000 0.00%

This is pretty darn close to the scale we deduced from Pythagorean principles. And we have successfully split the difference — we say that A♭ and G♯ are the same frequency. Similarly, we add D♭ = C♯ and so on, so that every note has a fifth below and a fifth above.

This twelve-note scale is called the equally-tempered chromatic scale, and it is the scale that pianos and other musical instruments are actually tuned to.

This scale is a compromise between flexibility and tonal perfection. The price you pay for having a closed system is that instead of the frequency of the higher note being 1.5 times the frequency of the lower note, it’s actually 1.4983 times higher — every fifth interval is slightly flat.

And in fact that’s how piano tuners do it “by ear”. They tune one string to a tuning fork, then tune a fifth above it to a perfect 3:2 fifth, and then flatten the upper string just very slightly (or, equivalently, slightly sharpen the lower string if they are tuning a fifth below). Then they use that as the reference to tune the next note above it to a slightly flattened fifth, and so on until all twelve notes in one octave are tuned. Every other note can then be tuned to those reference notes. The process of getting the middle octave of the piano tuned is called “setting the temperament”, which explains my little pun in part one.

Bach’s famous set of preludes and fugues, one in all twelve major and minor keys, is called “The Well-Tempered Clavier”. Though it sounds good when played in an equal temperament, Bach actually designed the pieces to be played on a “Well Tempered” instrument. In that temperament certain intervals are kept pure while others are significantly off, and must be avoided by the composer.

Next time, we get computers back into the picture. We’ll write some programs that illustrate this fact, and thereby show how piano tuners can tune pianos by ear. Then in my final installment we’ll write a program that illustrates a psychoacoustic oddity called Shepard’s Illusion.

Comments (4)

  1. Dapper Dan says:

    This series is great. As a muscian I find it an excellent read. I would find it very interesting if you went further in to why humans find ratios of small numbers pleasing to the ear — as you alluded to earlier that you might.

  2. Tom T says:

    …this is what I get for disappearing into the realm of coding without coming up for air for two weeks…a gentleman I admire starts talking about a topic I used to know very well :) Couple of things:

    1. Actually, the Well-tempered clavier is called well-tempered because back in the day of Bach that’s the tuning system they used (which is distinct from Pyth and equal temp)…the effect is that the further you move away from C, the more "out of tune" the work sounds; and it’s truly night and day to hear some of the works in Bach’s WTC I and II in, say, E flat Minor (they are downright nasty :).

    2. I find it really interesting that when someone uses a blog to present a series of articles, a serial (heh) if you will, I end up having to scan the blog in question, find the title of said part in serial, and begin again…maybe there’s a better method of presentation? (This is not criticism btw, it’s one of those "a ha" moments where you feel like the need to expound is great and I’m sure coming back to it in a couple of days I’m going to feel like an ass)…

  3. Johny says:

    Eric, this series rocks. I applaud your digression, though I’m sure that developers familiar with and interested in VB feel otherwise.

    I just wanted to add that Bach and his contemporaries were well aware of the subtleties introduced by unequal and unjust "well" temperaments. They took advantage of the pure intervals present in the various keys, and often juxtaposed them with "off" phrases to great effect.

    One other similarity between programming and musical temperament: there were temperament wars just like there are language wars today. In fact, I believe that some officials of the Catholic Church denounced equal tempering as an invention of the devil.

  4. Jason Looney says:

    Eric, this series rocks. You’ve managed to explain the oddities of tone and scales very simply, and in relatively few words. This is really a fine piece of writing.

    (And now, finally, I have a good excuse for why my guitar is never in tune with the rest of my band’s: my pitch is mathematically perfect, while there’s is not… or something.)