Tune a keyboard so that C major sounds perfectly pure, and other keys go noticeably out of tune; tune it so every key sounds the same, and no interval is pure any more. Compare pure whole-number ratios with equal temperament's twelfth root of two and with Werckmeister III, a well temperament of Bach's time: see the frequencies side by side, and hear the difference as sine tones or with overtones.

This article and its interactive demo were created with the help of generative AI and editorially reviewed.

Frequency, period and wavelength

A musical tone is a pressure wave: air molecules are pushed together and pulled apart, over and over, in a regular rhythm. The time one full oscillation takes is the period T. The number of oscillations per second is the frequency f, measured in hertz (Hz), and the two are simply each other's inverse: f = 1/T. The A above middle C, the pitch orchestras tune to, has f = 440 Hz, so one oscillation lasts T = 1/440 s ≈ 2.27 milliseconds.

While the air at one spot oscillates, the wave travels on, at about 343 metres per second in air at 20 °C. In one period it moves exactly one wavelength λ, so λ = v/f, or λ = v·T. For A = 440 Hz that is 343/440 ≈ 0.78 m. The lowest note of a piano (27.5 Hz) has a wavelength of about 12.5 m, the highest (about 4,186 Hz) only about 8 cm.

Our ears hear frequency ratios, not differences. Doubling the frequency always gives the same step, an octave, whether from 110 to 220 Hz or from 440 to 880 Hz. That is why intervals are measured in cents: 1,200 cents to the octave, so that two intervals add when their frequency ratios multiply. The size of a ratio r in cents is 1200 · log₂(r).

Pure intervals: small whole-number ratios

Two notes sound smooth together when their frequencies stand in a ratio of small whole numbers: 2/1 for the octave, 3/2 for the fifth, 4/3 for the fourth, 5/4 for the major third, 6/5 for the minor third. These are called pure or just intervals.

The reason lies in overtones. A real string or pipe does not produce one frequency but a series: f, 2f, 3f, 4f and so on. In a pure fifth, the third overtone of the lower note and the second of the upper note fall on exactly the same frequency. Detune the fifth slightly and these two overtones differ by a few hertz; their sum then swells and fades at the difference rate, which the ear hears as beating or roughness. A pure sine wave has no overtones, which is why the demo lets you switch them on.

One key or all keys

The trouble is that pure intervals do not fit together. Twelve pure fifths should bring you back to the starting note seven octaves up, but (3/2)¹² ≈ 129.75 while 2⁷ = 128: the circle overshoots by about 23.5 cents, the Pythagorean comma. Four pure fifths should give a major third two octaves up, but (3/2)⁴ = 81/16 is larger than 5/4 · 4 = 80/16 by the syntonic comma, 81/80 or about 21.5 cents. And three pure major thirds fall short of an octave: (5/4)³ = 125/64 instead of 2, about 41 cents too small.

A singer or a violinist can adjust every note on the fly. A keyboard cannot: it has twelve fixed keys per octave. Tune them pure for C major and C major is beautiful, but the fifth D–A comes out as 40/27 instead of 3/2, 21.5 cents flat, and the major third E–G♯ as 32/25, 41 cents too wide. Choose 'Play in: D' or 'Play in: E' in the demo to hear how bad that is.

Equal temperament gives up purity everywhere in exchange for sameness everywhere. It divides the octave into twelve equal steps, each a factor of the twelfth root of two, 2^(1/12) ≈ 1.059463. A fifth is then 2^(7/12) ≈ 1.498307, only 2 cents narrow, but a major third is 2^(4/12) ≈ 1.259921, 13.7 cents wider than 5/4. With overtones, the equal-tempered major third C–E beats about ten times a second, the pure one not at all. Every key sounds exactly the same, which is why equal temperament became the standard tuning of pianos in the course of the 19th century.

What 'well-tempered' meant for Bach

Johann Sebastian Bach's Das Wohltemperierte Klavier (Book I 1722, Book II around 1742) has a prelude and a fugue in each of the 24 major and minor keys. 'Klavier' meant any keyboard instrument of his day, harpsichord, clavichord or organ, rather than the modern piano.

'Well-tempered' did not necessarily mean equally tempered. It meant a tuning in which every key is usable. Circulating temperaments of the time, such as the one the organist Andreas Werckmeister published around 1691 and known today as Werckmeister III, spread the comma unevenly: four fifths are narrowed and the other eight left pure. Keys near C get major thirds close to pure (C–E is only 3.9 cents wide), while remote keys like F♯ major get thirds as wide as 21.5 cents. Every key is playable, but each has its own colour; writers of the period, such as Johann Mattheson in 1713, described a distinct character for each key.

Which temperament Bach himself used is not documented and is still debated. Equal temperament is the limiting case of a well temperament: the case in which every key sounds alike.