This Arduino Music Box Uses Handmade Punch Cards to Encode Each Tune

Inspired by player pianos, this music box uses a hand-cranked punch card to play back the tunes of your choosing.

Gareth Halfacree
1 year ago β€’ Retro Tech / Music

Maker Christian Toparceanu, of the Compact DIY YouTube channel, has put together a music box with a difference: rather than a spiked rotating drum triggering metal keys, it's an entirely digital system driven by an Arduino β€” but reading music from punch cards, like a vintage player piano.

"The working principle is simple," Toparceanu writes of the musical project. "A piece of opaque paper passes over eight sensors corresponding to the eight basic musical notes. When a paper cut-out passes in front of one of the sensors, it changes its analog output value and the Arduino notices this by generating a tone. The clipping can be longer or shorter, implicitly the length of the tone generated."

This music box mixes mechanical playback with digital reproduction, using an Arduino-compatible microcontroller. (πŸ“Ή: Christian Toparceanu)

The low-cost music box is built around an Arduino-compatible microcontroller linked to eight infrared sensors β€” one for each of the eight bits in the punch cards on which music is encoded. As the punch card, built by hand to a bigger scale than the traditional cards used in the early days of computing, passes over the sensor it reflects the emitted infrared light back β€” unless there's a cut-out gap in the paper, in which case a particular note is triggered.

"The mechanical part is easy to do," Toparceanu says. "The construction of the sensor requires special attention, I opted for removing the components from the plastic support and mounting them on a [prototyping] board. The paper guides are built with what I found around the house, plastic tubes and pieces of hose. For cutting the notes on paper, I was inspired by piano tutorials for beginners on the Internet. You can choose any song you want."

"After cutting the paper with the desired melody, it is inserted between the two plastic guides. We turn on the device and turn the crank. If the cutouts are done correctly, the machine should play the chosen melody at a speed dictated by the speed of rotation of the crank."

A full build guide is available on Toparceanu's Instructables page, with source code available on Box under an unspecified open source license.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles