The ancient Greeks, who had only simple stringed instruments and flutes, noticed two things about pitches produced by a vibrating string. They noticed that a string of half the length of another but with the same tension and thickness sounded similar. For example if the original string played a frequency of 880 Hz the string of half the length would play a note of 440 Hz, an octave lower. The same thing happens by holding the string down in the center; each half will sound a note and octave higher than the full length. They also noticed that holding a string down at 2/3 of its length would produce two notes (by plucking each side) that sounded pleasant together. We call the interval between these two notes a perfect fifth (if you sing the children’s song Baa Baa Black Sheep the first Baa and Black are a fifth apart). Two other notes that sound good together are the notes produced by the long part of the 2/3 of the string and the note formed from holding the string down at its center. The interval between these two notes is called a perfect fourth and the ratio between them is 4/3 (the first two notes of Hark the Herald Angels Sing).
The frequency of the fundamental is the main factor that determines the pitch of the note we hear but not the only one. In the following you will notice that the frequencies are often not exactly harmonics nor whole numbers. In most cases this does not matter because our hearing is not accurate enough to detect the difference of a few Hz (remember that the JND in frequency is about 1 Hz for tones below 1000 Hz). The modern, equal temperament scale divides an octave into twelve equal steps (called semitones). Each semitone is divided into 100 cents. On the equal-tempered scale (see below) this is about 0.3 Hz. Trained musicians can hear a difference in frequencies of five cents (1.5 Hz) under test conditions. Normal music notes may be off from their intended frequency by as much as 20 cents (about 6 Hz) but we don’t notice unless the sounds are isolated.
Is there a reason that notes with a ratio of 2/3 (a perfect fifth) and other ratios sound good together? Maybe. In the case of fifths the harmonics overlap (a note whose fundamental is 300 Hz has harmonics at 600 Hz and 1200 Hz which overlap with the harmonics of a fundamental at 200 Hz which are 400 Hz, 600 Hz, 800 Hz, 1000 Hz and 1200 Hz). In other words, there is less dissonance (roughness produced by overtones which are close to but not exactly the same frequency). It is not clear why humans tend to find notes with overlapping harmonics pleasing but this seems to be true in most cultures (although the notes and scales used may be different). The western world inherited Greek preferences for scales but many non-western cultures include other preferences which sound odd to the western ear. An appreciation for these sounds can be learned, however.
The realization that the ratios 2/3 and 1/2 (octaves) sound good together lead the Greek philosopher and mathematician Pythagoras to come up with what is now known as the Pythagorean scale. To construct this scale we start with a note or frequency. If we double it we have the same note an octave higher. If we multiply or divide by 3/2 we have notes in between. In the example below we start with the note D at 147 Hz and apply the rule (the frequencies are rounded off to whole numbers in this example). The first five notes generated by this procedure are called the pentatonic scale which has been used for two thousand years. If we generate two more notes we have a septatonic scale or seven notes between the two notes an octave apart. The procedure can be continued to find other notes in this octave.
It should be noted that Pythagoras only codified this scale mathematically; musicians were already using it because it sounded good. It seemed to be interesting and important to Pythagoras and other early mathematicians that what sounded good to the ear could be explained as simple mathematical ratios between the lengths of the string on a harp.
A particular choice of starting note and system of generating a note scale is called a mode. If we start with the note F and multiply/divide by 3/2 and 2 each time we generate a scale called the Lydian mode. If we start with B and apply the rule the seven note scale is the Locrian mode.
A later mathematician and astronomer, Ptolemy, added notes to the Pythagorean scale by including ratios of 5/4. Using the same procedure as above (multiplying or dividing by 5/4 and 2) will also produce a seven note scale but with slightly different frequencies. So for example 261.63 Hz × 5/4 = 327.04 Hz which would be the note B but it doesn’t quite have the same frequency as the B in the Pythagorean scale (331.12 Hz). However most people cannot hear this small of a frequency difference unless a direct comparison is being made with another tone (in which case you can hear beats) so a song played or sung with this set of frequencies sounds about the same as the Pythagorean scale. For the Pythagorean scale, it doesn’t matter which note you start on, each scale sounds similar because the spacing is similar because the ratio is always 2/3. This turns out not to be true for the scale created by Ptolemy because some ratios are 4/5 and others are 2/3. So shifting keys or modes (starting at a different note) does make a difference in the Ptolemaic system but not in the Pythagorean.
In the 14th century music began to get more complicated. Instead of everyone singing the same note in a choir, harmony became popular. Prior to this time most music in Europe was church music and was governed by strict rules (they were supposed to always use the Pythagorean scale). As folk music became more popular some of these rules were relaxed. Rounds (like Row, Row your boat), where each singer sings the same song but starts a bar later, also became popular. In order for this to sound good most of the notes of the song should harmonize with each other (so that when they overlap there is harmony; in other words many of the harmonics overlap). What performers discovered was that the notes in the Ptolemy scale allowed more harmonizing because there is more of a variety of notes. Eventually this scale replaced the more rigid Pythagorean scale. We now call the Ptolemaic scale the Just scale.
Seems simple enough; start with a note at a given frequency, apply the multiplication rules to get the other notes in the scale. So multiplying by 2 gives a note an octave higher, multiplying by 3/2 a note in between, and so forth. What could go wrong?
We already know the Pythagorean scale does not give exactly the same frequencies as the Ptolemaic (or Just) Scale. Let’s stick with Pythagoras and decided we want to fill in the notes between C (at 261.63 Hz) and C an octave above (261.63 Hz × 2 = 523.15 Hz). We start with 261.63 Hz and multiply by 3/2 to get 392.44 Hz which is G. We take G (392.44 Hz) and multiply by 3/2 again to get 588.67 Hz which is an octave above so we divide by 2 to get 294.33 Hz which is D. We can get A at 441.49 Hz by multiplying 294.33 Hz by 3/2. Multiplying by 3/2 and dividing by 2 gives 331.12 Hz which is E. Multiplying by 3/2 gives 496.69 Hz which is B. Repeating this procedure (multiplying by 3/2 and dividing by 2 if it is outside the octave) two more times gives F# (F sharp) and C# (C sharp). So far so good.
Now we run into a problem. Because if we use this C# at 279.39 Hz and multiply by 3/2 we get 419.08 Hz which is not a note on the scale! In fact it is so close to Ab (A flat) at 412.42 Hz that we probably would mistake it for Ab. Likewise if we do the procedure again we get 314.31 Hz which is very close to Eb at 310.08 Hz but is not on this scale. In other words, the Pythagorean system of generating notes finds an infinite set of notes between C at 261.63 Hz and the C an octave above. The Pythagorean solution was to stop after five notes (a pentatonic scale) and not use any more. But the idea of using the simple mathematical rule of 2/3 for generating more notes where all the notes harmonize doesn’t work.
As music became more complicated, musicians started to want to switch keys during the piece of music. When a musician changes key they are essentially starting with a different note (say B at 496.67 Hz in the Pythagorean scale) and using an octave based on that new starting point. But starting on a different note and applying the rule to generate the scale results in new notes which are not close to previous notes (it almost works in the Pythagorean scale but not in the Just temperament). If you have a musical instrument, say a piano, set up so that the notes correspond to a Just scale based on F (the key of F) for example, changing to a key of B isn’t possible unless you add extra strings to the piano because there are new frequencies in the key of B. The new notes also do not harmonize with the old notes. To maintain the Just scale requires a different instrument for each key you want to play in (or many extra strings).
This problem gets worse when you try to generate notes an octave above or below the initial octave using the rules; the higher octave doesn’t harmonize with the lower octave. Notes an octave above should be twice the frequency of the note in the lower octave but using the formula to generate the note doesn’t give a frequency twice that of the lower octave. For singing and even violins, which can make any desired frequency (within a given range), this isn’t a problem because the performer can just shift the note a little so that it sounds right. But for the piano, organ, flute and stringed instruments with frets this is a big problem because the notes are determined by the construction of the instrument. So it appears there is a choice between making instruments so they harmonize well in one octave and scale but not another; or have different instruments for each octave and each scale; or re-tune the instrument every time you want to change scales or octaves.
The solution (eventually, after several competing proposals) was to go to what is called the well or equal-tempered scale. In this scale the frequencies between octaves are chosen to be equally spaced in which case the ratio between notes is 1.1225 (the notes can be generated by multiplying or dividing by either 2 and/or 1.1225). This divides an octave into twelve notes. Another way to write this mathematically is f = fo × (21/12)n where fo is generally chosen to be 440 Hz in modern times. 21/12 = 1.059463094… and each value of n generates a new note.
Johann Sebastian Bach was the musician who managed to get the world to pay attention to this new scale by writing music (this was in the 1700’s) specifically to sound good for instruments tuned this way. Eventually most western cultures adopted it (some other cultures did not which is why, for example, music from India sounds very different than western music). Because the ratios between frequencies are not exactly 2/3 or 4/5 you can often hear chords where there is beating and dissonance. The chords also do not sound as pure as Pythagorean tuning because they are not exactly harmonic however the greater flexibility to change keys and to (almost) harmonize over several octaves makes equal temperament a useful compromise. Below is a diagram of the frequencies of various scale systems (also called temperaments).
Modern musical scales in western culture are different in one other way from older classical music. At the time of Bach the scales were based on the note A being about 415 Hz. In Handel’s time the frequency of A was 422.5 Hz and today it is 440 Hz. This gradual shift upward was made possible by stronger materials for pianos and guitars which could withstand the greater tension in tighter strings.
As mentioned previously, the constraints of making a piano with a wide range of notes but is not too large requires using strings that are dense and under a great deal of tension. This makes them slightly nonlinear, meaning that the overtones are not exactly harmonic. If the piano was tuned in a precise mathematical way (using any of the scale systems) these anharmonic overtones would not sound well when two notes an octave apart are played. What is generally done is to tune the piano by ear so that it sounds correct, starting with low notes and working up to higher pitches. The result of this process is that, for a modern piano, low notes are slightly flat while high notes are slightly sharp. The figure below (called a Railsback curve) shows the difference from perfect tuning of a modern piano.