Every note you hear is a stack of hidden tones in whole-number ratios
Pluck a string and it does not vibrate at one frequency but at many at once: the full length, the halves, the thirds and so on. Those extra tones, the harmonic series, are why a clarinet and a saxophone sound different, and your brain can even hear a bass note that is not actually there.
A string or air column fixed at its ends vibrates in several modes simultaneously. The longest wave spans twice the string's length and gives the fundamental; the others divide the string into two, three, four or more equal segments, producing frequencies at 2, 3 and 4 times the base. Together they form an arithmetic sequence, f, 2f, 3f, 4f, and the fundamental is usually what we hear as the note's pitch.
Because hearing works logarithmically, the upper members seem to crowd together. The second harmonic sounds an octave above the first, the third a perfect fifth above that, and the fourth a perfect fourth higher still, two octaves over the base. Small whole-number ratios like these probably underlie why some intervals sound consonant. Western equal temperament, with its twelve equal semitones, sits slightly out of tune with several harmonics, particularly the 7th, 11th and 13th, and the Mixolydian mode agrees with the first 10 harmonics while the Ionian matches only the first 6.
Timbre depends mainly on how strongly each harmonic sounds. A clarinet and a saxophone share similar reeds and mouthpieces, but the clarinet's cylindrical bore suppresses even-numbered harmonics, while the saxophone's conical one lets them through, giving a more complex tone. The piano's strings drift slightly from ideal ratios, and instruments such as the marimba, timpani and singing bowls produce mostly inharmonic partials. Some flutes and ocarinas, by contrast, come very close to a pure tone.
Perception adds its own layer. Play a fifth at 200 and 300 Hz and a listener senses a faint combination tone at 100 Hz, the difference between them. More strikingly, when a few sine tones form part of a harmonic series, the brain fuses them and hears the pitch of the fundamental even if that frequency is absent. Early valveless French horns could play only the notes of this series.
Source: Harmonic series (music)