Next: , Previous: Editor support, Up: Running LilyPond


5.8 File structure

The major part of this manual is concerned with entering various forms of music in LilyPond. However, many music expressions are not valid input on their own, for example, a .ly file containing only a note

c'4

will result in a parsing error. Instead, music should be inside other expressions, which may be put in a file by themselves. Such expressions are called toplevel expressions. This section enumerates them all.

A .ly file contains any number of toplevel expressions, where a toplevel expression is one of the following

The following example shows three things that may be entered at toplevel

\layout {
  % movements are non-justified by default
  raggedright = ##t
}

\header {
   title = "Do-re-mi"
}

{ c'4 d' e2 }

At any point in a file, any of the following lexical instructions can be entered:

This page is for LilyPond-2.6.3 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.

Other languages: English.
Using automatic language selection.