
headroom v2.0 — Sort Playlists by Camelot Key + BPM for CDJ
Hey everyone,
A while back I posted headroom here — a CLI tool that simulates Rekordbox's Auto Gain and bakes the gain into the file so CDJs don't lose it on USB. Thanks for the feedback on that thread — v2.0 is out, and it adds something I kept wishing for in Rekordbox itself.
The Problem (again)
Rekordbox has a lot of features that live entirely inside the laptop app. Auto Gain was the original one. The other one that always bites me is sort order: I want a playlist sorted by Camelot Key, then BPM ascending, so I can stage a harmonic warmup set.
Rekordbox (and the CDJ-3000 / XDJ gear) lets me sort by Key or BPM as a single column — but not by Key then BPM as a compound sort. And even that single-column sort only changes the on-screen display: USB export uses the playlist's stored order, so any reshuffling you did on screen evaporates the moment it hits the CDJ.
Same pattern as Auto Gain: the software-only feature doesn't follow the music to the deck.
The Solution
v2.0 adds a new headroom rbsort subcommand ←New💖
- Reads your
collection.xml(Rekordbox: File > Export Collection in xml format) - Sorts each playlist by Camelot Key (1A → 12B), then BPM ascending
- Writes the sorted copies into a new
Sorted (Key+BPM)/folder appended to the same XML - Leaves originals untouched
You re-import the XML via Preferences > Advanced > Database > rekordbox xml > Imported Library, drag the sorted playlists into your main library, and export to USB. The CDJ now plays the set in Key+BPM order — no on-deck reshuffling.
Run it on a single playlist, a nested folder, or just point it at the XML and it'll sort every TrackID-referenced playlist in one pass. No ffmpeg required for this subcommand — pure XML in/out.
Setup note
You need Rekordbox key display set to Alphanumeric (1A..12B): Preferences > View > Key display format > Alphanumeric. Anything still showing in Am / C# notation gets sorted last.
Loudness side (the original feature)
Still here, behavior unchanged. Quick recap of what landed since the original post:
- Uniform True Peak ceiling at -0.5 dBTP by default — the most aggressive value AES TD1008 §7B sanctions for a delivery limiter. Overridable via
--tp-target. - Lossless AAC/M4A gain in addition to MP3 (1.5 dB steps, via the bundled mp3rgain library)
- Scriptable CLI flags so you can run it from a pipeline without the interactive prompts
Installation
macOS (Homebrew):
brew install M-Igashi/tap/headroom
Windows (winget):
winget install M-Igashi.headroom
Arch Linux (AUR): yay -S headroom-bin
Cargo: cargo install headroom
Links
- Site: https://headroom.ravers.workers.dev
- GitHub: https://github.com/M-Igashi/headroom
- Previous thread: https://www.reddit.com/r/Rekordbox/comments/1q7sxqq/headroom_simulate_rekordbox_auto_gain_for_cdj/
Feedback and PRs welcome as always 🙏