Blog · December 4, 2026 · 7 min read
melody-bounce: A Free Claude Code Skill That Makes Guess-the-Song Shorts in Code
Nobody animated these Shorts. A glowing square hits a wall on every note of a tune, and cartoon cats hop down neon stairs and land on every note. Claude plans the walls and steps from the music, proves every hit lands on its note, and synthesizes the sound in code. A free skill, and here is how it works.
Nobody animated the two videos below. In the first, a glowing square bounces through a board of tiles, and every wall it hits plays the next note of a famous piano piece. In the second, cartoon cats hop down a neon staircase, and every landing plays the next note of a Christmas carol. Both are guess-the-song videos, so the answers are at the end of this post. The walls and the steps were not placed by hand. They were worked out from the music, so every hit lands on its note, and a physics check proves it. A 45-second Short exports in about 72 seconds on my laptop and costs nothing. The skill that made them is called melody-bounce, and this post is about how it works and where it still falls short.
This is my ninth content skill. khan-explainer draws blackboard lessons and paper-reel cuts paper shapes for short reels. cel-story, maker-bench and pixel-spec build 3D sets in three.js, toon-pov paints 2D cartoon stories, silver-reel turns a story into an old newsreel and physics-reel runs satisfying physics simulations. In physics-reel the tune follows the physics. melody-bounce turns that around: the tune comes first, and the picture is built to fit it.
Where it came from
Guess-the-song bounce videos are a genre of their own in Shorts feeds. Something bounces, every bounce is a note, and you try to name the tune before it ends. That genre was the inspiration. Claude wrote the planner, the drawing, the cats and the sound for this project, and the looks are original, with no footage, images, logos or names from any channel. A melody-bounce video is made of these parts:
- 01A tune, written out by hand. Each tune is a short text file of notes and lengths from a public-domain composition, and every bar is checked against its time signature.
- 02Geometry planned from the notes. The mover goes at one constant speed, and each wall or step sits exactly where the mover is when its note sounds. The corridor or the staircase is built as the video goes.
- 03A hit on every note. Each wall or landing plays a synthesized note, panned to where it happens on screen, over a soft melody line and simple chords.
- 04A title and an ending. A "Guess the song" pill sits at the top, and the video ends on "Did you guess it? Answer in the comments". For videos that aren't a quiz, it can end on the tune's name and composer instead.
- 05One small JSON file per video. The preset, the tune, the seed, the palette, the hit sound and the text all live in one piece file.

The geometry comes from the music
melody-bounce starts from the note times. The square or the cat moves at one constant speed between hits, so the gap between two notes times the speed is the length of the corridor between two walls, or the width of a step. Each wall or step goes exactly where the mover is when its note sounds.
In grid-bounce the square always moves at 45 degrees. At every note a seeded search decides whether it bounces off a side wall or off a floor or ceiling, so it stays on the board, never passes through a wall that is already there, and spreads its drawing over the board. If a choice leads to a dead end, the search backs up and tries another. Each wall lights up in the colour of its note, warm for low notes and cool for high ones, and sends a ripple through the tiles. Walls appear 0.42 seconds before their note, so you can see what's coming. On the last note the square stops in a corner and the camera pulls back to show the whole tune as a drawing.
In neon-stairs the staircase is built from the same rule. Lower notes drop further, long notes make wide steps and high, flipping jumps, and quick notes hop in place on the same step. At the end of each phrase the cat lands next to the next cat, who takes over on the same beat, and the cats that finished stay sitting on their steps and nod along. The preset has eight cat coats, all drawn in code. The Short uses six: tuxedo, smoke, tabby, snow, midnight and ginger.
A piece is a short JSON file. This one is an example in the repo, a staircase for a tune that speeds up the whole way, with the answer shown at the end:
{
"preset": "neon-stairs",
"melody": "mountain-king",
"seed": 2,
"format": "9:16",
"palette": "aurora",
"voice": "marimba",
"title": "It keeps getting faster",
"reveal": true
}seed picks the layout: the same tune and the same seed give the same video, frame for frame, and another seed gives another layout. palette is one of six looks of our own (plum, ember and mint for the grid, midnight, aurora and sunset for the stairs). voice is the hit sound: a harp-like pluck, a kalimba, a music box or a marimba. reveal: true ends on the tune's name and composer instead of a question.
Proof that every hit lands on its note
A video like this falls apart if one bounce is a little early, so the skill doesn't trust its own plan. check runs a physics re-simulation that only knows the start, the speed and the finished walls or steps. The mover bounces off whatever it really touches, and every contact has to land within one frame of its note, 33.3 ms at 30 frames a second. It also has to be the right wall or step each time, with no extra contacts and the cat's feet on the step.
In both Shorts every contact landed 0.0000 ms from its note: 128 of 128 wall hits in the grid and 84 of 84 landings on the stairs. Then the check listens to the finished MP4. It finds every note attack in the soundtrack and measures it against its note time: the median was 0.0 ms in both, the worst 0.5 ms in the grid Short and 1.0 ms on the stairs, with no shift from the encode. Both came out at -14.0 LUFS. This is the check on the grid Short, as the README prints it:
PASS deterministic plan: hash 2235bcb6b8fd0fd5 (same in a fresh process: true)
PASS timing: 128 contacts for 128 notes (square at 231 px/s); worst contact 0.0000 ms from its note (limit: 1 frame = 33.3 ms)
PASS frames: drawn position at every note time matches the contact point (largest gap 0.000 px)
PASS safe zones: text and the square clear of the Shorts UI (226 samples)
PASS deterministic frames: largest block difference 0.162/255 between two fresh pages
PASS audio: 128 note attacks found in grid-bounce.mp4, median 0.0 ms, worst 0.5 ms from the note time, shift vs the mix 0.00 ms
PASS loudness: -14 LUFS (target -14)
all checks passedThe other lines matter too. The drawn position at every note time has to match the contact point, the text and the moving square or cat have to stay clear of the parts of the screen YouTube covers on a Short, and two fresh browser pages have to draw the same frames.
The sound
There are no music files in melody-bounce. The soundtrack is synthesized in plain JavaScript at export time: a pitched hit on every note, panned to where it happens on screen, a soft sustained tone that carries the melody, the tune's own accompaniment of bass and soft keys, and a small reverb. The reverb follows the public-domain Freeverb design and was written fresh for this project. Then ffmpeg brings the mix to about -14 LUFS.
A tune is a few lines of text. This is the start of Ode to Joy as the README shows it:
export default {
id: 'ode-to-joy', title: 'Ode to Joy', composer: 'Ludwig van Beethoven', year: 1824, died: 1827,
meter: '4/4', bpm: 116, key: 'G major',
melody: `B4:4 B4 C5 D5 | D5 C5 B4 A4 | G4 G4 A4 B4 | B4:4. A4:8 A4:2 | ...`,
accomp: `(G2 G3 B3 D4):1 | (D3 A3 D4 F#4):1 | ...`,
};A note is a pitch and an octave, :4 is a quarter, the length carries over to the next note, r is a rest and | is a bar line. If a bar doesn't add up to the time signature, the list command says which one. The skill file allows only compositions whose composer died more than 100 years ago, or traditional tunes, written out by hand. It never uses recordings, MIDI files, modern arrangements, modern songs, or anime or cartoon openings, because YouTube claims or blocks those. It also tells Claude to check the notes against a public-domain score, because a wrong note in a guess-the-song video gets noticed.

The stack, and why it costs nothing
- A planner in plain JavaScript, written for this project: the note times, the seeded layout search for the grid, the step rules for the stairs, and the physics re-simulation that checks it all.
- A 2D canvas in headless Chromium, driven by Playwright, draws every frame: the board, the stairs, the moon and the cats. No images are used.
- Synthesized sound. Every hit, the melody line, the chords and the reverb are made at export time. There are no samples, SoundFonts, recordings or MIDI files.
- ffmpeg encodes the H.264 video with AAC sound and brings the mix to about -14 LUFS.
- One font, Fredoka, under the SIL Open Font License, for the title pill and the end lines.
- Speed. On my Windows 11 laptop with an Intel Core i5-12500H and Iris Xe graphics, three workers draw a full-size frame in 29 to 36 ms. The 45-second grid Short exports in about 72 seconds and the 32-second stairs Short in about 52.
There is no API key anywhere in this and nothing to pay. There is no image, video or music model either. Every frame and every note comes from code.
Make your own
A new video is a new piece: pick a preset, a tune and a seed, look at a still sheet, export and check.
MB="node ~/.claude/skills/melody-bounce/bin/melody-bounce.mjs"
$MB list # the tunes and presets
$MB new pieces/joy --preset neon-stairs --melody ode-to-joy --seed 3
$MB still pieces/joy auto look.png # 7 frames across the video on one sheet
$MB export pieces/joy joy-test.mp4 --preview --seconds 12 # a quick half-size test
$MB export pieces/joy joy.mp4 # 1080x1920, H.264 + AAC, about -14 LUFS
$MB check pieces/joy # timing, determinism, safe zones, audio, loudnessAdd --format 16:9 to the export for a 1920x1080 video. Rarely, a grid seed needs a bigger board to find a layout, and the planner retries with one on its own. If a seed still fails, try another.
Install
git clone https://github.com/haiderfarooq3/melody-bounce ~/.claude/skills/melody-bounce
cd ~/.claude/skills/melody-bounce && npm install && npx playwright install chromium
node ~/.claude/skills/melody-bounce/bin/melody-bounce.mjs doctorYou also need ffmpeg on your PATH. doctor checks Node, ffmpeg, Playwright and Chromium, the font and every tune's bars, and prints the fix for anything missing. Then ask Claude Code for a video: "make a melody-bounce guess the song Short with Ode to Joy". It makes the piece, looks at a still sheet, exports and runs the check. Claude can't hear the mix, so the skill tells it to say so and ask you to listen once, and it never posts anything without your go-ahead.
Where it falls short
- Two presets so far. The grid and the stairs. Everything else in a video is set in the piece file.
- Claude can't hear it. The timing is proven by the check and the loudness by a meter, but nobody listens to the mix before you do, so the skill asks you to listen once.
- Simple cats. They hop, flip and nod, but they are simple cartoon shapes with no fur detail.
- Very fast notes stay put. On the stairs, a note that comes too quickly has no room for a step edge, so the cat hops in place instead.
- Only old tunes. Every melody is public domain, so you won't get a modern song out of it.
- It has only run on Windows. macOS and Linux should work the same way, but I haven't tried them.
Nine styles
melody-bounce is the ninth style and the second with no script and no voice. A new tune is one text file and a new video is one piece file, and the planning, the proof, the sound and the export come with it.
If you want to see the other formats I make this way, the content catalogue has one finished example of each, and the cats are in it now. If you want a video like this for your product, start at the contact page. The cats are on YouTube as a Short, public from December 7, 2026. And if you just want the skill, it is on GitHub, MIT licensed.
The answers
The square plays Für Elise by Ludwig van Beethoven, from 1810. The cats play We Wish You a Merry Christmas, a traditional English carol. Both are in the public domain.
Questions people asked
- Is melody-bounce really free?
- Yes. The planner, the drawing, the cats and the sound are code written for the project. Headless Chromium, driven by Playwright, draws the frames, and ffmpeg encodes the video. All of it runs on your own computer. There are no API keys, no accounts and no usage limits. There are no samples, SoundFonts, recordings or MIDI files either: every note is synthesized at export time, the tunes are public domain, and the one font, Fredoka, is under the SIL Open Font License.
- How long does a render take?
- On a Windows laptop with an Intel Core i5-12500H and Iris Xe graphics, a frame takes 29 to 36 ms at full size with three render workers, or about 13 ms at half size for a quick test. The 45-second grid Short exports in about 72 seconds and the 32-second stairs Short in about 52, frames, soundtrack, loudness pass and encode included. Planning takes 10 ms to 3 seconds, and the check 5 to 20 seconds.
- Does it need a voice or a script?
- No. There is no narrator and no script. The only words on screen are a title at the top, such as "Guess the song", and two lines at the end. The tune is the script: the notes decide where every wall or step goes.
- Which music can it play?
- Nine public-domain tunes, written out by hand and checked bar by bar against their time signatures: Für Elise, Ode to Joy, In the Hall of the Mountain King, Canon in D, Jingle Bells, We Wish You a Merry Christmas, Deck the Halls, Greensleeves and Silent Night. You can add more in a short text notation, but only compositions whose composer died more than 100 years ago, or traditional tunes. The skill never uses recordings, MIDI files, modern arrangements, modern songs, or anime or cartoon openings, because YouTube claims or blocks those.
- Can it make wide videos too?
- Yes. Every piece renders as a 1080x1920 Short by default, or as a 1920x1080 video with --format 16:9. Both are 30 frames a second, H.264 with AAC sound at about -14 LUFS.
- Can I use it from Codex, Gemini CLI or another agent instead of Claude Code?
- Yes. The skill is one markdown file plus a small Node command-line tool. Any coding agent that can read a markdown file and run a shell command can follow it. Claude Code picks it up automatically from ~/.claude/skills; for other agents, point them at SKILL.md.
- Is it affiliated with Anthropic?
- No. It is an independent MIT-licensed project. Claude is a trademark of Anthropic. melody-bounce uses Playwright and ffmpeg, both open source, and bundles the Fredoka font under the SIL Open Font License. The credits are in NOTICE.md.
Haider Farooq is an AI engineer and data scientist based in Lahore, Pakistan — core engineer on TryCook.ai, developer at Aligno, and creator of MarkSafe.net. He builds agentic AI systems, RAG pipelines, and automation for teams worldwide. Work with him.