Chord.Parse reads "Cm7#5", "Cm#5" and "Cm+" as augmented chords with a major third (Cm7#5 comes back as Caug7) #340
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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 whenIsMinor(body)is true. It should print back asCm#5/Cm7#5. - Reject it: return false from
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.- The same holds for
Cm#5,Cm+andCmaug7. C7#5,CaugandC+are unchanged.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
matt-edmondson commentedon Sep 30, 2026
Triage
m7#5) parses successfully into a different chord.Semantics.Music,Chord.DetermineQuality.MajorFlatFive, is preferable to rejecting it, becausem7#5is standard lead-sheet notation.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