Cut a YouTube Short on the beat: BPM to cut times in Python

Turn a music bed's BPM into cut start times for a 30-second Short. Runnable Python, plus the $0.10 Timeline render and $0.125 bed.

5 min readSume
All posts

Cuts that land on the beat read as edited on purpose. The math is small: seconds per beat is 60 divided by BPM, and a cut every N beats is N times that. Sume's Timeline takes a list of video slots (1 to 200) with an audio spine, so once you have the times you can size each slot.

The calculation

Ask Music Router for a track at a stated tempo in the prompt, for example 'about 120 BPM, instrumental, no vocals'. The tempo the model delivers is not guaranteed, so measure it or round to the nearest cut you can see on a waveform. The script below only does the arithmetic.

bpm = 120
beats_per_cut = 4
total_s = 30
step = 60 / bpm * beats_per_cut
starts = []
t = 0.0
while t < total_s:
    starts.append(round(t, 3))
    t += step
print(len(starts), "slots")
print("slot length", step, "s")
print(starts)

Cost of the cut

At 120 BPM and four beats per cut, a 30-second Short has 15 slots of 2 seconds. The Timeline render bills per output minute, so 30 seconds is $0.10, the same as 60 seconds. The bed is a fixed $0.125 (read 2026-10-07).

Slots by tempo, 30 s Short, four beats per cut, read 2026-10-07
BPMSlot lengthSlots
902.667 s12
1202.0 s15
1401.714 s18

Sources

Related posts

More in Developers

All Developers posts

Written by Sume