Parametric Music Box

by wizard23, published

Parametric Music Box by wizard23 Mar 8, 2013

Featured Thing!

41 Share
Download All Files

Thing Apps Enabled

Open in Customizer Order This Printed View All Apps



Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

238444Views 24181Downloads Found in Mechanical Toys


This is a 100% printed customizable music box!
Only 3D printed parts are used in the design and it can be assembled and disassembled via printed snapping mechanisms.
The project originated when a friend of mine said that he'd only be interested in 3D printing once he can print a music box ;)
http://youtu.be/K_c3p24RRtQ (made by banthafodder7400)
I'll try to keep the .scad file on this page updated but to help me to manage the design and to make it easier for others to contribute: https://github.com/wizard23/ParametrizedMusicBox

Here is a Spreadsheet to help you to get the parameters right: https://goo.gl/sKWWDk (created by: Ben Horner)


2016-09-20 Spreadsheet to help you to get the parameters right: https://goo.gl/sKWWDk (created by: Ben Horner)

2013-11-24 Updated link to generator page (old webserver is offline)
2013-03-10 (V3) Added optional Name of Song on top/bottom of MusicCylinder; fixed build plate positioning of pulley that messed up smaller customized versions; cleanup and clarification of descriptions; implemented work around for customizer hickup when strings start with a '.'
2013-03-08 (V2) removed "work in progress status", fully test printed
It's very important to put the music box on a sounding box to get good sound quality. I found that large cardboard boxes and some tables make good sounding boxes. A guitar or a piano should work even better!
A complete music box consists of 6 parts:
Case: the large thin walled part that holds the vibrating teeth and holds everything together
Music Cylinder: the large cylinder with the pins (that encode the music) sticking out
Transmission gear: sits between the crank gear and the music cylinder
Crank gear: drives everything, connects to crank (insert it through the round hole in the case)
Crank: for manually driving the box, connects to crank gear and crank pulley
Pulley: for holding the crank while turning it
With the default parameters you get a complete building plate that can play one full octave range (13 half notes from C to C) in a medium footprint that should fit in most printers. You can enable each part individually to make smaller print plates.
I customized a "Frère Jacques" music cylinder that is compatible with the default parameters: http://www.thingiverse.com/thing:59242
How to adapt the snapping mechanisms
I printed this in PLA. So if you print it in ABS (or if your printer is differently calibrated than mine) you might have to adapt the snap fit:
If one of the gears are too hard to snap in you have to lower "crankAxisHolderH", "midAxisHolderH" or "musicAxisHolderH" depending on which gear causes the problem.
If one of the gears seem to sit too loose once they are snapped in you have to lower "snapAxisSlack"
Ways to get notes that you can then use in Customizer

1. Manual (read this anyway to understand how the music is encoded)
The "pins" variable contains characters that encode the pins on the music cylinder. These pins pluck long teeth that then vibrate and emit a certain note. The number of available different notes/vibrating teeth is given in "pinNrX". The number of time slots/length of the song is given by "pinNrY". For each time slot the "pins" string contains "pinNrX" many characters that determine if a pin should be generated for this specific note at this specific time slot. If the character is an 'X' there will be a pin (and the note will be played) any other character means: no pin. The actual frequency of the vibrating teeth are described in "teethNotes".
Be careful with long songs: If the pins are spaced too close together, i.e. if you try to fit a long song on a cylinder with small radius (derived from the number of teeth of the gear on the bottom of the music cylinder) then the closely spaced pins collide with the teeth and you hear a snare sound. While it's an interesting sound effect you generally want to avoid it by adapting the size of the music cylinder to the length of the song ("pinNrY"). For the default parameters I recommend at least 5mm distance from pin to pin. Tune this distance by adapting "musicCylinderTeeth".
A tip if you want to make a new Music Cylinder for an already printed music box: Don't change any other parameter except the "pins" and "pinNrY"! Well some other parameters can be changed but it's tricky...
2. JavaScript to generate the Pins-String
Stefan (the mentioned friend of mine) wrote this nice little JavaScript application for converting Tabs to the format described above. Here is an example of what I mean with tabs:
C4 E4 G4

try it out (sound output quality might vary from browser to browser) at:
For tuning the instrument you simply cut away material from the side of the vibrating tooth. Don't cut away material from the tip since that would change the way it interaction with the pin. If you want it to get a higher frequency remove material from the side of the tip (therefore making it lighter). If you want it lower the frequency remove material from the bottom (making it more flexible).
The gears I use are adapted versions of the ones made by emmett for his Automatic Transmission Gear Model so I added this as an ancestor. I really love this sharing of ideas on thingiverse :)
For calculating the lengths of the vibrating teeth I used the formulas from this Wikipedia article: http://de.wikipedia.org/wiki/Durchschlagende_Zunge#Berechnung_der_Tonh.C3.B6he (sorry it's in German). I don't think I chose the right material properties for PLA. But it sounds right to me at least relatively. To get exactly the right frequencies one would have to measure the real frequencies by somehow running a fourier transformation over an recording of the picked teeth. Then one could adapt the density and modulus parameter up or down and try again. A simple test cylinder would be one that just plays some notes sequentially so that we can make a recording for comparing the modeled to the measured frequencies. So I included such a test music cylinder (defined in the "Pins" and the "TeethNotes" default parameters) which just plays each note available and some accords.

More from Mechanical Toys

view more

All Apps

Customizer is the easiest way to take great 3D printable designs and make them your own. Make your OpenSCAD designs infinitely more valuable by empowering the community to customize them.

App Info Launch App
Customizer Thing App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

Treatstock is an online platform that offers decentralized manufacturing services such as 3D printing and CNC machining for clients all over the world. We offer free and instant access to comparati...

App Info Launch App

3D print your favourite design with NinjaPrototype, a professional 3D manufacture with consistent quality and speed.

App Info Launch App

Wow this thing was great. Anyone want to revive it? I was going to make my own as I have a metal comb from a music box. Guess I'll just get the base file and pull my own pins out of the cylinder in Blender to get my tune.

Is this thing completely dead? All links to the music generator are no longer working and the author doesn't seem to be responding to people's comments... :(

I'm very interested in designing a music box to play songs from star wars. I love this idea and the customizable aspect. The instructions are confusing to me and am very novice when it comes to music. Any help/suggestions?

it does work print at normal quality and 20% infill it does even print every thing

Is there a page to download just certain parts? the smallest gear shaft broke (the one that connects to the handle).

open the thing in the customizer thingiverse app and you can edit which parts you want

That doesn't work anymore. Gives an error, cannot find the original file. Disappointing because of all the remixes and this file, I finally managed to get everything to print but the cylinder and crank handle. I don't want to keep wasting filament because of failed prints just to get those 2 parts.

Is there a page to download just certain parts? the smallest gear shaft broke (the one that connects to the handle).

Comments deleted.

Is there a current working music generator?

What are the print parameters? Infill, supports, etc? Thanks!

I think there's a bit that could be improved. This youtube video https://www.youtube.com/watch?v=COty6_oDEkk shows how one of these work, and the comb part is actually weighted! I think there's a bit more to be improved, and I'd like to see files of the individual parts (I CAN'T GET RID OF THE MUSIC BARREL THING UGH). I'd like to see a standalone version of the note generator thing, as the links are all down, and I don't know how to read music that way or at all. I'd like to see MIDI to note standalone program so I can just copy paste it into customizer (when it works). An improved version with even just the weights would probably sound much better! I'm waiting until I can make my own songs on these or fix it myself somehow...

How would you make a 3D model customizable?

I've gotten to the editor with the wayback machine, but I cant get it to work. How do I use it? https://web.archive.org/web/20150524072734/http://magicshifter.net/oldold/musicbox/musicbox.html

i dont think the web genorator is working.

It still doesn't sound well, I already tried with 10% and 30% infill for the base.
Am I missing anything?
I'm using layer height .3

Looks like all the websites with the music generators are down :(
Any other ways to generate your own tones?

How long can the song be? i am not a musician myself :p anyone can learn me how to made some disney song with this?

Im not sure, but it would depend on the size of the cylinder. But you might be able to fit more of those square things on one, but you would have to wind it slower.

Just a guess.

I just made this music box in green ABS. Printed perfect the first time and plays the little French tune in a recognizable manner. Thank you so much for sharing this! :-)

the site is still down. and has ben for weeks. fix this

Hi, Philipp! I included your awesome customizable music box design in a challenge for the littleBits community to power music boxes with littleBits electronics. Here's the link to the discussion: http://discuss.littlebits.cc/t/make-music-boxes-powered-by-littlebits/22077

Come on by and say 'HI"! :)

Considering it'll probably take 3hrs to print and cost about $10, I would like to know the optimal print settings ahead of time. For fusion deposition printers, what settings should I use? Standard temp and extrusion rate? Can I scale it down without ruining it? Layer height? Infill density? Number of outer shells? Have a Replicator 2 which uses PLA.

Also, if anyone does a full loop of Song of Storms, let me know! :D

The idea is good, my schools printing club has one, but it is highly breakable and if we even manage to get any sounds, it is undeceipherable clacking...

I am trying to open this in the customizer, but I am not able. I keep getting an error message but to click elsewhere if I am using Safari (I am not). I have a song that I'd like converted, if anyone has the ability to help me out! Can someone please convert the intro of Tears for fears' Head Over Heels? Thank you to anyone in advance that can help figure out what is going on, or that can convert this for me.

I had the help of a music teacher, who fixed the song to loop in a nice way, deciphered it, put it into note form instead of sheet music, and even try the spacing for what is required in the generator...... neither of us can get to the page that fixes things for the generator. can someone please help me further?

G 2F#2E 2D 2E 2C 2G 2F#2E 2D 2E 2C 2
C 1G 1C 1G 1
G 2F#2E 2D 2E 2C 2G 2F#2E 2D 2E 2C 2
D 1A 1D 1A 1
A 1E 2D 2C#2A 1G 2A 2B 2G 2
A 0B 0C#1E 1C#1A 0C 1G 1E 1F#1G 1A 1
A 1E 2D 2D 2C#2E 2A 1
A 0B 0C#1E 1C#1A 0C 1E 1G 1F#1E 1E 1D 1C 1
D 2D 2D 2B 1D 2B 1F#2F#2E 2B 1E 2E 2B 1
G 0B 0D 1G 1F#1E 1D 1E 1F#1G 1E 1D 1B 0D 1
D 2B 1D 2D 2B 1F#2F#2G 2A 2B 2F#2
G 0B 0D 1G 1B 0D 1F#1E 1B 1A 1G 1F#1E 1D 1

pinNrX = 19;
pinNrY = 12;
teethNotes="G 0A 0B 0C 1C#1D 1E 1F#1G 1A 1B 1C 2C#2D 2E 2F#2G 2A 2B 2";

I don't know if this is the correct information.

I like the idea. Has anyone of you ever seen something similar to generate vintage 3D printed vinyl records that can be played with a simple 3D printed turntable? I just want to play a short message or kind of morse code... Any information is appreciated (pm).

Just printed two of these, and I'm experienceing some problems that may be with my printer of filament choice. When I attempt to place the smallest gear, it is very hard and then after pressing enough force, the standoff for the crank breaks off. Is it my filament, my printer, or my inexperience? Any help appreciated...

great Christmas present!

Amazing idea! do the pins break after repeated use?

Has anyone yet come up with a design to make replacement customized drums for metal music boxes?

Should I use raft, or will that break the pins when I try to take it off?

Absolutely amazing design. Made "Happy Birthday" for my friend, he loved it :)

I am however having trouble previewing tabs under the "enter your melody here" section with the new notes editor.

It loads the soundfont but won't play like it used to.

Any ideas?

could you please publish a file for the drum for that song?

could you please publish a file for the drum for that song?

I have the same question as travisyeow. how exactly does it work? I am choosing an mp3 file as source...
thanks for your help

Edit: one needs to upload a .mid file and make sure one does not have a loooong song. then just copy the 4 pieces of info in the quotes to their respective places

I'm not entirely sure how this works. If I click "choose file" and add a mp4 file will it load the song?
Note: Trying to recreate the Suits song Greenback Boogie

This thing looks awesome! I want to print a custom one but am confused. I have all of the notes in the generator and the generator seems to work, but how do you change the rhythm of the song and how does it know the order of all the notes if you have 2 of the same note in your song. Just looking at the output of the generator it doesn't look like there is any information that tells openscad to space pins farther apart for whole notes etc. nor is there any indication that the melody I entered is being represented just a few of the notes contained therein. Is there a tutorial or a few examples that I can look at

its in the string: one character for each note (present X, not present .)

I'd love to see you go on to put up a website of the 'enter a youtube url to download the mp3' kind, but instead it gives you an STL file that you can print, giving you the music on a cylinder. Old school piracy.

It's on my todo list. ATM i'm concentrating on my new open source hardware start up: http://magicshifter.nethttp://magicshifter.net ;)

I would love to make the xylophone notes to Gotye "Somebody I Used to Know" but am musically inclined :(


c c g g a bflat c a g

f f e e d d c

c c g g a bflat c a g

d d e d

Really great design! :) I would like to print one myself with a custom tune, but it seems like the link to your website is down :(

Can you make it play a custom configured tune?

Hi!! It's an amazing idea and i really want to print one, with a special melody as a present for a good friend. The problem is that the links for customizing the melody are not working!! please help me! can you repare the links? or can anybody tell me any other way to find the parameters for a particular song??
Thanks a lot!!!

My old server died :( But now I updated the first link and you can use it again :)

can you put up a download for each individual part? i really want to print this, but my machine has problems with larger prints

I don't understand how to make the songs with this. Can someone please link me to somewhere I can learn enough to make some zelda songs please?

did the music generator sites get shut down by the song police or what?

Every time I print this, the main chassis messes up...it works on printing the gears, then comes back at a higher Z-axis to print the rest of the chassis, which is too far away to adhere to where it last drew. this appears to be a problem in the gear area of the chassis.

So the fit works just fine if you print in ABS because it all shrinks together, but the sound is crap and the pins don't last a day. Gonna try a PLA case in a bit. I suspect PLAs rigidity will work in it's favor with this one. Expect a writeup when I have more.

PLA sounds much better and doesn't seem to crack as bad, tho that might be because I was turning the crank the wrong way at first over stressing the ABS tines.

WOW bad arse!! One of the video above have it playing happy birthday...would you have a link for a printable version of that please sir??

Birthday Music Cylinder

wow great! thanks again!! Kerry

Can anyone do a 'Game of Thrones" theme sone in the customizer? I would,but I have several disadvantages:

1) don't have the sheet music.

2) couldn't read it if I did.

3) tin ear

It doens't have to be perfect, see #3, above.

I'm currently printing Winterfell (http://www.thingiverse.com/thing:39680)http://www.thingiverse.com/thi... and A little music to go with it would be perfect...

by damm301

Its Done! http://www.thingiverse.com/thing:70518http://www.thingiverse.com/thi...

if you can please post a video of how it turned out still waiting for my printer to come in.

Game of Thrones Opening Theme Parametric Music Box
by Ansarum

Sweet! WinterFell isn't even done printing yet! I'll be printing this tomorrow. Thanks Ansarum!

actually yea! I will start the hunt and get one made... cus i want one too now lol

Sorry for the delay, but it's not working so far. I printed it in PLA, and the 3 of the 6 tines broke off on the first turn. I'm going to try again in ABS (a bit more flexible). Also, it seems pretty high pitched. (the three remaining tines sound like 3 clicks...) can you drop it down to a lower key?

Sorry for the delay, but it's not working so far. I printed it in PLA, and the 3 of the 6 tines broke off on the first turn. I'm going to try again in ABS (a bit more flexible). Also, it seems pretty high pitched. (the three remaining tines sound like 3 clicks...) can you drop it down to a lower key?

Sorry for the delay, but it's not working so far. I printed it in PLA, and the 3 of the 6 tines broke off on the first turn. I'm going to try again in ABS (a bit more flexible). Also, it seems pretty high pitched. (the three remaining tines sound like 3 clicks...) can you drop it down to a lower key?

Sorry for the delay, but it's not working so far. I printed it in PLA, and the 3 of the 6 tines broke off on the first turn. I'm going to try again in ABS (a bit more flexible). Also, it seems pretty high pitched. (the three remaining tines sound like 3 clicks...) can you drop it down to a lower key?

We have planed to print it as soon as possible, props

Nice design! I've really wanted to print it out and I've tried twice, but for some reason it won't stop curling =\ anyway to fix?

Are you printing PLA or ABS. I use PLA and it does not curl at all. With ABS you'll probably neet a heated build plate becaue it's quite big but I have not tried it out in ABS yet.

I'm using PLA on a makerbot replicator 2, but it's still been curling, I'm not sure why, I've tried printing it again, and it did the same thing. I also made sure the build plate was leveled if that helped any.

Also, another thing, when using the musicbox link, my output for pins is always XXXXXXXXXXXXXX, do you know why?

I just tested the musicbox link and for me it works as expected. Are you using multiple lines? If you write all the notes in only one line it will generate a "sequence" with only one timeslot in which all notes are played. That is the only way how it could only generate XXXXX assuming it has no bugs ;)

Since it is written in javascript there might be some issue with the browser you are using. It has been tested on current firefox and chrome versions. but because it's only string manipulation I don't really think it's a browser issue.

About the curling I don't have any experience with the replicator 2 but my general debug technique would be: does it curl with smaller objects too? can you print the comb for example that should come with the SD card (I just saw the comb in the manual) for example?

oh thanks so much!! I'm making a music box that is playing für elise. The curling only happens on circular objects and narrow rectangles. I will try to lower the temperature from 230C to 225C and slow the extruding speed.

ha ha this is top shelf!

Feature request: for the web app that helps you generate the notes, add support for having multiple pins of the same note when there are multiple notes right after eachother and alternate the teeth between them. That would help prevent teeth that are too close together! For the mary had a little lamb box I made, I need to significantly increase the size of the cylinder to get the teeth spread out properly. (or manually go back and figure out the multiple pin notes idea)

very good idea! that should allow for much longer songs, and it's rather easy to implement! It's on my list now :)

I just saw this thing live, and it sounds really good when you put a resonator chamber like a shoebox underneath.
awesome ^-^

I printed this out and it is even better than I had anticipated.
One suggestion for future development would be a bottom flat piece to set into. The walls by necessity are thin but they flex a lot when you turn the crank. A bottom piece could both give it some rigidity and make a sound board.

I also had my one corner (across from the smallest "key") keep separating from the build platform (2/2 prints on makerbot replicator 2), so that would probably help there as well.

Suggestion...Hollow the cylinder out, that is so much plastic even at 10% infill. And it would take so much less time to print out and do the same freaking thing. "Optimize that plastic usage fool!" -Mr.T voice

I should have noted that I use very sparse infill (10%) on the whole object on of course especially when you only print a cylinder. But this is a very good suggestion, I'll add it tonight :)

I just added support for writing a name on the music cylinder :)

I uploaded a video of it actually playing the first measures of the song "Frère Jacques": http://www.youtube.com/watch?v=LUlovenI9xQhttp://www.youtube.com/watch?v...
the Music Cylider was made with Customizer and can be found here: http://www.thingiverse.com/thing:59242http://www.thingiverse.com/thi...

"Frère Jacques" Music Cylinder for Parametrized Music Box

Here is a video of it playing the song "Frère Jacques"

The music cylider I used in the video is here: http://www.thingiverse.com/thing:59242http://www.thingiverse.com/thi...

"Frère Jacques" Music Cylinder for Parametrized Music Box

awesome thing!
only thing i would change or add is a resonant chamber around the pins and maybe a amp Horn like the ones for iphones.

for resonance I now put them on a big cardboard box. The seem to resonate much better than any table or other surface I found in my home. I have to confess I don't know to much about music so I don't really know how to construct a resonant chamber. Using an external chamber seems like the best way to me though because I could never print something as big as a cardboard box.

Hi, we just fixed the bug that was causing this script to fail to show a preview! Problem is, now that the preview is working, it's showing the music box really small. This is due to the way the preview image is generated and unfortunately we don't have a quick fix. It is caused by hidden geometry (often part of a difference operation) that is a shape that is really large. Although the shape can't be seen, it contributes to the zoom factor. So if you could adjust your design now that you can see it (!) to reduce that unseen geometry, that would rock. Also, you might want to use the multi stl output features of Customizer, see: http://customizer.makerbot.com/docs#multihttp://customizer.makerbot.com...

Also, this is a really awesome script! I can't wait to print one myself.

Wow! kthnx for this extremely quick customizer update! I totally understand what you say about the tiny build plate and I HAVE such huge difference blocks in there. so I will just clean up the code to make the perspective better ;)

Awesome! Made my own little version now, now I just have to print it.
Note: in the version for printing, the crank touched another part, I had to move it a bit

Guess you are the first one to try it out apart from me yet :)

Looks like you customized yours while I was changing the case design (and therefore had to move parts on the plate). Does your version's case have a gap where the music cylinder is? How easy or hard is it to exchange the cylinder or assemble the gear? Or did you change values like the wall or number of teeth and it overlapped?

Very curious to find out how it works for others :)

First of all, this is awesome. But I tries to customize it, and it says "error in line 824" EVERY TIME I TRY. How can i solve this? It doesn't let me generate an STL file!

I would be interested: Does the generating of an STL file really not work for you or did you not ty this because of the error message? For me STL generation works...I'm working on getting the preview fixed...

Never mind :P I understood my error : Somewhy, I have to put and X in the FIRST note of the melody on the first dot... I have on idea why but that gives no errors and also i managed to get preview :D
Anyway, Thnx for being awesome and making this !

I can reproduce what you say. For the customizer preview the first character must be an X. But if you do it in OpenSCAD it does not matter at all what the first character is. I think this is another instance of a bug in customizer that got (partially) fixed yesterday.
="thingiverse-ffeed84c7cb1ae7bf4ec4bd78275bb98:disqus" href="http://disqus.com/thingiverse-ffeed84c7cb1ae7bf4ec4bd78275bb98/tbuser : I think this is another instance of the bug you fixed yesterday. Can you reproduce this?

As a work around for now until we can fix it, you can use a character other than . as the place holder. I've been using underscores instead.

tnx! Now I understand! By chance I took the one "invalid" character ;) I updated the default parameters and I implemented the workaround in the generator, it now uses 'o' instead of '.' http://www.wizards23.net/projects/musicbox/musicbox.htmlhttp://www.wizards23.net/proje...

Yeah looks like a bug in customizer, it's thinking its a number instead of a string.

I know! that's what I wrote in the text above: customizer gives you this error message and no preview :( BUT it will still generate the STL correctly: I just "customized" the music box (with the default parameters) and it made the STL. Here it is: http://www.thingiverse.com/thing:59104http://www.thingiverse.com/thi...

Printed Music Box: Complete Build Plate of the Default Parameters

Whis is just mindblowing!

Amazing stuff but looks like you may have an issue somewhere in the SCAD as customizer reports an error on line 367.