What's wrong
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.
C-7, C-9, C-7b5, C+, C7+ and C7+5 are unchanged.
What's wrong
Lead sheets often write an alteration as
-or+after a number:C7-9orC7(-9)means C7♭9C7-5means C7♭5C7+9means C7♯9The parser only recognises
b,♭,#and♯as alteration signs (ConsumeTensions,Chord.cs:288-312;ConsumeFifthAlteration,Chord.cs:315-329). Instead:-anywhere in the body is read as a minor third (IsMinor,Chord.cs:381-384,body.Contains('-'));+anywhere is read as augmented (DetermineQuality,Chord.cs:360).Parentheses are stripped first (
Chord.cs:66), so the explicit formC7(-9)is misread the same way.Reproduced
These results come from running each input through the built library at 7167117:
C7-9/C7(-9)Cm79, [0,3,7,10,14]C7-5Cm7, [0,3,7,10]Cmaj7-5Cmmaj7, [0,3,7,11]C7-13Cm713C7+9Caug79, [0,4,8,10,14]Each input is parsed as a different chord rather than rejected. In the ♭5 cases the alteration is lost entirely.
Suggested fix
-or+directly follows a digit (so not at the start of the body), read-5/-9/-13asb5/b9/b13and+9/+11as#9/#11. Do this before the quality is decided.IsMinorlook for-only at the start of the body.C-,C-7,C-9(minor ninth),C-7b5,C+,C7+andC7+5.Rejecting these spellings would also be acceptable; misreading them is not.
Acceptance criteria
C-7,C-9,C-7b5,C+,C7+andC7+5are unchanged.