How the drop finds your hardest interval

The alignment algorithm behind IntervalRadio, for the curious.

Everyone who trains indoors knows the accidental version of this: once in a while, by pure shuffle luck, the chorus slams in exactly as the interval starts — and suddenly the effort feels 20 watts cheaper. IntervalRadio's job is to make that moment happen on purpose, every ride. Here is how it actually works.

1 · Listening to the music — in your browser

Every track is analyzed client-side (your files never leave your device). The analyzer extracts a per-second loudness curve and a bass-band curve (low-passed at 150 Hz), the tempo and the beat grid — not just BPM, but the phase of beat one, so transitions can land on-beat — integrated loudness (LUFS), and onset density. These combine into an absolute energy score: a weighted blend of loudness, tempo, onset density, and bass share, comparable across every song in your library regardless of mastering.

2 · Finding the drops

A drop is not "the loudest part" — it's an arrival: a jump from a quieter stretch into a sustained loud one. The detector slides over the combined loudness+bass curve comparing the 15 seconds before each point with the 15 seconds after; where the contrast spikes and the following half-minute stays near peak level, that's a drop candidate. Non-maximum suppression keeps the strongest of any cluster, and a song may keep several — verse-chorus music usually yields two or three, and the planner knows about all of them.

Each arrival is also rated, not just located. Three signals decide how hard it actually bangs: how big the jump is, how fast it happens — a cliff scores far above a slow swell — and whether the bass arrives with it, because a drop is a bass flood and a string crescendo is not. That rating decides which songs are allowed to own a moment.

3 · Reading the workout like a DJ set

The workout file gets the same treatment from the other side. Efforts at or near the workout's maximum become drop moments; the minute before each is carved out as a build-up; easy stretches are recoveries; ramps get their summit marked. Each drop moment becomes an anchor — a timestamp where a musical climax should land — and the final anchor of the ride carries a bonus, so the strongest song in the library is reserved for the last, worst effort.

workout anchor: drop lands here track build plays in the lead-in
One anchored selection: the track starts early enough that its detected drop (orange) arrives exactly at the interval start; the stretch before it must be calm — no earlier chorus may leak into the recovery.

4 · Principles from the DJ booth

Matching timestamps would be easy — any script can start a song so its loudest bar coincides with an interval. What makes the moment actually land is everything a good DJ knows about how peaks work, and those instincts are encoded in the planner as hard constraints. Four of them do most of the work:

Never spoil the chorus. A drop detonates once — the first time you hear it. If the refrain has already played softly through a recovery, its return at the interval is a rerun; the crowd has heard the trick. So the planner guarantees the anchored climax is the first one to reach your ears from that song, even when that means entering the track deep past an earlier chorus and sacrificing it entirely. The drop you get was never given away cheap.

Tension is half the payoff. A climax is only as big as the quiet before it. The music riding into an anchor must genuinely recede — an approach, not a plateau — so that when the interval opens, the release is real. Candidates whose lead-in already blasts are rejected no matter how good their drop is.

Commit to the transition. Sometimes the timing leaves no room for a graceful lead-in. The answer is never a few limp seconds of filler — the anchored track enters with a hard cut, on the beat, and owns the moment. Hesitation is the only transition that sounds wrong.

A swell is not a drop. Detection is not endorsement: plenty of songs technically arrive somewhere without ever detonating. A climax below the bang threshold is refused the anchor outright — an honestly hard song beats a fake moment — and among real candidates, what counts is the energy of the stretch that will actually play at the drop, not the song's average: a track doesn't get the ride's biggest moment on the strength of an intro nobody will hear.

The exhale is aligned too. Drops have a mirror: the moment a hard block ends and the power steps down. When the workout falls off a cliff, the planner looks for a song whose own energy falls off a cliff — the end of a chorus, the start of a breakdown — and places it so the two land on the same second. The music exhales exactly when the legs do, and simply keeps playing through the boundary: the best transition is the one that never happens.

Spend peaks where they pay, and save the biggest for last. A climax that fires into a rest is a wasted peak — and it cheapens the ones that landed true. Anchored songs are cut off before any second drop can bleed into a recovery, and when a harder effort still waits ahead, the strongest song in the library is held back for it. Like any set worth remembering, the ride ends on the biggest moment.

5 · Reading the room between drops

Between anchors there is no playlist and no per-phase preset — just one continuous instinct: play at the energy of what's coming, not what was. The planner matches each pick against the intensity of the minutes ahead, with the same asymmetry a DJ applies to a floor: efforts have a hard energy floor — when a song dies mid-interval, its replacement goes just as hard, never a breather — while recoveries are held deliberately calm, because the excitement for the next effort is the anchored build's job, never the break's.

And because both the workout and every song are known in advance, a pick is judged over the whole stretch it will play — a song that fits perfectly for one minute and collapses for the next three loses to one that stays right. Every change carries a cost, and the planner prices it explicitly: mild drift between song and workout is never worth breaking the flow, so the music plays on; only when the plan shows a sustained, serious mismatch ahead does the selection end early — on a proper blend, at the point where honesty beats momentum.

Even a song ending is a decision, not a scheduled cut. A pick made in an interval's dying seconds serves the effort to its last pedal stroke and hands over at the boundary — unless its own audio decays into something that suits the break, in which case it simply keeps playing. Switching always costs something; an outro that fits beats any cut.

The levels are mixed like a set, too. Every track is gain-staged to matched loudness, recoveries sit a few decibels lower so the efforts physically hit harder, the low end is handed from song to song during long blends instead of stacking, and just before an aligned drop a filter quietly starves the bass — so the drop can give it back.

Underneath it all, the craft details: transitions enter on the beat grid, tempo continuity is respected — including half- and double-time mixing — silence never makes it to your ears, and the planner remembers. What played recently rotates out; what you skip sinks, ride after ride. A skip is not a shuffle — it's an opinion, and the set learns it.

The result

The plan is recomputed live — every song end, skip, seek, and library change re-consults the planner at the exact ride position, so you can add music mid-workout or jump around and the alignment holds. With a smart trainer connected, ERG mode drives the resistance from the same clock the music follows: the drop and the watts arrive together, by construction.

Try it — free, in your browser

IntervalRadio analyzes audio locally using WebAssembly signal processing; nothing you upload leaves your device. Streaming catalog by Audius under the Open Music License. Questions or nerd talk: feedback@intervalradio.com