Skip to content

Parse music charts strictly and write bar lines where the bars are - #487

Merged
matt-edmondson merged 2 commits into
mainfrom
claude/project-thread-p236qz
Oct 27, 2026
Merged

matt-edmondson merged 2 commits into
mainfrom
claude/project-thread-p236qz

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Requested by Matt · project thread

Fixes #328, #339, #353, #384, #321, #447, #471, #475.

Parsing

Writing

Form

The README's AABA example now uses eight-bar sections so its comment stays true.

Tests

New StrictParsingTests cover every input from the issues. FormTests adds AABA length, verse-chorus, strophic, blues round-trip and malformed-name cases. The full Semantics.Test suite passes locally: 1813 passed, 12 skipped.

Commit is tagged [minor], because inputs that used to be accepted are now rejected and Form's text can carry a name.


Generated by Claude Code

…are [minor]

- Integer fields in Duration, Velocity, TimeSignature, Interval and Pitch
  take no whitespace or '+', and a Duration denominator no sign; Tempo's
  BPM takes no whitespace or sign (#471).
- Note, Rest and ChordEvent reject a zero or negative duration in Create
  and TryParse, as does a Progression "chord@n/d" cell. Duration itself
  stays a signed rational (#353).
- Progression.Parse rejects a "/" after a "chord@n/d" cell instead of
  dropping it (#328). "|" stays a visual aid that Parse ignores, which the
  spec now says, since "4/4  C | G" shorthand is used throughout.
- Progression.ToString tracks the bar position exactly and writes "|"
  wherever a bar ends between tokens, including inside a held chord (#475).
- Arrangement.Parse treats any run of blank or whitespace-only lines as
  one section separator (#339).
- Form.Of names AABA the 32-bar form only when every section is eight
  bars (#384), recognizes VerseChorus from section types (#321, #384), and
  Form text carries the name when the pattern does not imply it, as
  "A (TwelveBarBlues)", so every Form round-trips (#447).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zHCYynCj4HwiWQqff3Kkf
@matt-edmondson matt-edmondson self-assigned this Oct 26, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zHCYynCj4HwiWQqff3Kkf
@sonarqubecloud

Copy link
Copy Markdown

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.

Progression.Parse silently drops beat slashes after a Chord@n/d cell: "4/4 C@1/2 / / | G" parses as C for 2 beats with G on beat 3

2 participants