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
{{ message }}
Repository navigation
Form never recognises a twelve-bar blues in pentatonic or blues keys (C7–F7–G7 in "C blues_minor" is ThroughComposed) #508
Form.IsTwelveBarBlues (Semantics.Music/Form.cs, around line 289) maps each bar's root with key.FunctionOf(root). It then requires Alteration == 0 and degrees that match the I/IV/V template.
Key.FunctionOf answers from the mode's own scale (Scale.DegreeOf). Roman numerals, functions and cadences instead go through Key.AnalysisScale (#470, Key.cs ~L99/L140), which maps a 5- or 6-degree mode onto major or natural minor.
In a pentatonic or blues key, the mode's own numbering puts IV and V on different degree numbers, or off the scale entirely. So a textbook 12-bar blues fails the template. The keys literally named "blues" are exactly the ones that can't host a blues form, and the result contradicts RomanNumeralOf.
Concrete failure
Standard 12-bar C7 F7 C7 C7 | F7 F7 C7 C7 | G7 F7 C7 G7, one section, whole-bar chords:
In every one of these keys, RomanNumeralOf(F7) returns IV7.
Suggested fix
In IsTwelveBarBlues, take the degree from key.AnalysisScale.DegreeOf(root) instead of key.FunctionOf(root). Alternatively, settle the open question in #490 by moving the public FunctionOf onto AnalysisScale, which fixes this too. The two share a root cause.
Acceptance criteria
The progression above is recognised as NamedForm.TwelveBarBlues in C major_pentatonic, minor_pentatonic, blues_minor and blues_major.
It stays recognised in the seven-degree keys.
Related: #490 (chromatic analysis not using AnalysisScale). Closed #317 and #447 are other blues-form bugs.
Priority: Medium. Form.Name returns the wrong answer for a 12-bar blues in pentatonic and blues keys, and it contradicts RomanNumeralOf. It is confined to music form analysis, and there is no crash or data loss.
Area:Semantics.Music: Form.IsTwelveBarBlues and Key.FunctionOf versus Key.AnalysisScale.
Activity
matt-edmondson commentedon Oct 30, 2026
Triage
Form.Namereturns the wrong answer for a 12-bar blues in pentatonic and blues keys, and it contradictsRomanNumeralOf. It is confined to music form analysis, and there is no crash or data loss.Semantics.Music:Form.IsTwelveBarBluesandKey.FunctionOfversusKey.AnalysisScale.FunctionOfdoes not useAnalysisScale. Deciding ChromaticChords reports a pentatonic key's own ii, IV and V as "borrowed from parallel major", contradicting RomanNumerals/Functions/Cadences (#470 not applied to chromatic analysis) #490 by movingFunctionOfontoAnalysisScalewould fix both, so it is worth settling that first. ClosedForm.Ofdetects a 12-bar blues by counting chord events, not bars: 3 bars of quarter notes match and a real blues with held chords doesn't #317 and Twelve-bar-blues Form does not round-trip: Form.Parse(form.ToString()) != form #447 were earlier blues-form bugs.FormorKey.Generated by Claude Code