Reading piano rolls without a player piano

A while back, [Jacob] played around with a player piano. After feeding a roll into the machine and trying to figure out how a fifty year old machine using hundred year old technology can replicate a skilled pianist, he decided to take a crack at decoding piano rolls for himself. He came up with a clever way of doing it over Christmas break, using a camera and a few bits of OpenCV.

The old-school mechanics of a player piano use a bellows and valve system to suck air through dozens of holes, making the action hit a string whenever a hole is present in the piano roll. To bring this mechanism into the modern age, [Jacob] pointed a video camera at the active part of the piano roll and used OpenCV to translate holes in a piece of paper to a MIDI file.

The synthesized version sounds just as good as the original paper scroll-based version, as seen in the video after the break. There are a few sync issues in the video and the resulting MIDI file isn’t in the right key, but that’s easily fixed by anyone willing to replicate this project.

Post navigation

20 thoughts on “Reading piano rolls without a player piano”

Thanks for a great hack. My grandparents used to have a pedal powered pianola, brought back great memories of pushing the pedals with my hands as a kid cause I was too short to reach the pedals when sitting on the seat.

Creating new rolls shouldn’t be too difficult. You’d just need a laser cutter – and of course a way to feed the paper through if you wanted a reasonable length of roll. It’s similar to the way I got an old Fisher price record player playing Stairway to Heaven (that was posted here a while back) only with more notes available.

Easier? not really if you have the special metal template plates that can be fixed each page of “fan fold”. Templates had holes in all possible positions so the composer simply pushed a sylus(or pencil) through the appropriate holes and the metal plate would ensure any holes would be located properly. To copy a piece would have used similar methods to copying instructions for a Jacquard loom.

I really do want to create a new roll–maybe make this old fart play some Zelda music or something. I don’t think I’ll be getting my hands on a vinyl cutter any time soon, or even a laser cutter, but I think I might be able to just punch a hole with a stylus and that’d be good enough…I’ll have to think on this a bit more…

It ain’t always as simple as “hole maps to played note”. there are a number of different formats the information can be encoded in, eg English and German (fairground) machines can have up to 5 “manuals”(a manual is the name for a IO device of a music keyboard- 2 channels per manual ie left and right hands) a means was found to compress the information so less columns of holes would be required. kind of like defining a macro for a chord, and play the macro on channel x. also commands to transpose chords up and down a scale, add sustain etc – the maths of such transformations ain’t that difficult, and it’s not that difficult to implement it physically

That’s very interesting. Is there a place I can read into these more complex machines? I really know very little about this one…just made a quick observation and ran with it. Sounds like these machines you speak of are works of art.

unfortunately I know very little about the internals of those machines knowing more about how the music pieces could be the physically transcribed for such machines, Got this information from my partner, who had an very elderly relative who used to run a collery brass band, and who had a (very) expensive, multichannel piano roll driven hapiscord that he used to practice writing his own compositions on. I’m not good at music theory- but my partner is, and she distictly recalls him editing existing pieces by adding a single hole that would tweak the position of a chord. – only way that could be done is if the infomation about chord selection, and position of chord on the scale were encoded seperately on the piano roll. I’ve got a few ideas how specialised multiposition valves might have been able to do that but I’ll have to think about it and as look up to see if anyone has more certain info

Years ago I bought an old house that included many of its furnishings. There was an ugly old upright player piano in the living room. It was still plugged into a wall outlet. There was a role still attached, so I flicked a few switches and the motor in the piano began rumbling away loudly. I remember a very musty, oily smell coming from the piano. Kind of like a hot electric motor smell. I bopped the piano mechanism with my fist several times and the thing began playing a very slow rendition (and horrible sounding) of “I Love You Truly.” I shut the thing off and said to my wife, “This thing has got to go.” The piano was ugly visually and sounded ugly. I couldn’t give it away, and a disposal fee was to have it removed from my house to was too expensive. A buddy of mine and myself removed the half ton harbinger from my home out to a gravel lot in the back of my home. The easiest way to dispose of the piano was to set in on fire. That I did (safely) and it burned very quickly. I came to realize what fire hazards old pianos are! Boy do they burn easily!