You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lead sheets often write an alteration as - or + after a number:
C7-9 or C7(-9) means C7♭9
C7-5 means C7♭5
C7+9 means C7♯9
The parser only recognises b, ♭, # and ♯ as alteration signs (ConsumeTensions, Chord.cs:288-312; ConsumeFifthAlteration, Chord.cs:315-329). Instead:
a - anywhere in the body is read as a minor third (IsMinor, Chord.cs:381-384, body.Contains('-'));
a + anywhere is read as augmented (DetermineQuality, Chord.cs:360).
Parentheses are stripped first (Chord.cs:66), so the explicit form C7(-9) is misread the same way.
Reproduced
These results come from running each input through the built library at 7167117:
Input
Result today (ToString / tones)
Meant
C7-9 / C7(-9)
Cm79, [0,3,7,10,14]
C7♭9, [0,4,7,10,13]
C7-5
Cm7, [0,3,7,10]
C7♭5, [0,4,6,10]
Cmaj7-5
Cmmaj7, [0,3,7,11]
Cmaj7♭5, [0,4,6,11]
C7-13
Cm713
C7♭13
C7+9
Caug79, [0,4,8,10,14]
C7♯9, [0,4,7,10,15]
Each input is parsed as a different chord rather than rejected. In the ♭5 cases the alteration is lost entirely.
Suggested fix
When - or + directly follows a digit (so not at the start of the body), read -5/-9/-13 as b5/b9/b13 and +9/+11 as #9/#11. Do this before the quality is decided.
Then make IsMinor look for - only at the start of the body.
Keep the existing readings of C-, C-7, C-9 (minor ninth), C-7b5, C+, C7+ and C7+5.
Rejecting these spellings would also be acceptable; misreading them is not.
Acceptance criteria
Each row in the table produces the "Meant" tones and round-trips.
Priority: Medium. C7-9, C7-5 and C7+9 are standard lead-sheet spellings, and today they parse as a different chord with the wrong tones and no error. The scope is limited to Chord.Parse in the Music package, but this is the most user-visible of the current Chord parser bugs.
Area / suggested assignment:Semantics.Music/Chord.cs, in IsMinor (381-384, body.Contains('-')), DetermineQuality (360, + handling), ConsumeTensions (288-312), ConsumeFifthAlteration (315-329) and the parenthesis stripping at line 66.
Notes: Rewriting -/+ that follows a digit into b/# before the quality is decided is the smallest change. Pin C-, C-7, C-9, C-7b5, C+, C7+ and C7+5 with regression tests before changing IsMinor.
Activity
matt-edmondson commentedon Sep 30, 2026
Triage
C7-9,C7-5andC7+9are standard lead-sheet spellings, and today they parse as a different chord with the wrong tones and no error. The scope is limited toChord.Parsein the Music package, but this is the most user-visible of the current Chord parser bugs.Semantics.Music/Chord.cs, inIsMinor(381-384,body.Contains('-')),DetermineQuality(360,+handling),ConsumeTensions(288-312),ConsumeFifthAlteration(315-329) and the parenthesis stripping at line 66.Cm7#5/Cm+read as augmented) touches the same minor and augmented detection, so the two should be fixed together. Chord.Parse accepts quality characters in any order and any number: "C7M", "C57", "C77" and "C7m" all parse as C7 #346 (quality characters in any order) changes the same leftover and quality checks. Chord.Parse stacks the natural 9th/11th under an altered one: "C13#11" sounds both F and F#, "C13b9" both Db and D #341 (altered tensions stacked on natural ones) is also inConsumeTensions. Chord.ToString() writes an altered tension straight after the root: "C(#11)" prints as "C#11" and reparses as a C# dominant eleventh #336 and Chord round-trip breaks for a seventh with add11/add13: "C7add13" prints as "C713", which reparses as C13 with a 9th and 11th #300 are the ToString round-trips, and the acceptance criteria here need round-tripping.-/+that follows a digit intob/#before the quality is decided is the smallest change. PinC-,C-7,C-9,C-7b5,C+,C7+andC7+5with regression tests before changingIsMinor.Generated by Claude Code
matt-edmondson commentedon Sep 30, 2026
Covered by #360, which redesigns this bug cluster as a whole. Implement it through that issue rather than individually.
Generated by Claude Code
[minor] Redesign chord symbols; fixes #300, #322, #336, #340, #341, #344