Skip to content

Form never recognises a twelve-bar blues in pentatonic or blues keys (C7–F7–G7 in "C blues_minor" is ThroughComposed) #508

Open

Description

@matt-edmondson

What's wrong

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:

Key Form.Name FunctionOf (F, G)
C major / mixolydian / dorian TwelveBarBlues 4, 5
C major_pentatonic ThroughComposed #3, 4
C minor_pentatonic ThroughComposed 3, 4
C blues_minor ThroughComposed 3, 5
C blues_major ThroughComposed #4, 5

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.

Activity

  1. added
    bug
    on Oct 30, 2026
  2. matt-edmondson commented on Oct 30, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions