Repository navigation
Fix #217 — don't beam notes too long to carry a flag - #219
Merged
Merged
Conversation
A note is beamable when it is shorter than a quarter note, whatever the meter (ABC v2.2 §4.7: "if L:1/8 then ABC2DE is equivalent to AB C2 DE"). BeamResolver used to compare against the meter's beat instead, so in compound meter (and 2/2, 3/2) quarter notes were beamed to their neighbours: `B2A G2d` in 6/8 came out as two beamed pairs. - BeamResolver takes only the unit note length; the meter no longer reaches it, so SemanticPass stops rebuilding it on [M:] and the now-unused BodyContext.openingMeter goes. - The #85 [M:] tests asserted the old rule; they now check the meter lands on the right measure and leaves the beams alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #217
Summary
A note is beamable only if it would carry a flag (shorter than a quarter), whatever the meter, per ABC v2.2 §4.7: "if L:1/8 then ABC2DE is equivalent to AB C2 DE".
BeamResolverused to compare against the meter's beat, so in 6/8, 9/8, 2/2 and 3/2 quarter notes were beamed to their neighbours (B2A G2din 6/8 came out as two beamed pairs). abcm2ps 8.14 draws plain quarters and flagged eighths.How
BeamResolvertakes only the unit note length;isBeamableDurationtestsdur × L < 1/4.SemanticPassno longer rebuilds the resolver on[M:], and the now-unusedBodyContext.openingMeteris removed.Tests
NoteRhythmTests:ABC2DEbeams asAB C2 DEin 4/4, 6/8, 2/2, 3/2, 9/8;B2A G2din 6/8 is all single;c>dis still beamed.InlineLengthAndMeterBeamingTests: the two[M:]tests from Inline [L:] and [M:] never reach BeamResolver — beams computed against stale unit length and meter #85 asserted the old rule (quarters beamed in 6/8). They now check that the meter lands on the right measure and leaves the beams alone.🤖 Generated with Claude Code