Loading

Parametric Music Box

by wizard23, published

Parametric Music Box by wizard23 Mar 8, 2013

Challenge Winner

Description

CUSTOMIZER CHALLENGE CONTEST WINNER - Artistic Category
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 ;)
Videos
youtu.be/LUlovenI9xQ
youtu.be/K_c3p24RRtQ (made by banthafodder7400)
youtu.be/exNeQDz7f3g
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: github.com/wizard23/ParametrizedMusicBox

Recent Comments

view all
I'm not entirely sure how this works. If I click "choose file" and add a mp4 file will it load the song?
I had a webpage redesign. It's now here: magicshifter.net/oldold/musicbox/musicbox.html

More from Mechanical Toys

view more

Liked By

view all

License

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

Instructions

Updates
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: 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
C#4
C4 E4 G4

try it out (sound output quality might vary from browser to browser) at:
magicshifter.net/oldold/musicbox/musicbox.html
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).
Credits
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: 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.
I'm not entirely sure how this works. If I click "choose file" and add a mp4 file will it load the song?
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: magicshifter.net ;)
I would love to make the xylophone notes to Gotye "Somebody I Used to Know" but am musically inclined :(
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 :(
It was down I uploaded it to another website: magicshifter.net/musicbox/musicbox.html
Great, thanks i really appreciate it! :)
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?
I had a webpage redesign. It's now here: magicshifter.net/oldold/musicbox/musicbox.html
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.
cymon - in reply to cymon
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.
no its just bad!
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??
thingiverse.com/thing:64596
It's linked in the youtube video btw ;)
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) and A little music to go with it would be perfect...
Its Done! thingiverse.com/thing:70518

if you can please post a video of how it turned out still waiting for my printer to come in.
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 :)
Congrats on the WIN!
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": youtube.com/watch?v=LUlovenI9xQ
the Music Cylider was made with Customizer and can be found here: thingiverse.com/thing:59242
Here is a video of it playing the song "Frère Jacques"
http://www.youtube.com/watch?v=LUlovenI9xQ

The music cylider I used in the video is here: thingiverse.com/thing:59242
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: customizer.makerbot.com/docs#multi

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.
http://disqus.com/thingiverse-ffeed84c7cb1ae7bf4ec4bd78275bb98/ : 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 '.' wizards23.net/projects/musicbox/musicbox.html
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: thingiverse.com/thing:59104
Whis is just mindblowing!
could you please upload a video?
moar with the newer, more stable frame:
http://youtu.be/exNeQDz7f3g
http://youtu.be/tDYvBWCSls8
youtube.com/watch?v=1hf05dcl9Fc

this was the last iteration. currently working on the next with a much more stable case...
working on it :)
Amazing stuff but looks like you may have an issue somewhere in the SCAD as customizer reports an error on line 367.
Top