Mathematics of Notes and Octaves
12 Tone Equal Temperament
On a standard piano keyboard, one octave is divided into 7 whole tones: A, B, C, D, E, F and G. In between these tones are 5 further notes which can be called either sharps or flats: A# (Bb), C# (Db), D# (Eb), F# (Gb), G# (Ab). (whether it's a sharp of a flat doesn't really matter, the note has the same frequency, just a different name). This gives us a grand total of 12 notes in one octave.
If you were to measure the frequency of a note, then measure the frequency of a note exactly one octave higher, you would see that the higher note has exactly twice the frequency of the lower note. For example, middle C has a frequency of 261.626Hz, and the C above it has a frequency of 523.251Hz.
Additionally, if you were to measure the frequency of a note, and then divide it by the frequency of the next lowest note, you would always get the same result: 1.05946. For example, if we divide the frequency of middle C (261.626Hz) by the next lowest note, a B with frequency 246.942Hz, we get 1.05946. In other words, the ratio between all adjacent notes is always the same. The number 1.05946 is special because it is the twelfth root of 2. This means that if you were to multiply it by itself 12 times, the answer would be 2. If you began at middle C, and multiplied 261.626Hz by 1.05946 12 times in a row, you would end up with 523.251Hz, which is exactly one octave higher as we found out in the paragraph above!
Dividing octaves up in this fashion, with equal ratios between notes, is called equal temperament. And when there are 12 notes in the octave, it is called 12 tone equal temperament, or 12-TET for short. But there is no law saying you have to do this. In the demo above, we have divided the octave up into 19 notes. This means the ratio between each note is now the nineteenth root of 2, which is 1.0371.
The Mind on Music
For some reason that no one really understands, there is a psychological effect upon human listeners in regards to the musical scale. The tonic pitch, or tonal center is not only the mathematical center of the scale, but is the psychological center as well. Human perception of the tonic pitch in relation to the other notes of the scale gives each note of the scale, including the tonic pitch, a distinct "personality" or identity. If we were to label each note of the major scale with a number, with the tonic pitch being 1, then the ascending major scale would be 1, 2, 3, 4, 5, 6, 7, 1. The last 1 is an octave above the first, and could also be called 8; an octave above 2 could also be called 9, etc. When individual notes of the scale are played in certain melodic sequences, such as 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9... the human ear anticipates the next note to be 8 or 1, the tonic pitch. In the major scale, 2, 5 and 7 are notes that the ear usually expects to be followed by 1, if they are preceded by notes in a certain sequence. The psychological pull is strongest toward the tonic pitch, but this phenomena also exists in other parts of the scale as well. Notes that make the ear expect a certain note to follow them are called tendency tones. This psychological effect extends into harmony, which is the playing of several notes together as chords, and into chord progression, or the sequence of the chords played. This tension and release effect is extremely important in the perception of music.