Product SiteDocumentation Site

12.4.6. Commands

There are a wide variety of commands available in LilyPond, some of them quite simple, and other quite complex. They all begin with a backslash, followed by the name of the command, and subsequent "arguments" that give the command further information about what you want it to do. Just like using a letter to indicate a note, commands are simply another way for you to tell LilyPond how you want your score to be rendered.
For example, \time 2/4 and \clef bass are two commands that you are likely to use quite often. They happen to do precisely what it seems like they should: \time changes the time signature and metre, and \clef changes the clef. they belong to differen contexts (\time applies for the whole Score, but \clef for only one Staff).
It can take some time to remember even these basic commands and the way you should format their input, and this is where Frescobaldi's built-in documentation viewer can help out. All of the official LilyPond documentation is made available in Frescobaldi, which makes it easy for you to view the documentation and make changes to your score in the same window of the same application. Customization

It is rarely necessary to customize the output in a way that is very specific, and not allowed for in the standard LilyPond syntax. As a beginner, this can happen quite often when you are trying to exactly emulate the look of a pre-existing score. Remember that LilyPond provides a content-focussed way to express music, and that it will usually produce meaningful output without advanced interference. If in doubt about whether a customization is really necessary, ask yourself this: will it change the music that is played from the score?
If you really must customize some setting, then keep in mind these two points:
  1. Tinkering with LilyPond can become as complex as you want.
  2. Ultimately all tinkering takes the form of commands.
Searching the internet for LilyPond tips and tricks can be a life-saver, but it can also lead to needlessly complex solutions. Sometimes this is the result of poor solutions being posted on the internet, but more often it is the result of the ongoing development of LilyPond, which makes better solutions available regularly. For this reason, it is recommended to search the official LilyPond documentation first, then the "LilyPond Snippet Repository" (LSR - link here), and then Google.