Strings can vibrate at different speeds
On a guitar, a longer string usually vibrates more slowly and makes a lower note. Pressing the string against a fret shortens the part that can vibrate, so it makes a higher note. Tightening a string can also change its pitch. 1 2
Air can vibrate, too
In a flute or trumpet, the player sets air vibrating inside a tube. Changing the length of the vibrating air changes the pitch. Drums make sound when a stretched surface vibrates, and the size and tightness affect the sound. 1 2
Resonance changes an instrument’s sound
The body of a guitar or violin vibrates along with its strings and helps make the sound louder. A flute’s air column vibrates inside the tube. The shape and material of an instrument affect its tone as well as its pitch. 1 2