← Back to library

Sync a coded product video's scene cuts to the music beat

Yaori (@Pashoke1) notes that a coding agent building a product video cannot hear the soundtrack, so cuts land wherever scenes end. He has the agent measure the track with librosa for tempo, beats and the loudest moment, snap scene changes to the beat, time the reveal to the drop and add a slight zoom on kicks.

  • OutcomeLine up every scene change in a code-built product video with the beat of your chosen track, and put the product reveal on the drop.
  • SetupUnder an hour
  • LevelIntermediate
  • CreditYaori (@Pashoke1)
View original
Works with
Claude CodeClaudeChatGPTGemini

Published Oct 21, 2026Updated Oct 21, 2026AI dry run on sample input: passed Oct 21, 2026Source verified Oct 24, 2026

When should you use it?

  • Your agent builds marketing or launch videos as code (Remotion or similar) and the edit feels off the music
  • You have a licensed music track and a scene list with rough timings
  • You want consistent pacing across a series of short promo videos

Not for: Tracks you do not have the rights to use; Footage edited in a timeline app where the agent cannot move the cuts

What do you need, and what do you get?

You need

  • A music file you are licensed to use
  • The video project or a scene list with start times
  • Frame rate of the final render

You get

  • Detected tempo and beat times
  • A cut list with old and new times and how many frames each cut moved
  • The reveal timed to the drop, plus subtle kick-driven zoom settings

How does it work, step by step?

  1. Choose the music yourselfPick a track you hold the rights to and put it in the project folder; the agent only places it.
  2. Map the beatsHave the agent run librosa on the file and report the tempo, beat timestamps and the loudest change in the song.
  3. Snap the scene changesMove each scene boundary to the nearest beat, favoring bar starts every four or eight beats rather than every beat, and stretch the animation between them slightly.
  4. Time the reveal and add motionPlace the product reveal on the drop and add a roughly 1% zoom pulse on kicks.
  5. Check by earWatch the opening seconds with sound; if one cut lands late, ask the agent to nudge only that cut by a few frames.

The prompt

The original prompt by @Pashoke1, word for word, with a link to where it was published. Below it is our adapted version with fill-in blanks, if you want it. Works in Claude Code, Claude, ChatGPT and others. Values in lime are placeholders.

Original prompt by @Pashoke1

Word for wordby @Pashoke1
Here's my track: ./audio/track.mp3. Detect the BPM and every beat with librosa. Find the biggest drop. Move every scene cut onto a beat. Land the drop on the product reveal. Punch the frame 1% on each kick.

Exactly as published by @Pashoke1 in Post on cutting AI-built videos on the beat.

Our adapted version (optional)

Fill in the blanks (optional; the copied prompt uses your values)

Adapted prompt5 variables
Use {music_file} (I hold the rights) as the soundtrack for {video_project}, rendered at {fps} fps.
Analyze the audio with librosa: report the tempo, the beat times and the moment the song gets loudest. Before changing anything, confirm the beats line up with the kick drum, not the hi-hats; if they are off by about half a beat, track the low-frequency band instead and show me the corrected times.
Then move each scene change to the nearest bar start, about every {cut_every} beats, and put {key_moment} on the loudest moment. Add a 1% zoom pulse on kicks.
Show a table of each cut: old time, new time and frames moved. Keep the previous version so I can compare.

What can go wrong?

  • Beat detection can lock onto hi-hats or off-beats and land every cut half a beat late; in our dry run it did, so check the first few beats against the kick drum before snapping.
  • Cutting on every single beat at dance-music tempos feels frantic; space cuts four or eight beats apart.
  • Music rights are on you: use royalty-free or licensed tracks only.

Our take

A small, practical trick for anyone using an AI coding agent to build promo videos: music timing is where these videos usually look amateur, and the fix is plain measurement. The prompt works because each instruction is checkable, so you can confirm the tempo, the drop time and each moved cut. We ran it on a synthetic 124 BPM track with a quiet intro, a drop at about 16 seconds and a seven-scene mock product video. Beat tracking out of the box reported 123 BPM but locked onto the hi-hats, so every beat sat about a quarter second late; tracking the low-frequency kick band instead brought the error under 30 milliseconds, and onset detection found the drop within 15 milliseconds. Our adapted prompt asks the agent to show that alignment check before it moves anything. The poster's own advice to space cuts four or eight beats apart and to fix stray cuts one at a time held up in our run.

Where the time goes back: Finding beats and moving each cut by hand is fiddly timeline work; here the agent produces a frame-exact cut list in one pass and you only review it.

FAQ

Do I need to know audio editing?
No. The agent installs and runs the audio library and reports times in seconds and frames; you only judge whether it sounds right.
Does this work outside Remotion?
The beat analysis works for any project the agent can edit in code. If your video lives in a timeline editor, you can still use the cut list as a guide and move the cuts by hand.

Source and credit

The original prompt on this page is by @Pashoke1, shown word for word with a link to where it was published. The summary, notes and adapted version are ours.

Original
Post on cutting AI-built videos on the beat
Creator
Yaori (@Pashoke1)
Published on
X
Original date
Oct 20, 2026
License
Not openly licensed; the original prompt is shown word for word with credit and a link to the original
Originally for
Claude Code
AI dry run
Oct 21, 2026: passed. Dry-run tested by our AI test agent on sample input. Real audio analysis run; method works with the alignment check, which we added to our adapted prompt and pitfalls.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 24, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Marketing

All 97 Marketing playbooks →

Related playbooks

MarketingPrompt✓ AI dry run

Build content briefs from Search Console gaps

Feed Search Console exports to an assistant to find high-impression low-click queries, missing topics and cannibalization, then write article briefs with a short answer block and question-style headings.

Credit: u/BadMenFinance on r/ClaudeAI

Under an hour
MarketingRoutine✓ AI dry run

Get a Monday brief on what your competitors changed

A scheduled assistant checks each competitor's site, news and hiring each week and hands you one short brief with the biggest change on top.

Credit: u/Professional-Rest138 on r/PromptEngineering

Minutes
MarketingWorkflow✓ AI dry run

Run marketing ops with markdown subagents

A small team of agents that follows a written weekly plan, shares rules and memory through files, and learns from a tracker you can read.

Credit: u/Practical_Dig6095 on r/AskGTM

An afternoon+
MarketingWorkflow✓ AI dry run

Split SEO article writing into stages with a fact-check

Run research, outline, draft, fact-check and polish as separate agent stages so made-up claims are caught before publishing.

Credit: u/GonkDroidEnergy on r/Agentic_SEO

An afternoon+
MarketingRoutine✓ AI dry run

Turn niche news into four social drafts each morning

Each morning, scan today’s niche headlines, choose the best fit for your audience, and email yourself channel-specific drafts across four networks, each with its own image crop notes — publish only after you edit.

Credit: Corey Ganim (@coreyganim)

Under an hour