Skip to content

Parse CMaj7, CmMaj7 and C°7 as the sevenths they name - #332

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/chord-seventh-spellings
Sep 29, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/chord-seventh-spellings

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #281

What

Chord.DetermineSeventh:

  • hasMaj7 also matches "Maj". Before, CMaj7 parsed as C7 and CmMaj7 as Cm7.
  • The diminished-seventh branch accepts '°' as well as "dim", the same test DetermineQuality already applies to the triad. Before, C°7 fell through to a dominant seventh on a diminished triad, which is the half-diminished Cm7b5.

Tests

New Parse_AlternativeSeventhSpellings_GiveTheSeventhTheyName asserts quality, SeventhType and ChordTones() directly rather than a round-trip, because the misparsed chords round-trip consistently:

Symbol Seventh Tones
CmMaj7 Major 0,3,7,11
CMaj7 Major 0,4,7,11
C°7 Diminished 0,3,6,9

All three rows fail without the change. With it, Semantics.Test on net10.0 passes: 1356 passed, 8 skipped, 0 failed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VeSBKr7Q99CTQ5BUJMKEct


Generated by Claude Code

DetermineSeventh matched "maj", "M7" and 'Δ' but not "Maj", so CMaj7 and
CmMaj7 fell through to a dominant seventh. Its diminished-seventh branch
checked only "dim", although DetermineQuality also accepts '°', so C°7
became the half-diminished chord. Accept both spellings, and assert the
seventh type and pitches directly, since the misparsed chords round-trip.

Fixes #281

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VeSBKr7Q99CTQ5BUJMKEct
@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.

Chord.Parse reads "CmMaj7"/"CMaj7" as dominant/minor sevenths and "C°7" as half-diminished

2 participants