Product SiteDocumentation Site

12.5. LilyPond Basics

The syntax of LilyPond files offers the most flexibility through the most diverse musical conditions. Over time, you will realize that features which seem too complex at first are really a very powerful and simple way to solve complex problems that commercial programs cannot.

12.5.1. Letters Are Pitches

One letter signifies a note in a LilyPond source file. Use other letters, numbers, and symbols to change the duration, articulation, and other properties.
We recommend the default way to indicate a "sharp" or "flat" note: add "is" to sharp a note, or add "es" to flat a note. This command means "b-flat, b, b-sharp": bes b bis.
Show a double-sharp or double-flat with "isis" or "eses." This command means "b-double-flat, b, b-double-sharp": beses b bisis.
"Is" and "es" are the Dutch names for "sharp" and "flat." LilyPond can read English names: bflat b bsharp. We recommend you use Dutch names because they are faster.
Pitch can be entered either absolutely, or relative to the preceding notes. Usually (for music without frequent large leaps) it is more convenient to use the "relative" mode. The symbols , and ' (comma and apostrophe) are used to indicate register.
When entering absolute pitches, the register is indicated mostly as in the Helmholtz system (see Helmholtz Pitch Notation (Wikipedia) at http://en.wikipedia.org/wiki/Helmholtz_pitch_notation: octaves begin on the pitch "C," and end eleven tones higher on the pitch "B." The octave below "middle C" (octave 3 in scientific pitch notation - see Scientific Pitch Notation (Wikipedia) at http://en.wikipedia.org/wiki/Scientific_pitch_notation Scientific Pitch Notation) has no commas or apostrophes. The octave starting on "middle C" (octave 4) has one apostrophe; the octave above that (octave 5) has two apostrophes, and so on. Octave 2 (starting two octaves below "middle C") has one comma, the octave below that has two commas, and so on. It is usually not necessary to understand how to use this in LilyPond, or to be able to use it quickly, because most scores will use "relative mode."
When entering pitches relative to the previous one, the register is still indicated with commas or apostrophes, but usually none are needed. When using this input mode, the octave of each note is guessed based on the octave of the previous note. Think of it this way: the next note will always be placed so it produces the smaller interval. For example, after a C, an E could be placed as a major third, a minor sixth, a major tenth, a minor thirteenth, and so on. In relative mode, LilyPond will always choose the "major third" option. If you wanted LilyPond to notate the E so that it's a minor sixth, you would tell LilyPond with a comma appended: c e, so that LilyPond knows what you want. It's the same case if you were to input c aes (meaning "C then A-flat"): the A-flat will be notated so that it is a major third from the C; if you wanted LilyPond to notate it so that the A-flat is a minor sixth higher than the C, you would need to append an apostrophe: c aes'
The only possible ambiguity with this method is with a tritone. LilyPond solves this by not recognizing "tritones," per se, and thinking of them as "augmented fourth" or "diminished fifth." Unless instructed otherwise (with a comma or apostrophe), LilyPond will always notate the interval as an augmented fourth.
You must always indicate a sharp or flat, even if it is already in a key signature. This ultimately helps to reduce the number of errors.
Letters used to indicate pitch are always in lower-case.