The names of the various intervals, and the way they are written on the staff, are mostly the result of a long history of evolving musical notation and theory. But the actual intervals - the way the notes sound - are not arbitrary accidents of history. Like octaves, the other intervals are also produced by the harmonic series. Recall that the frequencies of any two pitches that are one octave apart have a 2:1 ratio. Every other interval that musicians talk about can also be described as having a particular frequency ratio. To find those ratios, look at a harmonic series written in common notation.
Figure 1: Harmonic series written as notes.
Look at the third harmonic in Figure 1. Its frequency is three times the frequency of the first harmonic (ratio 3:1). Remember, the frequency of the second harmonic is two times that of the first harmonic (ratio 2:1). In other words, there are two waves of the higher C for every one wave of the lower C, and three waves of the third-harmonic G for every one wave of the fundamental. So the ratio of the frequencies of the second to the third harmonics is 2:3. (In other words, two waves of the C for every three of the G.) From the harmonic series shown above, you can see that the interval between these two notes is a perfect fifth. The ratio of the frequencies of all perfect fifths is 2:3.
Modern Western music uses the equal temperament tuning system, which divides the octave into twelve notes that are equally far apart. (They do have the same frequency ratios, unlike the half steps in the harmonic series.) The positive aspect of equal temperament (and the reason it is used) is that an instrument will be equally in tune in all keys. The negative aspect is that it means that all intervals except for octaves are slightly out of tune with regard to the actual harmonic series. Interestingly, musicians have a tendency to revert to true harmonics when they can (in other words, when it is easy to fine-tune each note). For example, an a capella choral group, or a brass ensemble, may find themselves singing or playing perfect fourths and fifths, "contracted" major thirds and "expanded" minor thirds, and half and whole steps of slightly varying sizes.
The harmonic series is particularly important for brass instruments. A pianist or xylophone player only gets one note from each key. A string player who wants a different note from a string holds the string tightly in a different place. This basically makes a vibrating string of a new length, with a new fundamental.
But a brass player, without changing the length of the instrument, gets different notes by actually playing the harmonics of the instrument. Woodwinds also do this, although not as much. Most woodwinds can get two different octaves with essentially the same fingering; the lower octave is the fundamental of the column of air inside the instrument at that fingering. The upper octave is the first harmonic.
NOTE: In some woodwinds, such as the clarinet, the upper "octave" may actually be the third harmonic rather than the second, which complicates the fingering patterns of these instruments.
t is the brass instruments that excel in getting different notes from the same length of tubing. The sound of a brass instruments starts with vibrations of the player's lips. By vibrating the lips at different speeds, the player can cause a harmonic of the air column to sound instead of the fundamental. Thus a bugle player can play any note in the harmonic series of the instrument that falls within the player's range. Compare these well-known bugle calls to the harmonic series above.
Figure 2: Although limited by the fact that it can only play one harmonic series, the bugle can still play many well-known tunes.
For centuries, all brass instruments were valveless. A brass instrument could play only the notes of one harmonic series. (An important exception was the trombone and its relatives, which can easily change their length and harmonic series using a slide.) The upper octaves of the series, where the notes are close enough together to play an interesting melody, were often difficult to play, and some of the harmonics sound quite out of tune to ears that expect equal temperament. The solution to these problems, once brass valves were perfected, was to add a few valves to the instrument; three is usually enough. Each valve opens an extra length of tube, making the instrument a little longer, and making available a whole new harmonic series. Usually one valve gives the harmonic series one half step lower than the valveless intrument; another, one whole step lower; and the third, one and a half steps lower. The valves can be used in combination, too, making even more harmonic series available. So a valved brass instrument can find, in the comfortable middle of its range (its middle register), a valve combination that will give a reasonably in-tune version for every note of the chromatic scale.
NOTE: Trombones still use a slide instead of valves to make their instrument longer. But the basic principle is still the same. At each slide "position", the instrument gets a new harmonic series. The notes in between the positions aren't part of the chromatic scale, so they are usually only used for special effects like glissandos (sliding notes).
Figure 3: These harmonic series are for a brass instrument that has a "C" fundamental when no valves are being used - for example, a C trumpet. Remember, there is an entire harmonic series for every fundamental, and any note can be a fundamental. You just have to find the brass tube with the right length. So a trumpet or tuba can get one harmonic series using no valves, another one a half step lower using one valve, another one a whole step lower using another valve, and so on. By the time all the combinations of valves are used, there is some way to get an in-tune version of every note they need.
NOTE: The French horn has a reputation for being a "difficult" instrument to play. This is also because of the harmonic series. Most brass instruments play in the first few octaves of the harmonic series, where the notes are farther apart and it takes a pretty big difference in the mouth and lips (the embouchure, pronounced AHM-buh-sher) to get a different note. The range of the French horn is higher in the harmonic series, where the notes are closer together. So very small differences in the mouth and lips can mean the wrong harmonic comes out.
tring players also use harmonics, although not as much as brass players. Harmonics on strings have a very different timbre from ordinary string sounds. They give a quieter, thinner, more bell-like tone, and are usually used as a kind of ear-catching special-effect.
Normally a string player holds a string down very tightly. This shortens the length of the vibrating part of the string, in effect making a (temporarily) shorter vibrating string, which has its own full set of harmonics.
To "play a harmonic", the string is touched very, very lightly instead. The length of the string does not change. Instead, the light touch interferes with all of the vibrations that don't have a node at that spot.
Figure 4: String harmonics.
The thinner, quieter sound of "playing harmonics" is caused by the fact that much of the harmonic series is missing from the sound, which will of course affect the timbre. Lightly touching the string in most places will result in no sound at all. This technique only works well at places on the string where a main harmonic (one of the longer, louder lower-numbered harmonics) has a node. Some string players can get more harmonics by both holding the string down in one spot and touching it lightly in another spot, but this is an advanced technique.