[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1 Single staff notation

This section introduces common notation that is used for one voice on one staff.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.1 Bar lines and bar checks


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Bar lines

Single bar lines are automatically placed in the music so there is no need to add them manually. Other types of bar lines are added using \bar, for example \bar "||" for a double bar line, or \bar "|." for an ending bar line. For a full list of bar lines see the (notation)Bar lines section ‘Bar lines’ in Notation Reference.

 
\relative { g'1 e1 \bar "||" c2. c'4 \bar "|." }

[image of music]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Bar checks

Though not strictly necessary, bar checks should be used in the input code to show where bar lines are expected to fall. They are entered using the bar symbol, |. With bar checks, the program can verify that you’ve entered durations that make each measure add up to the correct length. Bar checks also make your input code easier to read, since they help to keep things organized.

 
\relative {
  g'1 | e1 | c2. c' | g4 c g e | c4 r r2 |
}

[image of music]

If you compile the code in the example above, you should see a warning in the console output:

 
warning: barcheck failed at: 1/2
 g'1 | e1 | c2. c'
                   | g4 c g e | c4 r r2 |

Although the missing duration is clear in the musical output in this simple example, the warning in the console output is far more effective in drawing attention to the missing 4 in bar 3.

See also

Notation Reference: (notation)Bar and bar number checks section ‘Bar and bar number checks’ in Notation Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.2 Pitches and key signatures

Note: New users often misunderstand how LilyPond uses the key signature – please read the warning at the bottom of this page.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Pitch alterations

Music Glossary: (music-glossary)sharp section ‘sharp’ in Music Glossary, (music-glossary)flat section ‘flat’ in Music Glossary, (music-glossary)double sharp section ‘double sharp’ in Music Glossary, (music-glossary)double flat section ‘double flat’ in Music Glossary, (music-glossary)accidental section ‘accidental’ in Music Glossary.

Note-names in LilyPond identify pitches. For example, c always means C-natural, regardless of the key signature.

In many languages, a note name consists of a base name refering to the diatonic steps of the C major / a minor scale, e.g. d, and a suffix, which indicates alteration of this base pitch. The default input language for note names is nederlands (Dutch). A sharp pitch is made by adding is to the name, and a flat pitch by adding es. As you might expect, a double sharp or double flat is made by adding isis or eses. This syntax is derived from note naming conventions in Nordic and Germanic languages, like German and Dutch. To use other naming schemes for note names, see (notation)Note names in other languages section ‘Note names in other languages’ in Notation Reference.

 
\relative { cis''4 ees fisis, aeses }

[image of music]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Key signatures

Music Glossary: (music-glossary)key signature section ‘key signature’ in Music Glossary, (music-glossary)major section ‘major’ in Music Glossary, (music-glossary)minor section ‘minor’ in Music Glossary.

The key signature is set with the command \key followed by a pitch and \major or \minor.

 
\relative {
  \key d \major
  d'4 fis a c |
  \bar "||" \key c \minor
  c,4 ees g b |
}

[image of music]



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Warning: key signatures and pitches

Music Glossary: (music-glossary)accidental section ‘accidental’ in Music Glossary, (music-glossary)key signature section ‘key signature’ in Music Glossary, (music-glossary)pitch section ‘pitch’ in Music Glossary, (music-glossary)flat section ‘flat’ in Music Glossary, (music-glossary)natural section ‘natural’ in Music Glossary, (music-glossary)sharp section ‘sharp’ in Music Glossary, (music-glossary)transposition section ‘transposition’ in Music Glossary, (music-glossary)Pitch names section ‘Pitch names’ in Music Glossary.

LilyPond makes a distinction between musical content and its printed representation. Input such as d4 e fis2 defines the pitches and durations of notes, which is musical content. The key signature is part of the printed representation. The key signature also sets rules for the printed representations of notes. LilyPond compares each input pitch to the key signature to determine whether to print an accidental.

The command \key sets the key signature, which affects the printed representation, but does not change the pitch assigned to a note such as c in the input.

In this example:

 
\relative {
  \key d \major
  cis''4 d e fis
}

[image of music]

No note has a printed accidental, but you must still add is and type cis and fis in the input file.

The code b does not mean “print a black dot just on the middle line of the staff.” Rather, it means “there is a note with pitch B-natural.” In the key of A-flat major, it does get an accidental:

 
\relative {
  \key aes \major
  aes'4 c b c
}

[image of music]

Whenever you enter a pitch that is a black key on the piano, you must add -is or -es to the note name.

Adding all alterations explicitly might require a little more effort when typing, but the advantage is that transposing is easier, and accidentals can be printed according to different conventions. For some examples of how accidentals can be printed according to different rules, see (notation)Automatic accidentals section ‘Automatic accidentals’ in Notation Reference.

See also

Notation Reference: (notation)Note names in other languages section ‘Note names in other languages’ in Notation Reference, (notation)Accidentals section ‘Accidentals’ in Notation Reference, (notation)Automatic accidentals section ‘Automatic accidentals’ in Notation Reference, (notation)Key signature section ‘Key signature’ in Notation Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.3 Ties and slurs


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Ties

Music Glossary: (music-glossary)tie section ‘tie’ in Music Glossary.

A tie is created by appending a tilde ~ to the first of the two notes being tied.

 
\relative { g'4~ g c2~ | c4~ c8 a~ a2 | }

[image of music]

When the pitch does not change, as is always the case with tied notes, subsequent pitches may be omitted, specifying just the bare duration:

 
\relative { g'4~ 4 c2~ | 4~ 8 a~ 2 | }

[image of music]

This shorthand may be useful in other places where the rhythm changes with an unchanging pitch, but remember that a bare pitch followed by a space and a bare duration will be interpreted as a single note. In other words, c4 a 8 8 would be interpreted as c4 a8 a8, not as c4 a4 a8 a8. Write instead c4 a4 8 8 .


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Slurs

Music Glossary: (music-glossary)slur section ‘slur’ in Music Glossary.

A slur is a curve drawn across many notes. The starting note and ending note are marked with ( and ) respectively. Note that the ( comes after the first note of the slur.

 
\relative { d''4( c16) cis( d e c cis d) e( d4) }

[image of music]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Phrasing slurs

Music Glossary: (music-glossary)slur section ‘slur’ in Music Glossary, (music-glossary)phrasing section ‘phrasing’ in Music Glossary.

Slurs to indicate longer phrasing can be entered with \( and \). You can have both slurs and phrasing slurs at the same time.

 
\relative { g'4\( g8( a) b( c) b4\) }

[image of music]



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Warnings: slurs vs. ties

Music Glossary: (music-glossary)articulation section ‘articulation’ in Music Glossary, (music-glossary)slur section ‘slur’ in Music Glossary, (music-glossary)tie section ‘tie’ in Music Glossary.

A slur looks like a tie, but it has a different meaning. A tie simply makes the first note longer, and can only be used on pairs of notes with the same pitch. Slurs indicate the articulation of notes, and can be used on larger groups of notes. Slurs and ties can be nested.

 
\relative { c''4(~ c8 d~ 4 e) }

[image of music]

See also

Notation Reference: (notation)Ties section ‘Ties’ in Notation Reference, (notation)Slurs section ‘Slurs’ in Notation Reference, (notation)Phrasing slurs section ‘Phrasing slurs’ in Notation Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.4 Articulations and dynamics

Articulations and dynamics are indicated by adding special codes after the notes to which they apply,


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Articulations

Music Glossary: (music-glossary)articulation section ‘articulation’ in Music Glossary.

Common articulations can be added to a note using a dash - and a single character:

 
\relative {
  c''4-^ c-+ c-- c-!
  c4-> c-. c2-_
}

[image of music]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Fingerings

Music Glossary: (music-glossary)fingering section ‘fingering’ in Music Glossary.

Similarly, fingering indications can be added to a note using a dash (-) and the digit to be printed:

 
\relative { c''4-3 e-5 b-2 a-1 }

[image of music]

Articulations and fingerings are usually placed automatically, but you can specify a direction by replacing the dash (-) with ^ (up) or _ (down). You can also use multiple articulations on the same note. However, in most cases it is best to let LilyPond determine the articulation directions.

 
\relative { c''4_-^1 d^. f^4_2-> e^-_+ }

[image of music]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Dynamics

Music Glossary: (music-glossary)dynamics section ‘dynamics’ in Music Glossary, (music-glossary)crescendo section ‘crescendo’ in Music Glossary, (music-glossary)decrescendo section ‘decrescendo’ in Music Glossary.

Dynamic signs are made by adding the markings (with a backslash) to the note:

 
\relative { c''4\ff c\mf c\p c\pp }

[image of music]

Crescendi and decrescendi are started with the commands \< and \>. The next dynamics sign, for example \f, will end the (de)crescendo, or the command \! can be used:

 
\relative { c''4\< c\ff\> c c\! }

[image of music]

See also

Notation Reference: (notation)Articulations and ornamentations section ‘Articulations and ornamentations’ in Notation Reference, (notation)Fingering instructions section ‘Fingering instructions’ in Notation Reference, (notation)Dynamics section ‘Dynamics’ in Notation Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.5 Adding text

Text may be added to your scores:

 
c''2^"espr" a'_"legato"

[image of music]

Extra formatting may be added with the \markup command:

 
c''2^\markup { \bold espr }
a'2_\markup {
  \dynamic f \italic \small { 2nd } \hspace #0.1 \dynamic p
}

[image of music]

See also

Notation Reference: (notation)Writing text section ‘Writing text’ in Notation Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.6 Automatic and manual beams

Music Glossary: (music-glossary)beam section ‘beam’ in Music Glossary.

All beams are drawn automatically:

 
\relative { a'8 ais d ees r d c16 b a8 }

[image of music]

If you do not like the automatic beams, they may be overridden manually. To correct just an occasional beam mark the first note to be beamed with [ and the last one with ]. Note that [ comes after the first beamed note.

 
\relative { a'8[ ais] d[ ees r d] c16 b a8 }

[image of music]

If you want to turn off automatic beaming entirely or for an extended section of music, use the command \autoBeamOff to turn off automatic beaming and \autoBeamOn to turn it on again.

 
\relative {
  \autoBeamOff
  a'8 c b4 d8. c16 b4 |
  \autoBeamOn
  a8 c b4 d8. c16 b4 |
}

[image of music]

See also

Notation Reference: (notation)Automatic beams section ‘Automatic beams’ in Notation Reference, (notation)Manual beams section ‘Manual beams’ in Notation Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.7 Advanced rhythmic commands


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Partial measure

Music Glossary: (music-glossary)anacrusis section ‘anacrusis’ in Music Glossary.

A pickup (or anacrusis) is entered with the keyword \partial. It is followed by a duration: \partial 4 is a quarter note pickup and \partial 8 an eighth note.

 
\relative {
  \partial 8 f''8 |
  c2 d |
}

[image of music]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Tuplets

Music Glossary: (music-glossary)note value section ‘note value’ in Music Glossary, (music-glossary)triplet section ‘triplet’ in Music Glossary.

Tuplets are made with the \tuplet keyword. It takes two arguments: a fraction and a piece of music. The fraction is the number of tuplet notes over the number of notes normally filling the same duration. For triplets, there are three notes instead of two, so triplets have 3/2 as their fraction.

 
\relative {
  \tuplet 3/2 { f''8 g a }
  \tuplet 3/2 { c8 r c }
  \tuplet 3/2 { f,8 g16[ a g a] }
  \tuplet 3/2 { d4 a8 }
}

[image of music]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Grace notes

Music Glossary: (music-glossary)grace notes section ‘grace notes’ in Music Glossary, (music-glossary)acciaccatura section ‘acciaccatura’ in Music Glossary, (music-glossary)appoggiatura section ‘appoggiatura’ in Music Glossary.

Grace notes are created with the \grace command, although they can also be created by prefixing a music expression with the keyword \appoggiatura or \acciaccatura:

 
\relative {
  c''2 \grace { a32 b } c2 |
  c2 \appoggiatura b16 c2 |
  c2 \acciaccatura b16 c2 |
}

[image of music]

See also

Notation Reference: (notation)Grace notes section ‘Grace notes’ in Notation Reference, (notation)Tuplets section ‘Tuplets’ in Notation Reference, (notation)Upbeats section ‘Upbeats’ in Notation Reference.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by gub on July 13, 2020 using texi2html 1.82.

Outros idiomas: català, česky, deutsch, español, français, magyar, italiano, 日本語, nederlands.
Sobre seleção automática de idioma.