I always wanted to make something like a Jack in the Box, where you crank the handle to play music and then the box would pop open.
This version of the box uses a drum music player by Kikkerland: https://www.amazon.com/gp/product/B004TZ2UPA
There are multiple melodies you can choose from. I picked the “Pink Panther” for my prototype.
The device requires 30 turns of the crank to play the music, after which the box should open. There are different mechanisms that can be used to trigger the lock after 30 turns, but most of them either require a worm gear, fine-tooth gears (hard to do with laser-cut plywood), or have significant increase in resistance right before unlocking, which ruins the effect.
I decided to use a fishing cord that wraps around a shaft. This provides constant resistance for the crank for smooth operation. The latch itself is a lever with 2:1 ratio, locked in place by a rubber band. The cord is threaded twice, which increases the necessary rotations of the shaft by a another factor of 2. Still, even after that the shaft can only rotate 3 times in total before the latch unlocks.

The next problem was how to create a mechanism that reduces the 30 turns of the crank to 3 turns of the shaft. A simple pair 10:1 of gears would be too bulky and wouldn’t fit inside the box. The contraption I ended up using converts one rotation of the small gear into 2 teeth worth of rotation for the large gear:

A second set of gears prevents the large gear from turning back on its own:

The two layers of each gear are secured to each other with glue and toothpicks.

Here’s the final box in action
Locking the box
Slide the large gear towards the front of the box and hook it to the small gear. Warning: there are two ways the two gears can engage, and one of them locks the gears together in a way that they can’t turn. Make sure the small gear rotates fine before locking the box.
Attach a binder clip on the shaft, which will prevent the shaft from sliding back and forth.

Finally, lock the lid. Insert the long pin (seen in the first picture above) and prop the latch on top of the pin in unlocked position. Close the lid and remove the pin to engage the lock.
Resetting the box
Once the box pops open, you will want to put it back in an armed state. Remove the binder clip from the main shaft, which will allow the large gear to move forward and disengage from the small gear. Turn the large gear to unwind the cord. Then follow the locking instructions.
Make it
This is the SVG file with the blueprints: music_box_v1.svg
The design assumes 3.3mm plywood and 4mm dowels. If your supplies have different dimensions, you will have to adjust some of the measurements.
The holes for the music player fit M3 machine screws. The SVG has concentric circles around them with different colors. They are intended to be etched with varying laser power, to create a conical hole for the screw head.
The SVG file also contains the shape for the latch hook. You can cut it from plywood for the initial prototype, but I recommend you use a more sturdy material like plastic for the final part.
Additional materials: You will need some rubber bands, fishing cord, toothpicks and a binder clip. It is recommended to insert thin nylon washers between the moving parts to reduce friction.
