halp: one quantification grid, walked once, matching libossia exactly - #185
halp: one quantification grid, walked once, matching libossia exactly#185jcelerier wants to merge 1 commit into
Conversation
|
Completed the consumer check for the last two objects, using libremidi and libossia from score's source tree.
For AudioParticles I compiled score's actual generated TU with score's own defines/includes/flags, substituting this branch's
|
tick_musical reported no quantification date at all when the timeline ran backwards, and its sub-bar grid ran from the start of the tick rather than from the bar line, so a bar whose length is not a whole number of divisions carried a stale phase into the next one. Walk one grid instead: bar lines come from the signature and from the bar positions the host reports, the grid restarts at each of them, and the walk runs in tick order in both directions - [start; end[ forwards, ]end; start] rewinding - so a point on the tick's far end belongs to the next tick and fires exactly once. metronome() and get_quantification_date() now share that walk and one map from a musical position to a frame, so a click and a quantized event on the same bar line land on the same sample. The result matches ossia::token_request point for point: over five signatures, eight rates, four speeds and two buffer lengths the two agree exactly on the count, the index and the frame of every point, which ossia/score's QuantificationParityTest now asserts strictly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGta2LPAedDP3Txvyq8kTW
e3651ae to
948d21d
Compare
The score changes here call token_request::physical_position, get_quantification_point and the musical position a quantification point now carries, and QuantificationParityTest compiles halp's grid alongside ossia's. None of that exists in the submodule commits master records, so CI built the new code against the old libraries and every job failed. To be rebased onto the merge commits of ossia/libossia#917 and celtera/avendish#185 before this is merged.
tick_musicalreported no quantification date at all when the timeline ran backwards, and its sub-bar grid ran from the start of the tick rather than from the bar line — so a bar whose length is not a whole number of divisions (7/8 against a half-note grid) carried a stale phase into the next one.What changed
One grid, walked once. Bar lines come from the signature and from the bar positions the host reports; the grid restarts at each bar line; the walk runs in tick order in both directions —
[start; end[forwards,]end; start]rewinding — so a point on the tick's far end belongs to the next tick and fires exactly once.metronome()andget_quantification_date()now share that walk and one map from a musical position to a frame, so a click and a quantized event on the same bar line land on the same sample.Parity with libossia is now asserted, not assumed
ossia::token_requestandhalp::tick_musicalwere documented as behaviourally identical and nothing compared them. They were not identical: ossia truncated the musical position to a whole-flick date and its consumers floored that into a frame — two roundings — while halp floors the position directly. On ~2e-5 of points the two landed one frame apart.ossia/score#2163 adds
QuantificationParityTest, which drives both implementations from the token streamstime_intervalactually emits. Over five signatures, eight rates, four speeds and two buffer lengths they now agree exactly on the count, the index and the frame of every point — 1,529,184 assertions. The fix for the double rounding is in libossia (ossia/libossia#917); this branch is what it had to match.Companion to ossia/libossia#917 and ossia/score#2163.