Skip to content

v0.6.0 — Force tempo

Choose a tag to compare

@PortableDiag PortableDiag released this 16 Sep 22:54
· 5 commits to main since this release

Set a BPM and every track plays at it. A pitch-preserving stretch, so a 128 BPM track at 1.09x is still in the key it was recorded in.

Switch it on under Force tempo behind the gear button, pick a target from 60 to 200, and each track is sped up as far as it needs to reach it. It exists for one complaint — a workout playlist where one slow track is a slow patch in the workout — and every default follows from that.

Control Default What it does
Target tempo 140 BPM The tempo to bring every track to.
Most a track may be stretched 30% A track that cannot reach the target inside the ceiling goes as far as the ceiling allows rather than further.
Never slow a track down on A track already at or above the target is left completely alone — verified bit-exact, not merely by length.

Where a tempo comes from. The file's TBPM tag if it has a believable one; otherwise measured — half a minute decoded from 30 s in, reduced to an onset envelope at 10 ms and autocorrelated. Remembered per track, and the next track is analysed while the current one plays, so the only track ever heard at the wrong speed is the one that was already playing when you switched it on.

A track with no steady tempo is found to have none and left alone, and that finding is written down. "Nothing known yet" and "nothing there" stay two different states all the way out to the API — a player that invented a tempo for a podcast and played it 30% fast would be indefensible.

The measurement is editable, because you can hear when it is wrong. Type over the BPM in the now-playing panel; your number wins and is never quietly re-measured, and clearing it measures again.

GET/POST /api/tempo and four new fields on /api/settings do all of it.

Also fixed — a freeze that predates this release

Changing a playback setting twice while paused could hang the player outright: the window stopped repainting and the control API accepted connections it would never answer, with nothing printed anywhere, because nothing had crashed. A branch being torn down was blocked pushing into a mixer that was not consuming, and the main thread waited on its stream lock forever. Reproduced on v0.5.1 with two crossfade changes.

Verified

verify.sh 8/8 · verify-resume.sh 6/6 · verify-api.sh 81/81 · verify-mpris-modes.sh 4/4 · 69 unit tests.

The stretch check measures pitch as well as length, because naively resampling the audio shortens a render by exactly the same ratio and transposes it up — 440 Hz must still be 440 Hz. A deliberately resampled render was fed to the checker and is caught at 550 Hz.