DOKK Library

LilyPond - Music Typesetting Cheatsheet 2.14

Authors R. Kainhofer

License CC-BY-NC-3.0

Plaintext
                                                             LilyPond - Music Typesetting
                                                                    Basic usage - LilyPond Version 2.14 and above
                                                                Cheatsheet by R. Kainhofer, Edition Kainhofer, http://www.edition-kainhofer.com/

Command-line usage                                                                                                                  General Syntax

lilypond [-l LOGLEVEL] [-dSCMOPTIONS] [-o OUTPUT] [-V] FILE.ly [FILE2.ly]                                                           \xxxx                    function or variable
                                                                                                                                    { ... }                  Code grouping
Common options:                                                                                                                     var = {...}              Variable assignment
 --pdf, --png, --ps Output file format                                           -dpreview              Cropped “preview” image     \version "2.14.0"        LilyPond version
 -dbackend=eps Use different backend                                             -dlog-file=FILE        Create .log file            % dots                   Comment
 -l LOGLEVEL ERR/WARN/PROG/DEBUG                                                 -dno-point-and-click   No Point & Click info       %{ ... %}                Block comment
 -o OUTDIR          Name of output dir/file                                      -djob-count=NR         Process files in parallel   c\...                    Postfix-notation (notes)
 -V                 Verbose output                                               -dpixmap-format=pngalpha       Transparent PNG     #'(..), ##t, #'sym       Scheme list, true, symb.
 -dhelp             Help on options                                              -dno-delete-intermediate-files Keep .ps files      x-.., x^.., x_..         Directions


Basic Notation                                                                                                                      Creating Staves, Voices and Groups

                                                        c d e f g a b                      Note names (Dutch)                      \version "2.15.0"
                                                                                                                                    SMusic = \relative c'' { c1\p }
                                                                                        Alterations: -is/-es for sharp/flat,
         
                                                                                                                                    SLyrics = \lyricmode { Oh! }
                                                         cis bes as cisis beses b b! b? -isis/-eses for double, ! forces,           AMusic = \relative c' { e1 }
                                                                                        ? shows cautionary accidental
                                                        \relative c' {c f d' c,}
                                                                                            Relative mode (change less than a       \score {
                                                                                            fifth), raise/lower one octave            \new ChoirStaff <<
                                                                                                                                         \new Staff {
                                                 g1 g2 g4 g8 g16 g4. g4..
                                                                                            durations (1, 2, 4, 8, 16, ...);
                                                                                                                                           \new Voice = "Sop" {
                                                                                            append “.” for dotted note
                                                                                                                                             \dynamicUp \SMusic
                                                        g8 g8 g8[ g g] g8[ g16 g16]        Automatic and manual beaming                   }
                                                                                                                                         }
                                                  r2 r4 r4.. r16 s4 r4               rests:
                                                                                                     r (like a note name)
                                                                                                                                         \new Lyrics = "SLyrics"
                                                                                                     s for invisible rests
                                                                                                                                             \lyricsto "Sop" \SLyrics
                                                     \clef "treble" \clef "bass"                                                     \new Staff {
                                                                                        Clefs
                                          8              \clef "tenor" \clef "treble_8"                                                    \new Voice = "Alto" {
                               3            83
                                                         \time 4/4 \time 2/2                                                                 \dynamicUp \AMusic
                                 4                       \time 3/4 \time 3/8
                                                                                        Time signature
                                                                                                                                           }
                                              
                                                 \key c \minor \key b \dorian
                                                                                        Key
                                                                                                                                         }
                                                                                                                                      >>
                                                         \key c \major                                                                         p
                                                                                                                                   }
                                                                                                                                             
                                                    <c e g>4 <f c'> q2                 Chords, repeated chord
                                                                                                                                                Oh!
                                                                                                                                           
                                                        c4~ c c2~ c4 <c a f>~ c            Tie                                            
                                                        c( a) c\( b( a) g f\)              Slur / Phrasing slur
                                                                                                                                    Useful Contexts
                                                        g\p\< a b c\f\cresc d e\!          Dynamics, hairpins, text crescendo      Score                The whole score
   p        f cresc.                                                                                                                << ... >>            Staves in parallel
         Text
                                                 c4-> c-. c^| c^-_+ c\trill                                                 StaffGroup           Staffgroup with bracket
                                                        c\marcato c^"Text"
                                                                                            Articulations and text markup           GrandStaff           Staffgroup with brace
                                                                                                                                    ChoirStaff           Staffgroup with bracket
                                                     \partial 8 c8 | c1 | c             Partial measure, bar line check,        PianoStaff
   
                                                                                                                                                         Staffgroup with brace
                                                         \bar"||" c \bar"|."                bar lines                               Staff
       3 3 4
                                                                                                                                                         One single staff
                                                                                            Full-/Multimeasure rests: R (with       Voice
               4                                        R1 | R1*3 | \time 3/4 R2.*4                                                                     A voice inside a staff
                                                                                            exact duration)                         CueVoice             Smaller voice for cues
                        1.           2.
                                                         c1 \repeat volta 2 { d }                                                   Lyrics               Lyrics inside staff/voice
                                    
                                                                                            Repeats (with alternative endings;
                                                       \alternative {{e} {f}} g           can be left out)                        ChordNames           Chords (lead sheet)
                                                                                                                                    Devnull              No output
      Adagio ( = 60)                      A          X   \tempo "Adagio" 4=60 c1 c c                                                Also: Dynamics, FiguredBass, Tab(Staff|Voice),
                                                        \mark \default c \mark "X"
                                                                                            Tempo indications, text marks
                                                                                                                                    Drum(Staff|Voice), RhythmicStaff, FretBoards, ...
                                   
                                                        \grace d8 c4\appoggiatura d8
                                                                                            Grace notes
                                                         c4\acciaccatura d8 c4
                                                        \times 2/3 {c8 d e}
                                                                                            Triplet, tuplets
           3                     5                       \times 4/5 {c d e d c}
                                                    <<{a2 c4 a}\\{f4 g4 f2>>           Parallel music


Adding Lyrics                                                                     Writing text and markup                           Links

<<                                                                                                                                  LilyPond Homepage:
                                                                                   \markup {
  \new Voice = "m" {                                                                \justify {                                          http://www.lilypond.org/
    c4 c8[( b]) a8[( b]) | c4 c4~ c4 |                                                A \underline justified \bold paragraph,       LilyPond Snippet Repository (LSR):
                                                                                      \fontsize #-2 automatically line-broken.
  }                                                                                   Some symbols: \dynamic ff \eyeglasses             http://lsr.dsi.unimi.it/
  \new Lyrics \lyricsto "m" {                                                         \rounded-box text, \with-color #red Text      User Mailing list:
    Sim -- ple e -- xam -- ple __                                                   }                                                   lilypond-user@gnu.org
  }                                                                                }      A justified paragraph, automatically
>>                                                                                       line-broken. Some symbols:   ff
                                                                                          text, Text                                Cheatsheet by R. Kainhofer, License:
                                 Sim ple e                xam ple
                                                                                                                                    Creative Commons Attribution-NonCommercial 3.0