Piano Keyboard

Figure 1. Layout of a piano keyboard. Key numbers are shaded. The notation C4 means the C key in the fourth octave.

The keyboard on a piano is divided into octaves, the notes in each octave being twice the frequency of the notes in the next lower octave. For example, the Middle-C A-440 reference note is the A above middle-C which is usually called A-440 (or A4) because its frequency is 440 Hz. Each octave contains 12 notes (5 black keys and 7 white) and the ratio between the frequencies of the notes is constant between successive notes. Thus this ratio must be 21/12. Since middle C is 9 keys below A-440, its frequency is approximately 261.6 Hz.

Musical notation shows which notes are to be played and their relative timing (half notes last twice as long as quarter notes, which, in turn, last twice as long as eighth notes). Figure 2 shows how the keys on the piano correspond to notes drawn in musical notation.

Figure 2: Musical notation is a time-frequency diagram where vertical position indicates the frequency of the note to be played.

Another interesting relationship is the ratio of fifths and fourths as used in a chord. Strictly speaking the fifth note should be 1.5 times the frequency of the base note. For middle-C the fifth is G, but the frequency of G is about 392 Hz which is not exactly 1.5 times 261.6. It is very close, but the slight detuning introduced by the ratio 21/12 gives a better sound to the piano overall. This innovation in tuning is called "equally-tempered" and was introduced in Germany in the 1760's and made famous by J. S. Bach in the Well Tempered Clavichord.

You can use the ratio 21/12 to calculate the frequency of notes anywhere on the piano keyboard. For example, the E-flat above middle-C (black key number 43) is 6 keys below A-440, so its frequency should be f = 440 x 2-6/12 = 440/sqrt(2) = about 311 Hertz.

Reference

McClellan, Schafer and Yoder, DSP FIRST: A Multimedia Approach. Prentice Hall, Upper Saddle River, New Jersey, 1998. Copyright (c) 1998 Prentice Hall. p 435-437.


Maintained by John Loomis, last updated 4 Sep 2003