feat(douanier): low-hanging endpoints — /onsets, /waveform, /analyze (#40)
Three cheap, torch-free, cached building blocks — the no-model tier, plus a convenience composite. The image now serves 8 engines (emotion/features/samples/ grade/onsets/waveform/analyze + separate-503). - POST /onsets → onset hit times (s) + tempo + onset rate. Rhythmic hits for visual sync / slicing. scope `onsets`. - POST /waveform → render-ready waveform: per-bin [min,max] in [-1,1] + a 0..1 RMS energy envelope (?bins= ≤4000). For hexa's audio-reactive visuals. scope `waveform`. - POST /analyze → emotion + features + sample role in ONE cached call (fewer round-trips for hexa); each is the same engine the dedicated routes use. scope `analyze`. engines/signal.py is self-contained librosa (onsets uses feature.tempo, the 0.11-correct path). Validated in the torch-free container (/onsets tempo 107.7 n=41; /waveform bins honored, peaks in range; /analyze returns all three blocks). 50/50 tests (added test_signal.py: engine + endpoint + cache + scope-gate + torch-free).
Showing
armada/api/engines/signal.py
0 → 100644
armada/api/tests/test_signal.py
0 → 100644
Please
register
or
sign in
to comment