You are about to enter the Twilight Zone. I submit for your consideration an oddly named book lying on an ordinary desk: How Equal Temperament Ruined Harmony (and Why You Should Care), by professor Ross W. Duffin. This book was written by a madman. Or is he? You should understand: If Duffin is mad, he's not alone. And the spaces between the lines of his book are filled with the silent laughter of the gods.
The gods are laughing at their little joke on musicians. When it comes to the tuning of instruments, especially keyboards and fretted instruments, nature drops a giant hairball in our path. Here's a short course on the arcana of tuning. It will take us to the meaning of a celebrated collection of keyboard pieces: J. S. Bach's The Well-Tempered Clavier, humankind's greatest musical riposte to the laughter of the gods.
In dealing with tuning, there are two main terms to know. One is interval. It means the distance between notes. The basic science of intervals was laid out in ancient Greece, perhaps first by the mathematician Pythagoras. The first notes of the C major scale are C, D, E, F, and G. The note E is the third note up from C, so the interval C-E is a third. The note G is five notes up, so C-G is a fifth. So musical intervals run second, third, fourth, fifth, and so on. (Some intervals can be major, like F to A, or minor, like F to A flat.)
OK? Now, as Pythagoras discovered, intervals are also mathematical ratios. If you take an open guitar string sounding E, stop it with your finger in the middle and pluck, you get E an octave above. The octave ratio, then, is 2:1. If you stop the string in the ratio 3:2, you get a fifth higher than the open string, the note B. The other intervals have progressive ratios; 4:3 is a fourth, and so on.
So far, all very tidy. But this is where things get hilarious. As Pythagoras also realized in mathematical terms, if you start with a C at the bottom of a piano keyboard and tune a series of 12 perfect 3:2 fifths up to the top, you discover that where you expect to have returned to a perfect high C, that C is overshot, intolerably out of tune. In other words, nature's math doesn't add up. A series of perfect intervals doesn't end at a perfect interval from where you started. If you tune three perfect 5:4 major thirds, it should logically add up to an octave, but it doesn't; the result is egregiously flat. It is this innate irreconcilability of pitch that, through the centuries, has driven men mad. Professor Duffin is a living representative of a long line of obsessives. Personal and institutional battles have been fought over the issue of tuning, fame won and lost. It was ever thus, wrestling with the gods.
What all this means in practice is that in tuning keyboards and fretted instruments, you have to screw around with the intervals in order to fit the necessary notes into an octave. In other words, as we say, you have to temper pure intervals, nudge them up or down a hair in some systematic way. Otherwise, you get chaos. So there's the second word you need to remember: The business of adapting tuning to nature's messy math is called temperament. And now we're halfway to understanding The Well-Tempered Clavier: It has to do with the art and science of keyboard tuning. We'll get to the wellness in a minute.
There have been some 150 tuning systems put forth over the centuries, none of them pure. There is no perfection, only varying tastes in corruption. If you want your fifths nicely in tune, the thirds can't be; if you want pure thirds, you have to put up with impure fifths. And no scale on a keyboard, not even good old C major, can be perfectly in tune. Medieval tunings voted for pure fifths. By the late Renaissance the tuning systems favored better thirds. The latter were various kinds of meantone temperament. In meantone, most of the accumulated fudges were dumped onto two notes, usually G# (aka A flat) and E flat. The shivery effect of those two notes played together in meantone temperaments earned it the name "wolf," which, like its namesake, was regarded with a certain holy fear.
By and large, in composing music for meantone keyboards you avoided the wolf, so never, for example, wrote in the key of A flat. In fact, those temperaments left only a few keys that were well-enough in tune to be usable: the keys between two flats and three sharps. Between the 16th and 18th centuries a lot of splendid music was written in meantone tuning, within that range of a dozen major and minor keys. But the inability to write in all 24 possible keys ate at composers' guts. More and more, there was a demand for a tuning system that would render all keys usable—and escape the wolf.
One of those tunings was already known to the ancients: equal temperament. Here the poison is distributed equally through the system: The distance between each interval is mathematically the same, so each interval is equally in, and slightly out of, tune. Nothing is perfect; nothing is terrible. So now it's all fixed, yes? The laughter of the gods has been stilled, right? Are you kidding? You fools: The gods never lose.