CMT Format Overview
CMT encodes each musical event as a single token using this standardized format:
π‘ Key Concept: Each token represents a complete musical event with both pitch information (using Scientific Pitch Notation) and timing information (using ABC notation-style duration codes).
Pitch Encoding (SPN-style)
Token Part | Meaning | Examples |
---|---|---|
Note
|
Letter names AβG |
C ,
F ,
G
|
Accidental
|
# for sharp, b for flat |
F# ,
Bb
|
Octave
|
Integer (0β8) |
C4 ,
A3
|
Duration Encoding (ABC-style)
Code | Meaning | Beats (4/4) | Example |
---|---|---|---|
w
|
Whole | 4 |
C4:w
|
h
|
Half | 2 |
D4:h
|
q
|
Quarter | 1 |
E4:q
|
e
|
Eighth | Β½ |
F#4:e
|
s
|
Sixteenth | ΒΌ |
G4:s
|
.
|
Dot modifier | +Β½ of base |
A4:h. (dotted half = 3
beats)
|
t
|
Triplet prefix | β of base |
tq = triplet quarter
|
Representing Rests
Use "rest"
as the pitch component
to represent silence:
π Note: Rest tokens follow the same duration encoding rules as pitched notes, but use the literal string "rest" instead of a pitch specification.
Basic Examples
Here are some practical examples of CMT tokens in action:
β Valid Examples
A4:q
- Quarter note A4-
C#5:h.
- Dotted half C#5 rest:e
- Eighth rest
β Invalid Examples
-
H4:q
- Invalid note name C4
- Missing durationC:q
- Missing octave
Optional Extensions
You can extend CMT tokens with suffixes or tags for additional musical information:
Articulation
Lyrics
Velocity/Dynamics
Measure Markers
Why Use CMT?
Compact and Readable
Human-readable format that's also machine-parseable
Easy to Parse and Validate
Simple regex patterns can validate and extract components
Ideal for Music Applications
Perfect for audit overlays, tutor apps, and export workflows
SPN-Aligned and MIDI-Compatible
Integrates seamlessly with existing music software standards
JSON Measure Structure
CMT tokens are typically organized within JSON structures representing musical measures:
π Structure Benefits
- β’ Clear measure boundaries for musical organization
- β’ Easy to iterate through for playback or analysis
- β’ Compatible with existing JSON-based music formats
- β’ Supports additional measure-level metadata