Music boxes have been around since the 18th century. A music box works by rotating a metal cylinder with protruding pins that pluck the individual prongs of a steel comb. The sounds that resonate from the vibrating prongs are the notes we hear — lower notes (lower pitch) from longer prongs and higher notes (higher pitch) from shorter ones. Some more complicated music boxes even contain a small drum or little bells.
Let’s use the violin as an example. When the length of a string is changed, it will vibrate with a different frequency. Shorter strings have higher frequency and therefore higher pitch. When a musician presses her finger on a string, she shortens its length. The more fingers she adds to the string, the shorter she makes it, and the higher the pitch will be.