Skip to content

Fix #217 — don't beam notes too long to carry a flag - #219

Merged
sbeitzel merged 1 commit into
developfrom
feature/fix_217
Oct 4, 2026
Merged

sbeitzel merged 1 commit into
developfrom
feature/fix_217

Conversation

@sbeitzel

@sbeitzel sbeitzel commented Oct 4, 2026

Copy link
Copy Markdown
Owner

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". BeamResolver used 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 G2d in 6/8 came out as two beamed pairs). abcm2ps 8.14 draws plain quarters and flagged eighths.

How

  • BeamResolver takes only the unit note length; isBeamableDuration tests dur × L < 1/4.
  • SemanticPass no longer rebuilds the resolver on [M:], and the now-unused BodyContext.openingMeter is removed.

Tests

🤖 Generated with Claude Code

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>
@sbeitzel
sbeitzel merged commit c4d9fb9 into develop Oct 4, 2026
2 checks passed
@sbeitzel
sbeitzel deleted the feature/fix_217 branch October 4, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant