Lilylet is a text-based music notation language inspired by LilyPond. It uses a simplified syntax optimized for embedding music snippets in Markdown documents—ideal for tutorials, analyses, exercises, and documentation where music examples appear alongside explanatory text.
Audience: readers with music theory background who understand Markdown. Some may know LilyPond; others may not. Goal: learn Lilylet basics quickly and use it effectively inside Markdown documents.
Lilylet is a text-based music notation language with a LilyPond-like command style, but optimized for quick entry and editing. The typical workflow is to embed Lilylet snippets in Markdown code blocks (```lilylet), next to explanations, analyses, exercises, or version comparisons.
Your first score:
\time 4/4 \clef "treble"
c4 d e f | g2 g | a4 a a a | g1Notes:
\time, \key, \clef, articulations, and dynamics follow familiar LilyPond conventions.| help you explain or revise music measure by measure, which fits well with Markdown-based teaching materials and documentation.Use lowercase a–g:
\time 4/4
c4 d e f | g a b cLilylet always uses relative pitch (similar to LilyPond): if you omit octave markers, Lilylet picks the octave so the interval from the previous note is less than a fifth (keeps motion local and predictable).
\time 4/4
c4 d e f | g a b c | c b a g | f e d c\time 4/4 \clef "C"
c4 e c f | c g c aFrom middle C, writing g after c selects the nearer G (the one below, a fourth down) rather than jumping up a fifth. This rule reduces unintended octave jumps.
Use octave markers to force larger leaps:
| Marker | Effect |
|---|---|
' (apostrophe) |
Raise one octave |
, (comma) |
Lower one octave |
\time 4/4
c4 c' c' c' | c,,, c'' c, c'\time 4/4
c4 g' c g | c' g e cDifferent from LilyPond: inserting a line break (newline) resets the relative-pitch reference to middle C. This is useful when your Markdown is organized as “one line = one bar/phrase”, because moving or inserting lines won’t unexpectedly shift later octaves.
\time 4/4
c4 d e f | g a b c |
c4 b a g | f e d c |If you want the second line to start higher, specify it explicitly:
\time 4/4
c4 d e f | g a b c |
c'4 b a g | f e d c |Unlike LilyPond’s typical workflow of writing an entire voice from start to finish, Lilylet favors interleaved, measure-by-measure voice entry: write all voices for a measure before advancing to the next. This makes multi-voice alignment and live editing simpler, and ensures relative-pitch decisions (octave choice, small-interval preference) are resolved locally within each measure.
Resetting the pitch reference on newlines keeps short snippets stable when copied, reordered, or edited inside a Markdown document. Long, continuous monophonic lines remain supported but are primarily useful for educational examples; in practical Lilylet usage, prefer short, interleaved voice segments for clearer notation and more predictable rendering.
Append a number to a note name:
| Number | Duration | Name |
|---|---|---|
| 1 | Whole note | Semibreve |
| 2 | Half note | Minim |
| 4 | Quarter note | Crotchet |
| 8 | Eighth note | Quaver |
| 16 | Sixteenth note | Semiquaver |
| 32 | Thirty-second note | Demisemiquaver |
| 64 | Sixty-fourth note | Hemidemisemiquaver |
\time 4/4
g'1 | g2 g2 | g4 g4 g4 g4 | g8 g8 g8 g8 g8 g8 g8 g16 g32 g64 g128 g128\rest |If you omit the duration, Lilylet reuses the previous one:
\time 4/4
c4 d e f | g a b cAdd dots after the duration:
| Notation | Duration |
|---|---|
c4. |
Dotted quarter |
c2. |
Dotted half |
c4.. |
Double-dotted quarter |
\time 6/8
c4. d4. | e8 e e f4.\time 12/8
c2. e | g8. g16 g4.. g16Use r plus a duration:
\time 4/4
c4 r4 e4 r4 | g2 r2Use R for a centered full-measure rest (display style), while duration may vary:
\time 4/4
R1 | g'4 a b c\time 3/4
R2. | c4 d eUse s to reserve rhythmic space without printing a rest (common in multi-voice alignment):
\time 4/4 \clef "bass"
r4 d, b b \\
s4 g,2 e4Lilylet uses LilyPond’s English pitch spelling:
s for sharpf for flat| Notation | Meaning |
|---|---|
cs |
C sharp |
cf |
C flat |
ds |
D sharp |
ef |
E flat |
\time 4/4
c4 cs d ds | e f fs g | gs a as b | c1Double accidentals:
ss double-sharpff double-flat\time 4/4
c4 css d dff | e1\key e \minor
\time 4/4
e4 fs g a | b cs ds e | e d c b | a g fs e\time\time 3/4
c4 d e | f g a | b c d | e2.Common meters:
\time 4/4
c4 d e f | g1\time 3/4
c4 d e | f2.\time 6/8
c4. d | e4. f\time 2/2
c2 d | e f | g1\keyUse \key + tonic + mode:
\key g \major
\time 4/4
g4 a b c | d e fs g\key d \minor
\time 4/4
d4 e f g | a bf cs dMore examples:
\key c \major
\time 4/4
c4 d e f | g a b c\key f \major
\time 4/4
f4 g a bf | c d e f\key a \minor
\time 4/4
a4 b c d | e f gs a\clef\clef "bass"
\time 4/4
c,4 d e f | g a b c\clef "alto"
\time 4/4
c4 d e f | g a b cSupported clefs: treble, bass, alto
By default, Lilylet uses standard single barlines | to separate measures. For special barlines, use the \bar command.
| Notation | Meaning |
|---|---|
\bar "||" |
Double barline |
\bar "|." |
Final barline (end of piece) |
\bar ":|." |
End repeat |
\bar ".|:" |
Start repeat |
\time 4/4
c4 d e f \bar "||" | g a b c\time 4/4
c4 d e f | g a b c \bar "|."\time 4/4
c4 d e f \bar ".|:" | g a b c | d e f g \bar ":|."Enclose pitches in angle brackets < >:
\time 4/4
<c e g>4 <d f a> <e g b> <f a c> | <g b d>1\time 4/4
<c e g>2 <f, a c> | <g b d> <c e g> | <c e g>1\time 4/4
<cs e a cs>4 \arpeggio <b d g b>2. \arpeggio | <a cs e a>1 \arpeggioNote: only the first pitch in a chord will pass the relative pitch base to next music event. And inside a chord, pitches also follow relative pitch rules.
Example: <c e g> <d f a> <e g b>
Chord 1 Chord 2 Chord 3
g a b
↓ ↓ ↓
e f g (relative to previous pitch in chord)
↓ ↓ ↓
c ←───────── d ←───────── e (relative pitch bass passing by the root pitch in chords)
The duration applies to the entire chord:
\time 4/4
<c e g>4 <c e g>8 <c e g>8 <c e g>2Use \chords "symbol" to add chord symbols above the staff, commonly used in lead sheets and jazz charts:
\time 4/4
c'4 \chords "C" e g c | a, \chords "Am" c e a\time 4/4
c'4 \chords "Cmaj7" d e f | g \chords "G7" a b cLilylet supports LilyPond-style commands and common shorthand:
| Command | Shorthand | Name |
|---|---|---|
\staccato |
-. or . |
Staccato |
\tenuto |
-- or - |
Tenuto |
\accent |
-> or > |
Accent |
\marcato |
-^ or ^ |
Marcato |
\staccatissimo |
-! or ! |
Staccatissimo |
\portato |
-_ or _ |
Portato |
Dot warning (.):
c4. = dotted rhythmc4-. or c. = staccato\time 4/4
c4-. d-. e-. f-. | g4\staccato a\staccato b\staccato c\staccato\time 4/4
c4\staccato d\tenuto e\accent f\marcato | g4-. a-- b-> c-^Prefix the articulation with:
^ above_ below\time 4/4
c4^. d_. e^> f_>Use -1 through -5 to add fingering numbers to notes, commonly used in piano and guitar music:
\time 4/4
c'4-1 d-2 e-3 f-4 | g-5 a-3 b-2 c-1Fingering can also be applied to chords:
\time 4/4
<c e c'>2-1-2-5 <e g c>-2-3-5 | <e g b>-1-2-4 <f a c>-1-2-3Use ^ for above or _ for below.
\time 4/4
c'4^1 d^2 e^3 f^4 | g_5 a_3 b_2 c_1| Notation | Meaning |
|---|---|
\ppp |
Pianississimo |
\pp |
Pianissimo |
\p |
Piano |
\mp |
Mezzo-piano |
\mf |
Mezzo-forte |
\f |
Forte |
\ff |
Fortissimo |
\fff |
Fortississimo |
\sfz |
Sforzando |
\time 4/4
c4\pp d e f | g\mf a b c | d\f e f g | a\ff b c d\sfz| Notation | Meaning |
|---|---|
\< |
Start crescendo |
\> |
Start diminuendo |
\! |
End hairpin |
\time 4/4
c4\< d e f | g a b c\!\time 4/4
c'4\> b a g | f e d c\!\time 4/4
c4\pp\< d e f | g\mf a b c | d e f g\! | a\ff\> b a g | f\p\! e d cUse ( to start and ) to end:
\time 4/4
c4( d e f) | g( a b c) | c( b a g) | f1Use ~ between the same pitch:
\time 4/4
c2~ c4 d | e2~ e4 f | g1~ | g2 r2\time 4/4
c4 d8~ d c4 d | e8~ e d4~ d e | f2~ f4 g | a1Use [ and ]:
\time 4/4
c8[ d e f] g[ a b c] | c[ b a g] f4 r\time 6/8
c8[ d e] f[ g a] | b[ c d] e4.Note: As in LilyPond, ( ) [ ] are postfixes on musical events, not scope delimiters.
| Notation | Name |
|---|---|
\trill |
Trill |
\turn |
Turn |
\mordent |
Mordent |
\prall |
Pralltriller |
\fermata |
Fermata |
\shortfermata |
Short fermata |
\arpeggio |
Arpeggio (for chords) |
\time 4/4
c2\trill d | e4\trill f g2 | a1\trill\time 4/4
c4 d e f | g2\fermata r2 | a4 b c d | e1\fermata\time 4/4
<c e g>2\arpeggio <d f a>\arpeggio | <e g b>1\arpeggioUse \grace before a note or a group:
\time 4/4
\grace d16 c4 e g c | \grace { b,16 c } d4 f a d\time 4/4
\grace e16 d4 f a d | \grace fs16 g4 b d g\time 4/4
\grace { c16[ d e] } f4 a c f | \grace { g16[ a] } b4 d f bUse \times numerator/denominator { notes }:
\time 4/4
\times 2/3 { c4 d e } \times 2/3 { f g a } | b2 c\time 4/4
c4 \times 2/3 { d8[ e f] } g4 \times 2/3 { a8[ b c] } | d1\time 4/4
\times 4/5 { c8[ d e f g] } \times 4/5 { a[ b c d e] } | f1Use : followed by the tremolo division:
\time 4/4
c2:16 d:16 | e1:32Use \repeat tremolo:
\time 4/4
\repeat tremolo 4 { c16 e } \repeat tremolo 4 { d f } | <c e g>1\\Use \\ to separate voices on the same staff:
\time 4/4 \stemUp c'2 d \\
\stemDown g2 a | % 1
\stemUp e'2 f \\
\stemDown b2 c | % 2\time 4/4 \stemUp e'4 d c b \\
\stemDown c4 g a e | % 1
\stemUp c'2 b \\
\stemDown f2 g | % 2
\stemUp c'1 \\
\stemDown c1 | % 3| Command | Effect |
|---|---|
\stemUp |
Force stems up |
\stemDown |
Force stems down |
\staff "N"\time 4/4
\staff "1" \clef "treble" c'4 e g c \\
\staff "2" \clef "bass" c4 g c g | % 1
\staff "1" d'4 f a d \\
\staff "2" d4 a d a | % 2\\\ (triple backslash)Use \\\ to separate different staves/parts:
\staff "1" \time 4/4 \clef "treble" c'4 d e f \\
\staff "2" \clef "treble" r4 g' r g \\\
\clef "bass" <c, g' c>1 ~ | % 1
\staff "1" g'1 \\
\staff "2" r4 c r c \\\
<c, g' c>1 | % 2\tempo "Allegro" 4=120
\time 4/4
c4 d e f | g a b c\tempo "Andante" 4=72
\time 3/4
c4 e g | c2.\time 4/4
c''4 d e f | \ottava #1 g a b c | b a g f | \ottava #0 e d c2\time 4/4
c4\sustainOn e g c\sustainOff | d\sustainOn fs a d\sustainOff |Use \markup "text" to add text annotations to your score. Control placement with ^ (above) or _ (below):
\time 4/4
c'4 \markup "dolce" d e f | g a b c\time 4/4
c'4^\markup "espressivo" d e f | g_\markup "cantabile" a b cMarkup is useful for expressive indications, technique instructions, or any text that doesn’t fit standard dynamic or tempo markings.
Put metadata at the top of a snippet. This works well in Markdown collections (handouts, chapters, indexes).
[title "Minuet in G"]
[subtitle "BWV-114"]
[composer "J.S. Bach"]
\key g \major \time 3/4 \clef "treble" \stemDown d'4(\p \stemUp g,8[ a b c] | \stemDown d4) \stemUp g, g[title "Twinkle Twinkle"]
\time 4/4
c4 c g' g | a a g2 | f4 f e e | d d c2 | g'4 g f f | e e d2 | g4 g f f | e e d2 | c4 c g' g | a a g2 | f4 f e e | d d c2 \bar "|."[title "Simple Waltz"]
\key g \major
\time 3/4
\stemUp d'4 g b \\ \stemDown <g b>4 <g b> <g b> |
\stemUp d'4 a c' \\ \stemDown <fs a>4 <fs a> <fs a> |
\stemUp d'4 g b \\ \stemDown <g b>4 <g b> <g b> |
\stemUp d'2. \\ \stemDown <g b d'>2.[title "Expressive Melody"]
\time 4/4
c4\p( d e f) | g2\< a | b4\mf\> a g f | e2\p d | c4\pp( e g c) | c2.\fermata r4Expressive etude in E Major with complex texture.
[title "Etude in E Major (excerpt)"]
[subtitle "Tristesse"]
[composer "Chopin"]
\staff "1" \key e \major \time 2/4 \clef "treble" \stemUp b8\p \\
\staff "2" \clef "bass" g8\rest | %1
\staff "1" \clef "treble" \stemUp e8[ ds16 e] fs4~ \\
\staff "1" \clef "treble" s4 \stemDown ds~ \\
\staff "2" \stemUp \clef "bass" e,,4 b \\
\staff "2" \stemDown \clef "bass" e,,16[ b'8 b16] b,[ b'8 b16] \\
\staff "2" \stemUp \clef "bass" gs16[ b gs b] a[ b a b] | %2
\staff "1" \clef "treble" \stemUp fs16([ gs] gs[ fs)] gs4~ \\
\staff "1" \clef "treble" \stemDown ds8[ ds] e4 \\
\staff "2" \clef "bass" \stemUp b,,4 e \\
\staff "2" \clef "bass" \stemDown b,,16[ b'8 b16] e,[ b'8 b16] \\
\staff "2" \clef "bass" \stemUp a16[ b a b] gs[ b gs b] | %3
\staff "1" \clef "treble" \stemUp gs'16([ a] a[ gs)] cs8.([ b16] \\
\staff "1" \clef "treble" \stemDown gs16[ e' b e] ds[ a' b, ds] \\
\staff "2" \clef "bass" \stemDown e,,16[ b'8 b16] b,[ b'8 b16] \\
\staff "2" \clef "bass" \stemUp e,,4 b | %4
\staff "1" \clef "treble" \stemUp a'16[ gs ds e)] fs4~ \\
\staff "1" \clef "treble" \stemDown b16[ e gs, b] \stemUp <a cs>[ <b ds> <a cs> <b ds>] \\
\staff "2" \clef "bass" \stemDown e,,16[ b'8 b16] b,[ b'8 b16] \\
\staff "2" \clef "bass" \stemUp e,,4 b | %5
\staff "1" \clef "treble" \stemUp fs16([ gs] gs[ fs)] e4 \\
\staff "2" \clef "bass" \stemUp b,,4 e \\
\staff "2" \clef "bass" \stemDown b,,16[ b'8 b16] e,[ b'8 b16] \\
\staff "2" \clef "bass" \stemUp <a cs>16[ <b ds>] <a cs>[ <b ds>] gs[ b gs b] | %6
\staff "1" \clef "treble" \stemUp gs'16([ a fs gs] a[ b gs a)] \\
\staff "1" \stemDown \clef "treble" d16[ e d e] cs[ e cs e] \\
\staff "2" \clef "bass" \stemDown e,,16[ e'8 e16] a,[ e'8 e16] \\
\staff "2" \clef "bass" \stemUp e,,4 a | %7
\staff "1" \clef "treble" \stemUp cs'8 fs,4 \stemUp \grace as8( \stemUp gs16)([ fs)]~ \\
\staff "1" \clef "treble" \stemDown cs16[ e cs e] b[ e b e] \\
\staff "2" \clef "bass" \stemDown a,16[ fs'8 fs16] b,[ fs'8 fs16] \\
\staff "2" \clef "bass" \stemUp a,4 b | %8Complex contrapuntal writing with three independent voices.
[title "Sinfonia No.1 C Major (excerpt)"]
[arranger "BWV787"]
\staff "1" \key c \major \time 4/4 \clef "treble" g'16\rest \stemUp g([ a b] \stemDown c[ d e f] g[ f g a] f[ a g f] \\
\staff "2" \clef "bass" \stemUp c,4 d8 \stemDown c'( b[ g] a[ b] | %1
\staff "1" \stemUp \clef "treble" e'2)~ e4 fs( \\
\staff "1" \clef "treble" g'16 \stemUp c,[ d e] f[ \stemDown g a b] c[ b c d] c[ e d c] \\
\staff "2" \clef "bass" \stemDown c4)( c8\rest b a[ g] a)[ d,(] | %2
\staff "1" \clef "treble" \stemUp g''8[ f] e4 d8[ e16 f] d4~ \\
\staff "1" \clef "treble" \stemDown b'8([ d]~ d[ c]~ c4 b~ \\
\staff "2" \clef "bass" \stemDown g,16)[ g'( a b] \clef "treble" \stemUp c[ d e f] g[ f g a] f[ a g f] | %3
\staff "1" \clef "treble" \stemUp d'8\f[ g16 f] e4)~ e8[ e] d4~ \\
\staff "1" \clef "treble" \stemDown b'4) g16 d'([ c b] a4.) a8( \\
\staff "2" \clef "treble" \stemUp e16)[ f( e d] \clef "bass" \stemDown c[ b a g] f[ g f e] f[ d e f] | %4[title "Syncopated"]
\time 4/4
c4. d8~ d4 e | f8 g4 a8~ a4 b | c8\< d4 e8 f4 g | a\ff\> g8 f~ f4\p r\time, \key, \clef so the fragment is portable in Markdown.c4) and omit repeated numbers to keep lines readable.'/, for intentional wide leaps.s: in multi-voice examples, place invisible rests to lock rhythm before adding details.This tutorial covers Lilylet’s core notation features. For rarer engraving cases and deeper notation concepts, the corresponding sections of the LilyPond documentation are often helpful, since Lilylet follows similar command conventions.