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 names any AABA arrangement ThirtyTwoBarAABA regardless of section length, and NamedForm.VerseChorus can never be produced #384
ThirtyTwoBarAABA = AABA (with the four sections each ~8 bars) … enum NamedForm { ThirtyTwoBarAABA, TwelveBarBlues, VerseChorus, … }
Semantics.Music/Form.cs implements only part of this:
The AABA bar-length check is missing.RecognizePattern maps the string "AABA" straight to NamedForm.ThirtyTwoBarAABA (Form.cs ~L106-109). It never looks at Section.Bars, although Form.Of has the sections in hand.
Four 2-bar sections in an A A B A order are reported as a "32-bar AABA" form, which is 8 bars long.
Form.Parse("AABA") has no bar information at all, so it also returns ThirtyTwoBarAABA. The parse-only path should arguably stay as it is, or return a less specific name, but that choice needs to be made on purpose.
NamedForm.VerseChorus can never be produced. It is declared in NamedForm.cs:15, but neither RecognizePattern nor Form.Of returns it. The spec lists it in the enum but never gives it a recognition rule.
A consumer that switches over NamedForm gets an arm that can never fire.
A verse/chorus song such as Verse, Chorus, Verse, Chorus, Bridge, Chorus (the spec's own example, L232) comes out as Unknown.
(The 12-bar blues half of this spec section, which counts events rather than bars, is already tracked in #317 and is not part of this issue.)
What exists today
Semantics.Music/Form.cs: Of builds the letter pattern from IsSameStructure groups; RecognizePattern does a pure string switch.
Semantics.Music/Section.cs:26: Section.Bars already exists, derived from Progression.TotalBars, so the data needed for the check is available.
Semantics.Test/Music/FormTests.cs: Of_ExtractsAABAPattern_AndNamesThirtyTwoBarForm uses short sections and still expects ThirtyTwoBarAABA.
Acceptance criteria
Form.Of returns ThirtyTwoBarAABA only when the pattern is AABAand each of the four sections is about 8 bars long. Pick and document a tolerance; exactly 8 is the simplest choice. Otherwise it falls through to the generic result for that pattern (Unknown).
Decide what Form.Parse("AABA") returns when it has no bar data, and document that in the XML docs.
VerseChorus either:
gets a recognition rule based on SectionType, for example the arrangement alternates sections typed Verse and Chorus with at least two of each, allowing an optional Bridge/Intro/Outro, plus a test; or
is removed from NamedForm. That is a breaking change and should be tagged [major].
Tests:
AABA made of 8-bar sections gives ThirtyTwoBarAABA.
AABA made of 2-bar sections gives something other than ThirtyTwoBarAABA.
The spec's verse/chorus example gives VerseChorus, if that option is chosen.
Dependencies
None. This can land independently of #317, although both touch Form.Of and could share a PR.
Category: Bug (labelled enhancement). Form.Of misnames short AABA arrangements against the spec, and NamedForm.VerseChorus is an enum value nothing can produce.
Priority: Medium. The analysis output is wrong but nothing crashes, and it only affects Semantics.Music form naming.
Suggested area / assignment:Semantics.Music, Form.Of / RecognizePattern
Already in progress: No open PR references this issue.
Decision needed: Two choices to make up front. Should VerseChorus get a SectionType-based recognition rule, or be removed ([major])? And what should Form.Parse("AABA") return when it has no bar data?
Recommended next step: Make those two decisions, then add the 8-bar check using Section.Bars. Update Of_ExtractsAABAPattern_AndNamesThirtyTwoBarForm, which currently relies on short sections.
Fixed by #487 (commit 47dffbb, now on main). The commit cites this issue inline as "(#384)" rather than with a "Fixes" keyword, so GitHub didn't close it. Closing by hand.
Activity
matt-edmondson commentedon Oct 6, 2026
Triage
enhancement).Form.Ofmisnames short AABA arrangements against the spec, andNamedForm.VerseChorusis an enum value nothing can produce.Semantics.Musicform naming.Semantics.Music,Form.Of/RecognizePatternForm.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 (open), which covers the 12-bar-blues half of the same spec section. Both changeForm.Of, so one PR could take both.VerseChorusget aSectionType-based recognition rule, or be removed ([major])? And what shouldForm.Parse("AABA")return when it has no bar data?Recommended next step: Make those two decisions, then add the 8-bar check using
Section.Bars. UpdateOf_ExtractsAABAPattern_AndNamesThirtyTwoBarForm, which currently relies on short sections.Generated by Claude Code
matt-edmondson commentedon Oct 29, 2026
Fixed by #487 (commit 47dffbb, now on
main). The commit cites this issue inline as "(#384)" rather than with a "Fixes" keyword, so GitHub didn't close it. Closing by hand.Generated by Claude Code