The automatic reproduction of music can be traced back as far as the 14th century, when Flanders introduced a mechanical bell-ringer controlled by a rotating cylinder. Similar designs appeared in barrel organs (15th century), musical clocks (1598), barrel pianos (1805), and musical boxes (1815). All of these machines could play stored music, but they could not play arbitrary sounds, could not record a live performance, and were limited by the physical size of the medium. The first device that could record sound mechanically (but could not play it back) was the phonautograph, developed in 1857 by Edouard-Leon Scott.
The player piano, first demonstrated in 1876, used a punched paper scroll that could store an arbitrarily long piece of music. This piano roll moved over a device known as the 'tracker bar', which first had 58 holes, was expanded to 65 and then was upgraded to 88 holes (generally, one for each piano key). When a perforation passed over the hole, the note sounded. Piano rolls were the first stored music medium that could be mass-produced, although the hardware to play them was much too expensive for personal use. Technology to record a live performance onto a piano roll was not developed until 1904. Piano rolls have been in continuous mass production since around 1898.[1] They began to decline in the 1920's although one type is still being made today. The fairground organ, developed in 1892, used a similar system of accordion-folded punched cardboard books.