Samsung Alarm Music Box

I made Samsung's infamous alarm sound into a 3d-printed music box.

3D Printing

Digital Meets Analog

Samsung’s “Homecoming” is one of the default alarm sounds on Samsung phones. Even though I’ve switched to iPhone for the past few years, hearing it still triggers an immediate stress response.

Turns out I’m not alone:

Homecoming Comments

The alarm sound was clearly styled to sound like a music box, but I couldn’t find any historical song it was based on, nor anyone who had made it into an actual music box.

Taking a digital song styled after analog technology and making it into the real thing felt right. The extra ‘joy’ I could bring to those who have dealt with this sound every morning was a bonus.

1. The Constraint

To start the project, I bought some cheap wind-up drum-style music boxes from Amazon that I could modify. What I assumed would be a simple process of measuring the drum and printing a new one turned out to be more complicated.

Music Box

With 18 total teeth on the comb that plays the notes, I assumed that would give me enough range to fit the tune. After transcribing notes from one of the music boxes I had purchased, I found that not only were the notes not chromatic, some of them were duplicates.

It turns out that each music box comb is custom-machined for its specific song. Material underneath each tooth is machined away so it oscillates at the right frequency when struck. The comb only contains the exact notes needed for that particular melody and when a note needs to be played in rapid succession, two teeth are tuned to the same pitch. (For a deeper dive, Engineerguy has a fantastic video on how a wind up music box works).

I decided I wasn’t going to machine my own comb, so the challenge became: could I find an existing music box that already had all the notes I needed?

2. Analysis & Transcription

Luckily it wasn’t hard to find a MIDI file of the Homecoming alarm, which gave me a list of the notes I needed to play.

MIDI Editor view

Now I needed to figure out which notes were available on different music box combs.

Source Audio

Amazon Listing

Amazon had dozens of different music boxes, each with a different comb, but I didn’t want to buy them all just to find one that worked. Fortunately, each product listing had a video demo and I extracted the audio from these videos to analyze them.

Note Detection

I used a program called Melodyne to automatically transcribe the audio files. I had initially tried onset detection and spectrogram analysis, but Melodyne consistently gave me the cleanest starting point.

Melodyne pitch detection

MIDI Cleanup

Most of the music boxes had notes between C4 and C7. After filtering Melodyne’s output, I exported each song to MIDI and used MIDI Editor to make final adjustments. The rhythm didn’t need to be perfect, I just needed the right set of notes.

The Problem

Now that I had Homecoming’s notes and could parse notes from each music box, I started looking for overlap. I was hopeful that if two songs were in similar keys, there’d be a good chance the notes would match.

After comparing a dozen music boxes, I hit a wall: not a single one had all the notes I needed. Even being off by a single semitone would make it sound wrong.

The Solution

After spending some time double checking notes I realized I was thinking about this backwards. I couldn’t change the notes on the comb, but I could change the Homecoming midi. By transposing the melody up or down by semitone intervals, I could shift all the notes while keeping the melody more or less intact.

Mapping notes to comb teeth

I vibecoded a script to test each music box against Homecoming at all 12 possible transpositions. For each semitone shift, it would check if every note in the transposed melody existed on that comb:

# Try all 12 possible transpositions
for semitones in range(-12, 13):
    shifted_midi_notes = {midi_note_to_name(n + semitones) for n in midi_notes}
    overlap = shifted_midi_notes & available_comb_notes
    overlap_count = len(overlap)
    missing = shifted_midi_notes - available_comb_notes
    
    print(f"Shift {semitones:+} semitones: {overlap_count}/{len(shifted_midi_notes)} notes")
    
    if overlap_count > best_overlap:
        best_overlap = overlap_count
        best_shift = semitones

After running through all the combinations, I found it: the “Beauty and the Beast” music box, transposed up 5 semitones, was a perfect match. Every single note in Homecoming existed on that comb.

3. Design & Fabrication

With the transposed MIDI file ready, I was ready to start CADing the new drum. Luckily, I found MIDI to Music Box. Someone had already created an openSCAD script that generates STL files from MIDI input for this exact style of music box. Thanks Pasha!

Gradio app

After verifying the MIDI timing was correct, I generated and printed the drum in PLA on a Bambu Lab X1C. I was worried about the durability of the tiny pins, but they’ve held up perfectly so far.

Swapping the new drum into the music box was straightforward, a small set screw presses it into the case and aligns it with the comb.

4. Final Result

After reseating the drum and making sure the comb was properly resonating, I was impressed by how well it sounded - and then immediately hit with the feeling like I had overslept and was going to be late for school.

5. Next Steps?

I achieved almost exactly what I set out to do, but there’s an extra layer I’d like to add eventually.

The parallel between taking a digital sound and making it analog was fun, but since it’s used as an alarm, I thought about going further: combining the music box with a mechanical kitchen timer to create a fully analog alarm clock. It would tick down like a timer, then trigger the music box instead of ringing a bell.

Technologies replaced by smartphones

I’m sure I could frame this as social commentary on how smartphones have replaced dozens of analog devices, and reversing it by instead making a digital experience analog, but honestly I just think the mechanism would be neat.