Skip to main content
See: /MRS-Specification-RFC#4-mrs-s-the-canonical-storage-format

Measures Section

(measures
  (measure 
    :id #uuid "018c3f40-0001-7890-abcd-ef1234567890"
    :number 1
    :beat-start 0
    :time 4/4
    :key C :mode minor
    :tempo 120
    
    (flute-1
      (v1
        (: 0 C5.q :id #uuid "018c3f2a-0001-...")
        (: 1 D5.q :id #uuid "018c3f2a-0002-...")
        (: 2 E5.h :id #uuid "018c3f2a-0003-...")))
    
    (clarinet-bb
      (v1
        (: 0 r.w :id #uuid "018c3f2a-0010-...")))))

Measure Attributes

AttributeRequiredTypeDescription
:idYESUUIDv7Stable identifier
:numberYESintegerDisplay number (can have gaps)
:beat-startYESrationalAbsolute beat position (orchestrator-computed)
:timeNOfractionTime signature (inherits if omitted)
:keyNOpitch-classKey signature (inherits if omitted)
:modeNOkeywordMode (inherits if omitted)
:tempoNOintegerTempo in BPM (inherits if omitted)
:tempo-textNOstringTempo marking text
:rehearsalNOstringRehearsal mark
:barline-leftNOkeywordLeft barline type
:barline-rightNOkeywordRight barline type

Attribute Inheritance

AttributeInherits?
:timeYes, until changed
:key, :modeYes, until changed
:tempo, :tempo-textYes, until changed
:rehearsalNo (single-measure)
:barline-*No (per-measure)

Barline Types

none single double final
repeat-start repeat-end repeat-both

Instrument Content

Within a measure, content is organized by instrument:
(measure :id #uuid "..." :number 1
  (flute-1
    (v1 ...))
  
  (clarinet-bb
    (v1 ...)
    (v2 ...))
  
  (piano
    (:rh (v1 ...))
    (:lh (v1 ...))))

Voice Naming

Instrument TypeVoice Names
Single-staffv1 through v4
Keyboard:rh/:lh containing v1, v2, etc.

Event Syntax

(: <beat> <pitch-expr> :id <uuid> <properties>*)
ComponentDescription
:Event marker
<beat>Beat position within measure (0-indexed, rational)
<pitch-expr>Pitch, chord, or rest
:idStable UUIDv7 identifier (REQUIRED)
<properties>Optional :keyword value pairs

Examples

(: 0 C5.q :id #uuid "...")           ; C5 quarter on beat 0
(: 1 Eb4.e :id #uuid "..." :dyn f)   ; Eb4 eighth on beat 1, forte
(: 2+1/2 [C4 E4 G4].q :id #uuid "...") ; Chord on beat 2.5
(: 3 r.q :id #uuid "...")            ; Quarter rest on beat 3

Beat Position

Beat positions are exact rationals relative to measure start (0-indexed):
4/4 time:
  0      = Beat 1 (downbeat)
  1      = Beat 2
  2      = Beat 3
  3      = Beat 4
  0+1/2  = "And" of beat 1
  1+3/4  = Fourth sixteenth of beat 2

6/8 time (compound):
  0      = Downbeat
  1      = Dotted quarter 2
  0+1/3  = First eighth subdivision
Canonical form: Use integers for whole beats, mixed numbers for fractions:
  • 0, 1, 2 (integers)
  • 2+1/2 (two and a half)
  • 0+1/3 (one third)
Decimal literals (2.5) are NOT permitted.

Pitch Expression

Single Note

C4.q        ; C4 quarter note
Eb5.h       ; E-flat 5 half note
F#3.e       ; F-sharp 3 eighth note
Bbb4.w      ; B double-flat 4 whole note
Cx4.s       ; C double-sharp 4 sixteenth note

Chord

[C4 E4 G4].q      ; C major triad, quarter
[D3 F#3 A3 C4].h  ; D7 chord, half note

Rest

r.q         ; Quarter rest
r.h         ; Half rest
r.w         ; Whole rest

Duration Codes

CodeNameBeats
wWhole4
hHalf2
qQuarter1
eEighth1/2
sSixteenth1/4
tThirty-second1/8
xSixty-fourth1/16

Dotted Durations

CodeNameBeats
q.Dotted quarter3/2
h.Dotted half3
q..Double-dotted quarter7/4

Event Properties

(: 0 G4.q 
  :id #uuid "018c3f2a-..."
  :dyn ff
  :art staccato
  :orn trill
  :tech pizz
  :lyrics [{:text "Hal-" :syllabic begin}]
  :grace true
  :cue true
  :cue-source violin-1)
PropertyTypeDescription
:dynkeywordDynamic marking
:artkeywordArticulation
:ornkeywordOrnament
:techkeywordPlaying technique
:lyricslistLyric syllables
:gracebooleanGrace note
:cuebooleanCue note
:cue-sourceinstrument-idSource for cue

Dynamics

pppp ppp pp p mp mf f ff fff ffff
sfz sfp sffz fz rf rfz fp sf

Articulations

staccato staccatissimo tenuto accent marcato
portato fermata breath caesura

Ornaments

trill mordent mordent-inverted
turn turn-inverted tremolo
arpeggio glissando

Techniques (Strings)

arco pizz pizz-snap
pont tasto normale
harm harm-natural harm-artificial
spicc detache martele

Techniques (Winds)

tongue double-tongue triple-tongue flutter
cuivre stopped open mute-straight

Tuplets

(tuplet 3:2 q
  (: 0 C4.e :id #uuid "...")
  (: 0+1/3 D4.e :id #uuid "...")
  (: 0+2/3 E4.e :id #uuid "..."))
Triplet: 3 notes in the space of 2 quarters.

Grace Notes

(grace :type acciaccatura
  (: 0 D5.s :id #uuid "..."))

(: 0 C5.q :id #uuid "...")  ; Main note
Grace types: acciaccatura, appoggiatura