What's wrong
In Chord.DetermineQuality (Semantics.Music/Chord.cs:360-376), both the aug/+ branch and the fifthAlteration > 0 branch return ChordQuality.Augmented without looking at IsMinor(body). Augmented always has a major third, so the spelled minor third is dropped.
Commit fecd433 (#335) fixed exactly this for the lowered fifth at :365-369 (IsMinor(body) ? Diminished : MajorFlatFive), but the raised-fifth branch right below it was not changed.
Failure scenario
Run against HEAD with a small console probe:
| Input |
Parsed as |
Tones |
Correct tones |
Cm7#5 |
Augmented + dominant 7, prints Caug7 |
[0,4,8,10] |
[0,3,8,10] |
Cm#5 |
Caug |
[0,4,8] |
[0,3,8] |
Cm+ |
Caug |
[0,4,8] |
[0,3,8] |
The parse succeeds and returns a different set of notes. m7#5 is a common lead-sheet symbol, so a chart containing it is silently voiced with E instead of Eb.
Suggested fix
Pick one:
- Represent it: add a minor-sharp-five quality, mirroring
MajorFlatFive (third = 3, fifth = 8), and return it from both branches when IsMinor(body) is true. It should print back as Cm#5 / Cm7#5.
- Reject it: return false from
TryParse for a minor third with a raised fifth, rather than returning a wrong chord.
Acceptance criteria
Chord.Parse("Cm7#5") has tones [0,3,8,10] and round-trips, or TryParse returns false.
- The same holds for
Cm#5, Cm+ and Cmaug7.
C7#5, Caug and C+ are unchanged.
What's wrong
In
Chord.DetermineQuality(Semantics.Music/Chord.cs:360-376), both theaug/+branch and thefifthAlteration > 0branch returnChordQuality.Augmentedwithout looking atIsMinor(body). Augmented always has a major third, so the spelled minor third is dropped.Commit fecd433 (#335) fixed exactly this for the lowered fifth at
:365-369(IsMinor(body) ? Diminished : MajorFlatFive), but the raised-fifth branch right below it was not changed.Failure scenario
Run against HEAD with a small console probe:
Cm7#5Caug7[0,4,8,10][0,3,8,10]Cm#5Caug[0,4,8][0,3,8]Cm+Caug[0,4,8][0,3,8]The parse succeeds and returns a different set of notes.
m7#5is a common lead-sheet symbol, so a chart containing it is silently voiced with E instead of Eb.Suggested fix
Pick one:
MajorFlatFive(third = 3, fifth = 8), and return it from both branches whenIsMinor(body)is true. It should print back asCm#5/Cm7#5.TryParsefor a minor third with a raised fifth, rather than returning a wrong chord.Acceptance criteria
Chord.Parse("Cm7#5")has tones[0,3,8,10]and round-trips, orTryParsereturns false.Cm#5,Cm+andCmaug7.C7#5,CaugandC+are unchanged.