Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 2.14 KB

Music-Macro-Language.md

File metadata and controls

35 lines (26 loc) · 2.14 KB

Valid version

Feature Version
Music Macro Language 0.9.18+

Description

MML (Music Macro Language) is a DSL to describe music. PRK supports an MSX-like MML.

See also [[Sounder]].

Instructions

All instructions are case insensitive.

Instruction Effect Values Example
T<tempo> Specifies tempo of the song tempo: 1 to any
(default: 120)
T200, T60
O<octave> Specifies octave of the notes after this instruction. Each octave starts from C and ends at B octave: 0 to 9
(default: 4)
O5, O8
L<fraction>[<dot>] Specifies the length of the notes after this instruction fraction: 1 to any
dot: . (multiple dots allowed)
L2., L16
A to G[<semitone>][<fraction>][<dot>] Specifies a note from the scale, optionally with a semitone and/or fraction and/or dot(s) C D E F G A B
semitone: + -
fraction: 1 to any
dot: . (multiple dots allowed)
C+8..
R[<fraction>][<dot>] Specifies a rest fraction: 1 to any
dot: . (multiple dots allowed)
R, R1.
< Increases one octave after this instruction O4 A < A is equivalent to O4 A O5 A
> Decreases one octave after this instruction O4 A > A is equivalent to O4 A O3 A
Q<sustain> Specifies the ratio of the actual sounding length of the note length derived from the <fraction> value.
Formula: <sustain> / 8
sustain: 1 to 8
(default: 8)
Q4 A4 A4 is equivalent to Q8 A8 R8 A8 A8
Q8 A4 A4 is equivalent to Q8 A2

Common operands

Operand Effect Default Example
<fraction> Represents a fraction of a whole note to specify the length of a note or a rest. For example, 4 is a quarter note 4 L8, C1, R3
<semitone> Optionally raises or lowers by a semitone the note just before it C-, A+
<dot> Optionally adds a half of the length to the note or rest just before it. Multiple periods are also valid L2., C.., R8.