Skip to content

feat(music): analysis aggregate layer — progressions, harmony, forms [minor]#110

Merged
matt-edmondson merged 16 commits into
mainfrom
feat/music-analysis-aggregate
Jul 1, 2026
Merged

feat(music): analysis aggregate layer — progressions, harmony, forms [minor]#110
matt-edmondson merged 16 commits into
mainfrom
feat/music-analysis-aggregate

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Summary

Phase 1 of the semantic-domains roadmap (docs/roadmap-semantic-domains.md), scoped to analysis. Adds an analysis-oriented aggregate layer to the existing Semantics.Music package — harmony nested inside structure — built entirely on the existing primitives (Chord, Key, Scale, Duration, TimeSignature). No new package, no new dependency; target matrix unchanged (net8.0net10.0 + netstandard2.0/netstandard2.1).

What's new

  • Progression (ChordEvent sequence + bar-based harmonic rhythm; Parse("Dm7 | G7 | Cmaj7")) with five analyses:
    • RomanNumerals(Key), Functions(Key)HarmonicFunction
    • Cadences(Key)CadenceInstance/Cadence (authentic / plagal / half / deceptive)
    • InferKey()/InferKeys()KeyMatch (quality-weighted diatonic fit)
    • ChromaticChords(Key)ChromaticAnalysis/ChromaticKind (secondary dominant, borrowed, Neapolitan)
  • Structure: Section/SectionType, Arrangement, and Form/NamedForm (AABA, ternary, binary, rondo, strophic, through-composed, and the 12-bar blues progression template).

Design decisions

  • Analysis focus (not playback/notation): tempo/seconds timing, tuning, clefs, articulations, and the Score/Track/Voice performance containers are deliberately out of scope.
  • Key inference is quality-weighted — a chord scores fully only when its triad quality matches the diatonic triad at that degree. Root-only scoring can't separate a key from its relative/parallel neighbours (this surfaced during implementation and the spec/plan were updated).
  • ThirtyTwoBarAABA is recognized by the AABA letter pattern (bar-length not enforced) so Form.Of and Form.FromPattern agree; NamedForm.VerseChorus and ChromaticKind.AugmentedSixth are declared but intentionally not auto-emitted (documented as reserved). Cadences are degree-based (no PAC/IAC split — no voice-leading model).

Testing

  • New MSTest files: ProgressionTests, HarmonicFunctionTests, CadenceTests, KeyInferenceTests, ChromaticAnalysisTests, SectionTests, ArrangementTests, FormTests.
  • Full suite 982/982 passing; clean multi-target build (0 warnings, warnings-as-errors).

Docs

  • Spec: docs/superpowers/specs/2026-07-01-music-analysis-aggregate-design.md; plan: docs/superpowers/plans/2026-07-01-music-analysis-aggregate.md.
  • README gains an analysis subsection with a usage snippet; CLAUDE.md gains the previously-missing Semantics.Music project-layout row.

Versioning

Additive feature to an existing package — the merge commit should carry [minor] (included in the PR title).

Phase 1 reframed around analysis: Progression + functional-harmony
analysis (roman numerals, function, cadences, key inference, chromatic
identification) nested inside Section -> Arrangement, with Form as the
extracted structural pattern. Added to Semantics.Music; playback/notation
concerns explicitly out of scope.
11 tasks across 3 milestones (Progression+roman/function/cadence,
key inference+chromatic ID, Section/Arrangement/Form), TDD steps with
complete code and per-task commits.
Root-only scoring cannot separate a key from its relative/parallel
neighbours (Am Dm Em Am scores 1.0 for A major, A aeolian, and C major
alike), so the prefer-major tie-break wrongly picked A major. Weight each
chord by whether its triad quality matches the diatonic triad at that
degree. Discovered during Task 6 implementation (implementer BLOCKED).
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 996f3e2 into main Jul 1, 2026
6 checks passed
@matt-edmondson
matt-edmondson deleted the feat/music-analysis-aggregate branch July 1, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant