MCC
Loading...
Searching...
No Matches
Music-Domain Specification

Invariants shared by every MCC music-theory module.

Invariants shared by every MCC music-theory module.

Status: approved (Phase 2). Every rule below is normative; later phases implement and test against it. Identifiers such as SPEC-OCT-1 are referenced from unit tests.

Terminology revision (after Phase 4): the spelled letter + accidental type is NoteName and PitchClass is the integer class 0-11, following the standard music-theory meaning of "pitch class". The rules are unchanged.

Terminology

MCC builds absolute pitch in two steps:

Letter + Accidental -> NoteName (written spelling, no octave)
NoteName + Octave -> Pitch (written, absolute)
Type Meaning Example
MCC::Letter Diatonic letter name D
MCC::Accidental Chromatic alteration of a letter sharp (+1)
MCC::NoteName Letter + accidental, spelling preserved D#
MCC::Pitch Note name + octave D#4
MCC::PitchClass Pitch class 0-11, spelling discarded 3
MCC::ChromaticIndex Absolute semitone position of a pitch 63
MCC::Interval Directed diatonic + chromatic distance ascending major third
MCC::NoteValue Exact written length: power-of-two base plus dots dotted quarter = 3/8 of a whole note
MCC::Note Written pitch + written note value C#4, dotted eighth
MCC::Meter Written time signature and beat interpretation compound 6/8

MCC::Note is not an alternate absolute-pitch type: MCC::Pitch represents height and spelling; MCC::Note adds a rhythmic value.

Octave convention

Written equality versus enharmonic equivalence

Ordering

Accidental range

Absolute chromatic coordinate

Intervals

Error handling without exceptions

MCC never throws and never has undefined behavior on invalid input.

Embedded memory and object-size constraints

Scales

Chords

Keys

Written rhythm

Text formatting and buffer policy

Invariant-to-test map

Invariants Planned test suite Phase
SPEC-ORD-1, ORD-4, ACC-1..3 NoteNameTests (exhaustive 7 x 9 spellings) 3
SPEC-EQ-1..3, ORD-5..6 PitchComparisonTests 3-4
SPEC-OCT-1..4, ORD-2..3, CHR-1..2 PitchTests (octave and B#/Cb boundaries) 4
SPEC-OCT-2 TuningTests (A4 = 440 Hz, C4 ~ 261.63 Hz) 4
SPEC-INT-1..5 IntervalTests 5
SPEC-INT-6..7 IntervalPropertyTests (inversion, round-trip transposition) 5
SPEC-ERR-1..7 InvalidStateTests per type 3-5
SPEC-EMB-1..3 static_assert layout tests, AVR build 3-5
SPEC-SCL-1..4, EMB-5 ScalePatternTests, ScaleTests, ScaleCatalogTests, manual AVR section inspection 6
SPEC-CHD-1..5, EMB-5 ChordPatternTests, ChordTests, ChordCatalogTests, FromScaleTests, manual AVR section inspection 7
SPEC-KEY-1..3 KeyTests 8
SPEC-TXT-1..5 NotationTests 8
SPEC-RHY-1..4 NoteValueTests (all bases and dot counts) 9
SPEC-RHY-5..7 NoteTests (constructors, invalid state, spelling and movement) 9
SPEC-RHY-8..10 MeterTests (all numerators and denominators, beat derivation) 9
SPEC-RHY-11..14 RhythmPatternTests (both notations, capacity, rotation, necklaces, invalid state) 9