Lab v · the piano
A keyboard counts the way a clock counts — twelve, then round to the start. Which turns the circle of fifths into a question about common factors, and the piano's own step into a number that can never be written as a fraction.
Twelve notes, then it starts again. Walk up the white and black keys, naming as you go, and after twelve you are back at C — a different, higher C, but the same name, the same letter, the same place in the pattern. That is not a musical quirk. That is arithmetic modulo 12, the same maths as a clock face, and once you see the keyboard that way, one of music's oldest diagrams turns out to be a puzzle about common factors.
Past B there is no thirteenth note. You go back to C. A keyboard counts the way a clock counts: round and round, twelve at a time.
Tap a note to hear it. The small numbers are the note's address, 0 to 11.
Give every note a number instead of a letter: C is 0, C# is 1, all the way to B at 11. There is no 12 — 12 is 0, one octave up, the same note name in a higher voice. Mathematicians write that 12 ≡ 0 (mod 12), and it is exactly what your watch does when 13 o'clock quietly becomes 1.
Now the useful part. Transposing a tune — playing the same melody starting on a different note, so a singer can reach it — is nothing more than adding the same number to every note, and wrapping round when you go past 11. One addition, done four times. Nothing about the tune changes except where it sits.
Same tune, higher shelf. The rust-coloured boxes are the notes that went past 11 and wrapped round to the beginning — 11 o'clock plus two hours is 1 o'clock, not 13.
Keep adding 7 and you visit all twelve notes before you get home. Keep adding 4 and you only ever see three. The difference is one number: the greatest common divisor of your step and 12.
start on C, keep adding the same number, and see where you get
notes visited = 12 / gcd(s, 12)stepping by 7 — a perfect fifth
gcd(7, 12) = 1→12 / 1 = 12 notes
7 and 12 share no factor bigger than 1 — they are coprime — so the walk cannot settle into a short loop. It has to touch every one of the twelve notes before it can arrive home at C. That is why musicians draw a circle of fifths: s = 7 is coprime to 12, so it is a complete tour of the keys.
the notes it visits, in order
12 distinct notes — and 12 / gcd(7, 12) = 12. The count always matches.
| s | gcd(s, 12) | 12 / gcd | tours all twelve? |
|---|---|---|---|
| 1 | 1 | 12 | yes — coprime |
| 2 | 2 | 6 | no — stops at 6 |
| 3 | 3 | 4 | no — stops at 4 |
| 4 | 4 | 3 | no — stops at 3 |
| 5 | 1 | 12 | yes — coprime |
| 6 | 6 | 2 | no — stops at 2 |
| 7 | 1 | 12 | yes — coprime |
| 8 | 4 | 3 | no — stops at 3 |
| 9 | 3 | 4 | no — stops at 4 |
| 10 | 2 | 6 | no — stops at 6 |
| 11 | 1 | 12 | yes — coprime |
Only four step sizes make it all the way round: 1, 5, 7 and 11 — precisely the numbers below 12 that share no factor with it. Notice they come in pairs that add to 12: stepping up by 7 is the same tour as stepping down by 5, walked backwards. Music uses 7, the fifth, because it moves in the friendliest-sounding jump of the four.
Pure harmony is built from simple fractions. The piano's keys are built from a number that can never be written as a fraction at all. Every note you play is the join between the two.
what harmony wants — a fraction
3 / 2
= 1.500000 exactly
Two strings sound sweet together when one vibrates a simple whole-number multiple against the other. Three wiggles against two is the sweetest after the octave — the perfect fifth. Three and two: two whole numbers, one on top of the other. A rational number, and a short one.
what the keyboard is built from — an irrational
21/12
= 1.059463…
Twelve equal keys have to multiply up to a doubling, so one key must be the twelfth root of 2 — and that number cannot be written as any fraction whatsoever. Its decimals run forever without repeating. Every black and white key is a step of an irrational number.
where the two meet — the piano's fifth
| the fifth, C up to G | as a number | kind of number | frequency from C |
|---|---|---|---|
| pure — 3 : 2 | 1.500000 | rational | 392.44 Hz |
| the piano — 2^(7/12) | 1.498307 | irrational | 392.00 Hz |
1.498307 against 1.500000. The piano's fifth sits just under the pure one — about 2 cents flat (-1.96 cents, where 100 cents is one key). That is a gap of roughly one part in a thousand, and it is the price of admission: give up the exact fraction, and in exchange every one of the twelve keys works in every one of the twelve keys. Give up an irrational hair, keep the whole instrument.
For the classroom