Commit
Consolidate sample classification into a single rules engine
Commit details
Commit notes
The worker, Elysia API mapper, and Essentia service each ran their own classification rules that overrode or cancelled each other:
- Elysia re-applied half/double-time octave correction on top of Essentia's tempo decision, using only the final number plus a hardcoded 80-170 prior, so it could un-do Essentia's (better-informed) octave choice. - Elysia re-gated keys with thresholds that differed from Essentia's own key nulling, so a sample could be tonal in one layer and stripped in the other depending on which boundary it fell between. - Elysia re-classified/fabricated drum types, producing rows where isLoop, drumType and category disagreed and where drumTypeConfidence described a different label than the one stored. - The worker's dedup cache treated 'kick/perc + no bpm/key' as a stale legacy analysis, but that is the correct, normal Essentia output for a drum one-shot, so every percussive one-shot was re-analyzed on each dedup hit.
Now each layer does what it is strongest at:
- Essentia owns all audio-informed decisions (tempo + octave, key gating, loop, drum type). Key gating moves into a pure, unit-tested classification_rules module so there is one source of truth for the thresholds. - The Elysia mapper becomes thin: unit/Camelot conversion, null-coalescing, and a value-preserving policy for whether to surface a one-shot's tempo. - The worker re-analyzes only rows that lack Essentia-only feature columns.
[private session redacted]
- Files changed
- 6
- Lines added
- +328
- Lines removed
- −203