test(cale): the scheduler had one musical rule and no way to check it
`Deck.scheduleBar` mixed the decision (what plays, when) with the audio nodes, so the only rule in the rack with real musical consequence could not be tested without a browser. Extracted as `hitsInBar(voice, barIndex, bpm, swing, bufDur)`. The rule is that a bar-loop starts only on a bar that is a multiple of its own length. Break it and the rack still makes sound — it plays a 4-bar loop's bar 1 underneath the phrase's bar 4, so the groove turns around in the wrong place. That is not a crash, it is a musical wrongness you would find mid-set and probably blame on the sample. 11 cases, including the ones I would otherwise have got wrong: a negative bar index when the transport is nudged backwards, a phrase that runs past bar 8, a cleared cell at the second entry of a 4-bar loop, and the two asymmetries between the modes — a bar-loop is stretched to the DECK tempo (that is what layering means) while a chop never is (a stab is a stab at 90 or 174), and a chop is unconstrained by stride because it is sub-bar by definition. Confirmed the stride tests fail when the rule is disabled: 2 failed / 22 passed. Suite 13 → 24.
Showing
armada/ui/src/kits/__tests__/engine.test.ts
0 → 100644
Please
register
or
sign in
to comment