Lily# Reference — the .lys language

Reference

The Lily# language

A reference to the .lys language as Lily# 0.16.0 accepts it, in four pages. Every complete example on them is compiled when the site is built. New to it? Start with Get started and the lessons.

How to read this

This is a reference to the .lys language as Lily# 0.16.0 accepts it. Every example here is run through lysc check when the page is built — the build fails if one does not compile. Where a claim is about something subtle, the page says how it was measured.

Three ideas run through the whole language, and most surprises dissolve once you have them:

  • Music lives inside a part. A file is a set of declarations. A bare note at the top level is an error, and that is what lets a top-level key or time always mean “the file's default” with no ambiguity.
  • Order carries meaning; clauses do not. A score is a vertical stack of bands. A lyric row under a staff is that staff's verse because it is under it — not because a clause says so.
  • Anything that changes the playing order lives in the form. Repeats and endings are written there, never among the notes.

There is one canonical way to write each idea. Where the language could have been clever it is usually explicit instead.

Writing music

Notes, rhythm, marks, keys and meters — what goes inside the braces.

A file at a glance · Lexical rules · Pitches and octaves · Durations · Notes, rests, chords · Ties, slurs, beams · Annotations · Tuplets, grace notes, voices, cues · Barlines and breaks · Keys and accidentals · Time signatures and pickups · Tempo · Clefs and register · Dynamics and hairpins

Structure

How a piece is put together: who plays, in which sections, in what order.

Parts · Phrases · Sections · Lyrics · Chords and chord rows · Forms — the playing order · Using other files

Output

What is printed: scores and their staves, the page, the faces, the switches.

Scores · Tablature · Paper and fonts · Layout — display switches · Override / revert

Look-up

Reserved words, what the diagnostics say, and the way from LilyPond.

Reserved words · Diagnostics · Coming from LilyPond · Rough edges

Chords and chord diagrams

Chord names, guitar and ukulele diagrams, and chords written from a shape — step by step.

Writing chords

Chords as notes: angle brackets, degrees, completion, names from the notes, broken chords, and what a guitar or a bowed string can hold.