-
fix(foundry): one rotation pass leaves 1 loop in 6 starting on a weak beat · 12fd5bb7
Chasing "does a shipped loop actually start on its downbeat" and nearly filing a false alarm on the way. First measurement said 17% — but it scored 16 slots with no full-band term while the rotator scores bars*4 slots WITH one, so the disagreement was the instrument's. Factored the scorer out (_downbeat_slot_scores) so the rotation and its verification cannot use lookalike measures, and re-measured with the real one. The bug is real and smaller than the first number: over 60 shipped bar-loops, slot 0 was the best slot in 29 and in the WORSE HALF of slots in 10. Median miss was 0.032 — i.e. usually a near-tie — but one loop in six genuinely opens on a weak beat, which is exactly the "timed ok but cut BCDA/DABC" complaint from 2026-07-11 that this function was written to fix. Mechanism: the roll point is zero-crossing snapped by up to ~10 ms against a 20 ms attack window, and between two near-tied slots that is enough to flip which one wins. On clean synthetic material rotation is idempotent (pass 1 finds slot 4, pass 2 finds 0); on real music the tie-breaking is fragile. So it now checks its own result and repeats, up to 3 passes, keeping a pass only if the measured miss improves. Safe because rotation is free: two rolls compose into one and the guard cannot oscillate. Best slot 29 -> 46 of 60, worse half 10 -> 1, median miss 0.032 -> 0.000. Default is 3 rather than opt-in: it is strictly better and applies to every caller, including export_take, so the GUI's forge gets it too. 112 tests.
PLN (Algolia) authored12fd5bb7
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| test_autotune.py | Loading commit data... | |
| test_correlate.py | Loading commit data... | |
| test_engine.py | Loading commit data... | |
| test_grade.py | Loading commit data... | |
| test_loops.py | Loading commit data... | |
| test_naming.py | Loading commit data... | |
| test_stempack.py | Loading commit data... | |
| test_vox.py | Loading commit data... |