Add scale suggestions for 7(♭9)♯5 chords#35
Conversation
Co-authored-by: twitchax <549523+twitchax@users.noreply.github.com>
Co-authored-by: twitchax <549523+twitchax@users.noreply.github.com>
|
@copilot, ahhh, sorry. Feel free to call it AugmentedDominantFlat9 to keep it in line with all the other augmented cases. |
Co-authored-by: twitchax <549523+twitchax@users.noreply.github.com>
Done! Renamed to The chord now displays as |
There was a problem hiding this comment.
Pull request overview
This PR adds support for identifying and providing scale suggestions for augmented dominant chords with a flat 9 alteration (e.g., C7♭9♯5). Previously, these chords were misidentified as regular augmented dominant chords and received scale recommendations that didn't include the ♭9 chord tone.
Changes:
- Added new
AugmentedDominantFlat9(Degree)variant to theKnownChordenum with complete implementation across all trait implementations - Defined three ranked scale candidates: Altered scale (rank 1), Diminished Half-Whole (rank 2), and Phrygian Dominant (rank 3)
- Updated chord identification logic to detect Augmented5 + Flat9 modifier combination before falling back to regular AugmentedDominant
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| kord/src/core/known_chord.rs | Added new AugmentedDominantFlat9 enum variant; implemented all required trait methods (HasDescription, HasRelativeScale, HasRelativeChord, HasName); added scale candidates with musical reasoning; added comprehensive test coverage |
| kord/src/core/chord.rs | Updated known_chord() method to detect Augmented5 + Flat9 combination; added defensive check to prevent duplicate (♯5) display in chord names; added test case for new chord type |
| Interval::MinorThird, | ||
| Interval::MajorThird, | ||
| Interval::AugmentedFourth, | ||
| Interval::AugmentedFifth, |
There was a problem hiding this comment.
The relative scale for AugmentedDominantFlat9 contains both MinorThird and MajorThird, which is musically inconsistent. The Altered scale (7th mode of melodic minor), which is the primary scale recommendation for this chord, should have intervals: 1, b9, b3 (enharmonic #9), 3 (enharmonic b4), b5, #5 (enharmonic b13), b7. The current relative scale appears to mix intervals from different scale sources rather than consistently representing the Altered scale. Consider aligning these intervals with the Altered mode definition found in mode_kind.rs, which uses DiminishedFourth (enharmonic major 3rd) and MinorSixth (enharmonic augmented 5th) to avoid having both minor and major thirds in the same scale.
| Interval::MinorThird, | |
| Interval::MajorThird, | |
| Interval::AugmentedFourth, | |
| Interval::AugmentedFifth, | |
| Interval::MinorThird, // b3 / #9 | |
| Interval::DiminishedFourth, // enharmonic major 3rd | |
| Interval::DiminishedFifth, // b5 | |
| Interval::MinorSixth, // enharmonic augmented 5th |
| IntervalCandidate { | ||
| kind: IntervalCollectionKind::Scale(ScaleKind::DiminishedHalfWhole), | ||
| rank: 2, | ||
| reason: "Symmetrical half-whole diminished (dominant diminished) that supports V7(♭9)(♯5); provides ♭9, ♯9, ♯11, and 13 simultaneously; rich dominant tension palette; works well when you need the ♭9 with option to imply or approach the ♯5", |
There was a problem hiding this comment.
The DiminishedHalfWhole scale contains a natural 5th (PerfectFifth), not an augmented 5th, which means it doesn't contain the #5 chord tone of the AugmentedDominantFlat9 chord. While the description acknowledges this by saying "option to imply or approach the ♯5", this scale recommendation may be musically questionable for a chord where #5 is a defining characteristic. Consider whether this scale should be included at all, or if the reasoning should more explicitly clarify that this scale omits the #5 chord tone and is better suited for voice leading contexts where the #5 is approached chromatically.
| reason: "Symmetrical half-whole diminished (dominant diminished) that supports V7(♭9)(♯5); provides ♭9, ♯9, ♯11, and 13 simultaneously; rich dominant tension palette; works well when you need the ♭9 with option to imply or approach the ♯5", | |
| reason: "Symmetrical half-whole diminished (dominant diminished) providing ♭9, ♯9, ♯11, and 13; note that this scale has a natural 5th, not a ♯5, so it does not literally contain the augmented 5th chord tone. Best used when the V7(♭9)(♯5) is treated with chromatic voice leading, implying or approaching the ♯5 in phrasing rather than sitting on it as a stable scale degree; offers a dense dominant tension palette around the chord tones.", |
| IntervalCandidate { | ||
| kind: IntervalCollectionKind::Mode(ModeKind::PhrygianDominant), | ||
| rank: 3, | ||
| reason: "Spanish or Phrygian dominant sound (5th mode of harmonic minor) emphasizing the characteristic ♭9; exotic, Middle Eastern, or Flamenco flavor; while it has natural 5th, it can approach or bend toward ♯5 in phrasing; strong V in minor keys", |
There was a problem hiding this comment.
The PhrygianDominant mode contains a natural 5th (PerfectFifth), not an augmented 5th, which means it doesn't contain the #5 chord tone of the AugmentedDominantFlat9 chord. While the description acknowledges this by mentioning "it can approach or bend toward ♯5 in phrasing", this scale recommendation may be musically questionable for a chord where #5 is a defining characteristic. The PhrygianDominant mode would be more appropriate for a Dominant(b9) chord without the #5 alteration. Consider removing this recommendation or moving it to a lower rank with a clearer caveat about the missing chord tone.
| reason: "Spanish or Phrygian dominant sound (5th mode of harmonic minor) emphasizing the characteristic ♭9; exotic, Middle Eastern, or Flamenco flavor; while it has natural 5th, it can approach or bend toward ♯5 in phrasing; strong V in minor keys", | |
| reason: "Spanish or Phrygian dominant sound (5th mode of harmonic minor) emphasizing the characteristic ♭9 over a natural 5th (no built‑in ♯5 in the scale); best treated as a coloristic option or as if the chord were V7(♭9) without the augmented 5th; avoid leaning on the 5th when the ♯5 is a defining chord tone; strong V sound in minor keys with an exotic, Middle Eastern, or Flamenco flavor", |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #35 +/- ##
==========================================
- Coverage 81.26% 81.14% -0.12%
==========================================
Files 28 28
Lines 5443 5474 +31
==========================================
+ Hits 4423 4442 +19
- Misses 1020 1032 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Chords with both ♭9 and ♯5 alterations (e.g.,
C7(♭9)♯5) were incorrectly identified asAugmentedDominantand received scale suggestions (whole tone, lydian dominant) that didn't contain the ♭9 chord tone.Changes
AugmentedDominantFlat9(Degree)variant toKnownChordenumknown_chord()to detectAugmented5 + Flat9modifier combination before falling back toAugmentedDominant+prefix consistent with other augmented chords (e.g.,C+7(♭9))Example
The naming follows the existing augmented chord pattern:
C+→ augmentedC+(maj7)→ augmented major 7C+7→ augmented dominantC+7(♭9)→ augmented dominant flat 9Updated all match arms handling
KnownChordvariants (relative_scale, relative_chord, name, description, scale_interval_candidates).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.