The difference in sound quality when different instruments play the same note has to do with the concept of harmonics. Harmonics are higher frequencies present in a complex sound that are integer multiples of the fundamental frequency (main frequency). Each instrument has produces a different pattern of frequencies when playing the same note. This produces a different sound pattern. This difference in pattern leads to a different sound quality called timbre.
In this illustration, you can play simle simulations of different intrsuments using a simulated keyboard and both see the sound wave and hear the quality of the tone for four different instruments (Flute, Violin, Clarinet, and Trumpet).
To see the illustration in full screen, which is recommended, press the Full Screen button, which appears at the top of the page.
Below is a list of the ways that you can alter the illustration. The settings include the following:
Instrument: Choose from the four listed instruments to simulate.
Keyboard: click or touch a key to play the pitche associated
with that key in the selected instrument. The tone lasts as long as the click or touch. The graph will
plot that waveform for that note and instrument until the next tone is played.
Pressing this button restores the settings to their default values.