A music box or musical box is an automatic musical instrument in a box that produces musical notes by using a set of pins placed on a revolving cylinder or disc to pluck the tuned teeth (or lamellae) of a steel comb. They were developed from musical snuff boxes of the 18th century and called carillons à musique (French for "chimes of music"). Some of the more complex boxes also contain a tiny drum and/or bells in addition to the metal comb.
The original snuff boxes were tiny containers which could fit into a gentleman's waistcoat pocket. The music boxes could have any size from that of a hat box to a large piece of furniture, but most were tabletop specimens. They were usually powered by clockwork and originally produced by artisan watchmakers. For most of the 19th century, the bulk of music box production was concentrated in Switzerland, building upon a strong watchmaking tradition. The first music box factory was opened there in 1815 by Jérémie Recordon and Samuel Junod. There were also a few manufacturers in Bohemia and Germany. By the end of the 19th century, some of the European makers had opened factories in the United States.
The cylinders were normally made of metal and powered by a spring. In some of the costlier models, the cylinders could be removed to change melodies, thanks to an invention by Paillard in 1862, which was perfected by Metert of Geneva in 1879. In some exceptional models, there were four springs, to provide continuous play for up to three hours.
The very first boxes at the end of the 18th century made use of metal disks. The switchover to cylinders seems to have been completed after the Napoleonic wars. In the last decades of the 19th century, however, mass-produced models such as the Polyphon and others all made use of interchangeable metal disks instead of cylinders. The cylinder-based machines rapidly became a minority.
The term "music box" is also applied to clockwork devices where a removable metal disk or cylinder was used only in a "programming" function without producing the sounds directly by means of pins and a comb. Instead, the cylinder (or disk) worked by actuating bellows and levers which fed and opened pneumatic valves which activated a modified wind instrument or plucked the chords on a modified string instrument. Some devices could do both at the same time and were often combinations of player pianos and music boxes, such as the Orchestrion.
There were many variations of large music machines, usually built for the affluent of the pre-phonograph 19th century. Some were called the Symphonium, others were called the Concert Regina Music Box machine. Both variations were as tall as a grandfather clock and both used interchangeable large disks to play different sets of tunes. Both were spring-wound and driven and both had a bell-like sound. The machines were often made in England, Italy, and the US, with additional disks made in Switzerland, Austria, and Prussia. Early "juke-box" pay versions of them existed in public places also. Marsh's free Museum and curio shop in Long Beach, Washington (US) has several still-working versions of them on public display. The Musical Museum, Brentford, London has a number of machines. The Morris Museum in Morristown, NJ, USA has a notable collection, including interactive exhibits. In addition to video and audio footage of each piece, the actual instruments are demonstrated for the public daily on a rotational basis.
At the end of the 19th century and the beginning of the 20th, most music boxes were gradually replaced by player pianos, which were louder and more versatile and melodious, when kept tuned, and by the smaller gramophones which had the advantage of playing back voices. Escalating labour costs increased the price and further reduced volume. Now modern automation is helping bring music box prices back down.
Collectors prize surviving music boxes from the 19th century and the early 20th century as well as new music boxes being made today in several countries (see "Evolving Box Production", below). The cheap, small windup music box movements (including the cylinder and comb and the spring) to add a bit of music to mass-produced jewellery boxes and novelty items are now produced in countries with low labour costs.
Many kinds of music box movements are available to the home craft person, locally or through online retailers.
This article is in a list format that may be better presented using prose. (August 2012)
9th century: In Baghdad, Iraq, the Ban? M?s? brothers, a trio of Persian inventors, produced "the earliest known mechanical musical instrument", in this case a hydropowered organ which played interchangeable cylinders automatically, which they described in their Book of Ingenious Devices. According to Charles B. Fowler, this "cylinder with raised pins on the surface remained the basic device to produce and reproduce music mechanically until the second half of the nineteenth century."
1598: Flemish clockmaker Nicholas Vallin produces a wall mounted clock which has a pinned barrel playing on multiple tuned bells mounted in the superstructure. The barrel can be programmed, as the pins can be separately placed in the holes provided on the surface of the barrel.
1665: Ahasuerus Fromanteel in London makes a table clock which has quarter striking and musical work on multiple bells operated by a pinned barrel. These barrels can be changed for those playing different tunes.
1760s: Watches are made in London by makers such as James Cox which have a pinned drum playing popular tunes on several small bells arranged in a stack.
1780: The mechanical singing bird is invented by the Jaquet-Droz brothers, clockmakers from La Chaux-de-Fonds. In 1848, the manufacturing of the singing birds is improved by Blaise Bontems in his Parisian workshop, to the point where it has remained unchanged to this day. Barrel organs become more popular.
1796: Antoine Favre-Salomon, a clockmaker from Geneva replaces the stack of bells by a comb with multiple pre-tuned metallic notes in order to reduce space. Together with a horizontally placed pinned barrel, this produces more varied and complex sounds. One of these first music boxes is now displayed at the Shanghai Gallery of Antique Music Boxes and Automata in Pudong's Oriental Art Center. Numerous musical objects are produced in greater quantities in Geneva by several makers.
1800: Isaac Daniel Piguet in Geneva produces repeating musical watches with a pinned horizontal disc operating radially arranged tuned steel teeth.
1811: The first music boxes are produced in Sainte-Croix; an industry which surpasses the watchmaking and lace industries, and rapidly brings renown to the town. At this time, the musical-box industry represents 10% of Switzerland's export.
1865: Charles Reuge, a watchmaker from the Val-de-Travers, settles in Sainte-Croix. He is one of many artisans making pocket watches with musical movements of the traditional calibre.
1870: A German inventor creates a music box with discs, therefore allowing an easier and more frequent change of tunes. It is also the golden years of automata. Already known in Egypt, they will be improved to become real works of art.
1892: Gustave Brachhausen, who had been involved with the manufacturer of Polyphon disk music boxes in Germany, sails for America to establish the Regina Music Box Company in New Jersey. Regina, whose boxes are renowned among collectors for their tone, becomes a success and some 100,000 are sold before sales cease in 1921.
Early 20th century: The invention of the phonograph, the First World War and the economic crisis in the '20s bring down Sainte-Croix's main industry and make the luxury music box completely disappear.
Between the two world wars most of the Swiss companies converted to the manufacture of other products requiring precise mechanical parts. Some went back to making watches, others were eventually responsible for the famous Bolex movie cameras and the Hermes typewriters. Some simply sold out to Reuge.
Located near Lake Neuchâtel, Reuge is one of the last of the Swiss survivors making music boxes of all sizes and shapes, with or without automatons in a modern style with clear acrylic sides to see the mechanical operation. They have in a sense branched out widely from their original cylinder offerings since they also offered traditional looking music boxes with removable metal disks for around a 1,000 euros, with each disk costing in the neighborhood of 14 euros. The higher range boxes with removable cylinders and small assorted tables made of fine woods can cost up to 34,000 euros and about an equivalent number of US dollars. They also sell several models of clear acrylic paperweights with a music box movement inside, for a minimum of about 250 euros. They have, however, discontinued the smaller movements. Old Reuge music boxes are worth thousands of dollars but even so, cannot be compared to the fabulously large and highly complex music boxes which were produced in nineteenth century Switzerland by legendary makers such as Nicole Frères or Paillard. Since approximatively 2007 Reuge developed a strong business in the world of "bespoke" customized pieces for leaders in business and politics.
Nidec Sankyo in Japan started up in the aftermath of World War II, using the latest in automation. Modern production methods resulted in reasonable prices, producing company growth. Sankyo started with small movements, introduced 50-note movements by the late 1970s, and in 2006 is producing disc boxes playing discs as large as 16" (with two 80-note combs and reminiscent of the "Mira") and are also working on a dual-cylinder 100-note movement. Sankyo now offers a wide variety of music boxes in Japan, and supplies movements to many other manufacturers and distributors. Some of these sell them retail (even online) to hobbyists for as low as 3 euros each. Sankyo Seiki bills itself as the biggest manufacturer of music boxes in the world, and advertises that it controls 50% of the market. Recently, it has started selling licences for its musical-box tunes to cellular phone companies, for use as ring tones. The company is an industrial concern which also makes magnetic and hologram card readers, appliance components, industrial robots and miniature motors of all kinds.
The Porter Music Box company of Vermont produces steel disc music boxes in several formats. They offer clockwork, spring wound models as well as electric ones. They stand out by their continuing production of discs, with a selection of about a thousand tunes. The discs can also be played on many antique music boxes bearing the Polyphon and Regina brand names.
The small 18-note musical movements are now being made almost exclusively in countries with low labour costs such as China and Taiwan. Many of these productions are used in mobiles, children's musical toys, and jewelry boxes.
In March 2016, the band Wintergatan released a video of their homemade music box that took 14 months to make and played in any key using a 3,000-piece wooden construction fueled by 2,000 marbles. Band member Martin Molin used a hand crank to mobilize the marbles, which then created various noises on a vibraphone and other installed musical elements. 
In Switzerland, coin-operated music boxes, usually capable of playing several tunes, were installed in places such as train stations and amusement parks. Some of the models had a mechanism for automatically changing the metal disks. These were, in a sense, the precursors to jukebox. However, they soon disappeared from their intended venues and were displaced by the jukebox, which could produce a greater variety of sounds and full songs rather than warped fragments.
Because most of the coin-operated music boxes were built for rough treatment (such as slapping and kicking by a customer), many of these large models have survived into the 21st century, despite their relatively low production quantities. They are sought by collectors who have the space for their large or very large cabinets.