Stack twelve perfect fifths and you should arrive, seven octaves up, at the note you began on. You don't. You miss — every time, by the same small, sour amount.
Almost every musical tradition keeps two intervals. The octave — a string halved, a frequency doubled, a ratio of 2 : 1 — sounds so like the note below it that we give the two the same name. And the perfect fifth, the next-simplest agreement the ear will accept: a ratio of 3 : 2. From these two ratios, in principle, you can build a whole tuning. The trouble is that they do not fit together.
Go up by fifths and you climb in steps of 3/2. Twelve of them should, the old hope went, land you exactly seven octaves above where you started — back to the same note, a circle closed. Multiply it out and the hope breaks:
twelve just fifths = (3/2)12 = 531441/4096 ≈ 129.7463
seven octaves = 27 = 128
the ratio between them = 531441/524288 ≈ 1.013643
in cents ≈ 23.46 — the Pythagorean comma
Twenty-three and a half cents: not quite a quarter of a semitone. Small on paper, unmissable in air. Sound the note you arrived on against the note you meant to reach and they beat against each other about three times a second — the slow, seasick wobble of two pitches that are almost, but not, the same. The Hear the comma button above plays exactly that.
You cannot have it all: pure octaves, pure fifths, and a tuning that closes. Something must give, and the history of keyboard tuning is the history of choosing what. Meantone narrowed most fifths to keep the thirds sweet, and exiled the error into one unplayable interval — the wolf, which howls. Well temperaments spread the damage unevenly, so that every key could be played but each kept its own colour, its own degree of tension. Equal temperament, the modern truce, divides the octave into twelve identical steps of 21/12 ≈ 1.059463 and smears the comma evenly across all of them: every fifth is flat by about 1.955 cents, twelve of those make the comma exactly, and no key is pure but none is unusable.
It is often repeated that Bach's Well-Tempered Clavier was written to prove equal temperament. That is most likely a myth. Well-tempered named a family of unequal temperaments in which all twenty-four keys are playable yet each retains a distinct character; equal temperament is only one, latish member of that family, and which tuning Bach actually intended is still argued. The piece demonstrates that you can travel through every key — not that every key was made to sound the same. The distinction matters, and flattening it is its own small comma.
The gap is not a measurement error or a flaw in any instrument. It is arithmetic, and it is permanent. For the circle of fifths to close, some whole number of fifths would have to equal some whole number of octaves: (3/2)m = 2k for positive integers, which rearranges to 3m = 2m+k. But a power of three is always odd and a power of two is always even, so the two can never be equal. The fifth and the octave are incommensurable — they share no common measure — in precisely the sense that the diagonal of a square is incommensurable with its side. The comma is the size of the gap that proves it, and it is the same odd-against-even contradiction that, elsewhere in this archive, shows the square root of two can be no fraction at all. One refusal, heard two ways.