Upload a short video and get a spotting sheet: which track to use, which slice of it, and every sound effect timed to the frame.

Role

Design and development

Stack

Python, FastAPI, ffmpeg, Gemini, numpy, SQLite

Year

2026

Status

Private build

Sonicue main screen

The product

Sonicue helps short form video editors score a cut. You upload a video and it returns the royalty free track to use, the exact slice of it so the drop lands on your beat, and a timed list of sound effects with levels and reasons.

Most tools tell you which song. This one tells you where to put it.

Model

Gemini Flash, called through the Google GenAI SDK, with structured output constrained to fixed enums. Exactly one model call per video, and it is the only rate limited step in the whole pipeline.

The free tier is limited by requests per day, not by spend, so the thing to save is round trips. Flash gets roughly 1,500 requests a day on the free tier against about 50 for Pro, so I designed for Flash. The model is never asked to find cuts: it samples video at 1 frame per second and cannot tell that a cut happened at 7.28 seconds. ffmpeg finds those exactly and the model is handed the timestamps as facts.

Cost and latency

Cut detection, downscaling, scoring the whole track catalogue (about 20 ms), placing effects and rendering the sheet all run locally for free. An 18 second test reel with 8 cuts used 1,687 tokens and took about 19 seconds end to end.

Tempo and beat phase for a track take about 0.11 seconds, using a spectral flux autocorrelation estimator in about 200 lines of numpy instead of librosa, which pulls in scipy and numba. Each catalogue track already ships a loudness curve, which I turn into where the drop lands and whether the track builds, stays flat or hits early.

Testing

There are 37 tests in the repo. I checked the beat estimator against synthetic click tracks from 72 to 190 BPM: within about 0.1 BPM and 12 ms of phase everywhere except 190 BPM. When it is not confident, the matcher ignores the beat grid and falls back to plain alignment, because a wrong grid is worse than none.

I also ran the whole thing on a reel cut from my own project recordings and checked the result by eye: whooshes on the cuts, and a track lift lined up with the hero beat.

What went wrong

A 190 BPM click track reads as 95, since above about 180 the estimator prefers the half time count, and it is unreliable on rubato, ambient and orchestral music with no steady pulse. Two fixes mattered most for the grid: parabolic interpolation on the autocorrelation peak, and refining each tempo candidate before comparing them.

The model side was flaky too. A model name that worked on older keys returned a 404 on a key created in 2026, so the model is now set by an environment variable, and while I was testing, Gemini answered with a 503 overload error on two calls in a row before the third went through.

Sonicue interface, screen 1
Sonicue interface, screen 2

Outcome

Works end to end on my machine, not deployed publicly. On an 18 second reel of my own screen recordings it detected 8 cuts, placed whooshes on the cuts, and lined a track's lift up with the hero beat at 0:12.

Next case

NO.MADE