Look at a piano: seven white keys and five black keys, again and again. Why twelve notes in an octave, and not ten or twenty? The answer goes back two and a half thousand years, to the Greek philosopher Pythagoras.

The legend of the hammers

A famous legend says that Pythagoras walked past a blacksmith's workshop and noticed that some hammers rang together beautifully. The story is a legend, and the physics in it does not quite work, but the discovery behind it is real: notes sound well together when the lengths of their strings are in simple ratios.

Simple ratios

  • Half the string, a ratio of 2 to 1, gives the octave: the same note, higher.
  • Two thirds of the string, 3 to 2, gives the fifth, the most consonant interval after the octave.
  • Three quarters of the string, 4 to 3, gives the fourth.

Twelve fifths, and you are home

Start on any note and go up a fifth, then another, and another, bringing each note back into the same octave. After twelve fifths you land almost exactly on the note you started from. Those twelve steps give the twelve notes of the octave. The small gap that remains, called the Pythagorean comma, is why tuning a keyboard turned out to be a puzzle for centuries.

Seven white keys, five black keys

Take seven fifths in a row, F, C, G, D, A, E, B, and you have the seven white keys. The next five fifths, F sharp, C sharp, G sharp, D sharp, A sharp, are the black keys. Look at that list again: it is exactly the order of sharps in key signatures. The scales and modes of Western music grew from those first seven notes, and the other five became the notes in between.

iCanPianoWhat it means at the keyboard

Because the staff was built for the seven notes, the five black keys have no place of their own on it and need sharp and flat signs. iCanPiano Style gives them a place in the note itself: a note on a black key is half black and half white, and the black half points to the key.

  • F sharp: right half black. Play the black key to the right of F.
  • B flat: left half black. Play the black key to the left of B.
  • B natural: no natural sign. A note that is all black or all white is played on a white key.
D♯A♭CDEFGABWhite half on the white key, black half on the black key

Frequently asked questions

Why are there 12 notes in an octave?

Because stacking twelve perfect fifths brings you almost exactly back to the starting note. Those twelve fifths give the twelve notes, a discovery credited to Pythagoras.

Why does the piano have 7 white and 5 black keys?

Seven fifths in a row give the seven notes of the scale, the white keys. The next five fifths give the black keys.

What is the Pythagorean comma?

The small difference between twelve pure fifths and seven octaves. It is why keyboards need a compromise tuning, such as equal temperament.

All articles