The first musical machines came from Iraq in the 9th century and were powered by water. Starting in the 16th century, European clockmakers figured out how to make other machines that could play music by themselves, even without water. These machines developed over the centuries to become smaller and more complex. The first music boxes went into production in 1811 in Sainte-Croix, Switzerland. These music boxes were so popular that making them made up 10 percent of Switzerland's economy at the time.
The production of music boxes was at their height in the late 1800s, when many kinds of mechanical toys were popular. Unfortunately, by World War I the music box industry had fallen apart. The war made music boxes an expensive luxury. Also, the invention of the phonograph made music boxes out-of-date.