LOADING…
0%
Complete changelog

Commit

fix(classification): consistent sample types + sharper key detection

Commit details

Commit notes

The library "Type" column was inconsistent: it rendered a value that depended on CLAP fields, so when CLAP hadn't classified a sample only Essentia's isLoop survived — loops showed "loop" and everything else showed "—". The sample_type and instrument columns were also never surfaced by the API.

Clean Essentia/CLAP split (each does what it's good at): - Essentia (always runs, DSP) now owns the STRUCTURAL sample_type (loop/one_shot/phrase), derived deterministically from loop detection + duration + onsets. This guarantees the Type column is never empty. - CLAP (semantic) owns the INSTRUMENT label (kick/808/vocal) and the coarse category family; it no longer clobbers Essentia's structural type (sample_type via COALESCE). - Surface sampleType/instrument/instrumentConfidence + a derived displayType ("instrument, else structural type") from both library and samples routes and the similar-samples row; the grid renders displayType. - Shared deriveDisplayType/deriveSampleType helpers (+ unit tests). - Backfill sample_type for existing analyzed rows in SQL so the column populates immediately without re-analysis; add sample_type to guest_samples.

Key detection accuracy: - Add SpectralWhitening before HPCP in the tonal pipeline — the step Essentia's reference KeyExtractor uses. It flattens the spectral envelope so percussion bleed / a dominant fundamental no longer biases the chroma, which materially improves key accuracy on full-mix loops. Falls back safely if unavailable.

Co-Authored-By: Claude Opus 4.8 <[email redacted]> Claude-Session: [private session redacted]

Files changed
16
Lines added
+359
Lines removed
−28
This page is a permanent record of commit 7acd0cc0.