Rekordbox 6.6.4 on macOS 13.4, library of 912 tracks, all analyzed with the same settings. After a batch re-analysis, 37 tracks showed keys that were a semitone off from what Mixed In Key had reported a year earlier. These were mostly tracks with strong sub-bass and sparse mids — dub techno, some lo-fi house. The Camelot wheel values shifted, which broke my harmonic mixing sets.
I didn’t want to re-analyze everything, because that would also reset cue points and beat grids for tracks I’d already prepared. Instead, I pulled the key from the Rekordbox database and cross-checked against a quick Python script using librosa’s chroma_cqt. For each suspect track, I computed the key from the first 90 seconds (skipping intros) and compared.
import librosa
import numpy as np
def estimate_key(path):
y, sr = librosa.load(path, sr=22050, mono=True, offset=30, duration=90)
chroma = librosa.feature.chroma_cqt(y=y, sr=sr)
chroma_mean = chroma.mean(axis=1)
# Krumhansl-Schmuckler key profiles
maj_profile = np.array([6.35, 2.23, 3.48, 2.33, 4.38, 4.09, 2.52, 5.19, 2.39, 3.66, 2.29, 2.88])
min_profile = np.array([6.33, 2.68, 3.52, 5.38, 2.60, 3.53, 2.54, 4.75, 3.98, 2.69, 3.34, 3.17])
maj_corrs = [np.corrcoef(np.roll(maj_profile, i), chroma_mean)[0,1] for i in range(12)]
min_corrs = [np.corrcoef(np.roll(min_profile, i), chroma_mean)[0,1] for i in range(12)]
maj_key = np.argmax(maj_corrs)
min_key = np.argmax(min_corrs)
if max(maj_corrs) > max(min_corrs):
return maj_key, 'major'
else:
return min_key, 'minor'
For the 37 suspects, 29 matched the librosa estimate (within a semitone), confirming the drift. For those, I edited the key tag directly in the Rekordbox XML export and re-imported. The remaining 8 were ambiguous — likely modal tracks — and I left them as is.
The reason this happens: Rekordbox’s key detection uses a spectral peak-picking method that can lock onto a dominant frequency that isn’t the tonic, especially when the bassline is a fifth or fourth. Librosa’s chroma-based approach is more robust to that, but it’s slower and can still fail on tracks with heavy percussion or spoken word. The trade-off is time: analyzing 900 tracks with librosa took about 25 minutes on my M1 MacBook Air, versus Rekordbox’s real-time-ish batch.
This method breaks down for tracks with key changes (some prog house), atonal intros, or very short loops. I also had one track where the librosa estimate was a full tritone off because the intro was just a filtered kick drum. So always spot-check a few by ear before batch-editing.
What’s your go-to check when you suspect a key tag is wrong but you don’t want to trust your ears after three hours of mixing?


0 条评论
还没有评论,写下第一条。