Custom Music Box Cylinder Puts A Spin On Romance

Music boxes are awesome little mechanical devices. These days, they even make some with slightly more modern tunes, like the Zelda and Star Wars themes.  But they don’t have everything, of course — certainly not that one song from that TV series that [RandomPrototypes]’ girlfriend absolutely adores.

But it’s 2021, and there are options for making your own music box. [RandomPrototypes] could have printed the whole thing, but those don’t sound as good with their plastic combs. Then there’s those paper punch ones, but you have to sit there and crank the thing continuously to hear the song. In the end, [RandomPrototypes] mixed methods and made a custom cylinder that’s playable with a standard music box mechanism.

[RandomPrototypes] started by taking the music box apart to measure the cylinder, and then created a software representation of a cylinder that’s designed to pluck the eighteen notes from low to high rather than play a song. Then he used a Python script to turn it in a 3D model. The slicing preview showed a lot of stops and starts and weak points, so [RandomPrototypes] generated the Gcode directly so that it would print in one continuous spiral and be much stronger.

In order to generate a cylinder with the song his girlfriend likes so much, [RandomPrototypes] printed this scale cylinder and used it to record the notes as a single mp3 and make note of the start times of each note. Finally, he built the new score based on the available notes built into the music box comb. If you want to do this yourself, the code is freely available. The hard part will be choosing a music box mechanism, because they tend to come with a single comb that’s designed to play a specific song. You’ll have to figure out which tune has most or all of the notes you need.

If you don’t mind doing the cranking to listen to the tune, then the paper-punched type of music box is going to be much easier. But why do all that punching yourself, when you could build a machine?

9 thoughts on “Custom Music Box Cylinder Puts A Spin On Romance

  1. Neat. I’d like to see him write a program that could take a MIDI file (yea I know old, but easier than an MP3) and spit out a file to print the song (or portion of it) as a music box cylinder.

    1. Thanks for the comment.

      Loading a MIDI and converting it would probably not be the most difficult part.

      Recognizing automatically the pitch of the teeth of the comb seems difficult (I tried the pitch recognition from Audacity but the result was not good).

      If the user provides me the pitch of each tooth of the comb, then I could make a generator from MIDI.

      Another problem is that some notes are missing on the comb, so I had to rearrange the song to sound as close as possible. Doing it automatically would not necessarily sound as good.

      The best would be to generate a new comb with a cnc to have the notes we need, but I don’t have a cnc yet.

      1. I looked up the make your own music box kit on Amazon, it says the kit has a range of 2 octaves, no sharps or flats, so pulling the comb from one of those could be an alternative until you get a cnc machine to make universal/custom combs.

  2. Printing a ‘scroll’ for a new song is neat. What I really would love to see is a ‘scroll’ where you can dynamically change the pins while using it. Maybe some nifty designed mechanics with an ESP32 and a wireless midi interface?

    1. Thanks for the comment.
      Dynamically changing the pins would be difficult in the size of the music box mechanism I used but probably possible at larger scale by recreating all the mechanism.
      You should watch this page : (it’s a commercial product and quite expensive I think, but they have a lot of pictures and videos of the internal mechanism)

  3. This is super! Some time ago I wanted to do this too. My approach was to write a Processing program that generates OpenSCAD code which would then generate the cylinder. I wanted to print the cylinder by a metal printing service, as this wouldn’t be too expensive for such a small object. What turned me off at the end is that I realized that all music boxes (those cheap hand cranked ones) are tuned a little bit different. I thought they’d be all standard and I could just swap the cylinders, but nope. They all seem to be individually tuned (they are grinded at the back side of the tuning fork/comb). So now I’m glad to see that someone has done it and I’m also glad that I learned at least OpenSCAD during the process :)

    1. Glad to hear you like it :D
      I thought they were standard too initially and got surprised that the notes changed when I changed the music box after breaking my first one. It makes sense because if it was standard, they would need more teeth to cover most songs. Instead, they optimized by including only the notes they use.
      It’s possible to add weight to it to change the pitch but I didn’t try. If I get a cnc, maybe I’ll try to write a script to generate the comb so there would be no limitation.

      I also did my first test with openSCAD, but then switched to generate the GCODE with python because I was more familiar with it.

        1. Oh, I see.
          Yes, in your case, it makes sense to get more durable cylinder. If it’s used constantly, the plastic of the cylinder would probably wear out fast.
          If size is not a problem, you could also try to make a larger music box, and make the cylinder in aluminium using lost-pla method.

          Nice project btw 👍

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.