Lilypond: Glossario

                   

Glossario: termini, funzioni e come fare per ...

nome delle note
Lilypond, essendo un programma nato in Olanda, conosce i nomi delle note, accordi ed accidenti in olandese
per fargli trattare i nomi in italiano:
\language "italiano"   oppure   \include "italiano.ly"
abbellimenti
        \language "italiano"
        {   la'4 sol' \grace { fa'16 mi'16 } re'4
            do'4\staccato do'\mordent si'2\turn do'1\fermata
        }
        

[image of music]

accordo minore
viene indicato: do:m - viene riprodotto: Do m
per modificare, inserire nella stile: \set minorChordModifier = \markup { "-" } ed eventualmente: chordPrefixSpacer
Ambitus - Ambito estensione in altezza della voce
L’ambitus viene indicato all’inizio del brano, prima della chiave iniziale. L’intervallo è individuato graficamente da due teste di nota che rappresentano l’altezza più bassa e più alta.
Le alterazioni sono mostrate solo se non fanno parte dell’armatura di chiave.
\layout { \context { \Voice \consists "Ambitus_engraver" } }
            \relative c'' {  aes c e2    cis,1 }
            

L’ambitus può essere specificato per voce. In tal caso occorre spostarlo manualmente per evitare collisioni.
        \new Staff <<
          \new Voice \with  { \consists "Ambitus_engraver" }
                \relative c'' { \override Ambitus.X-offset = #2.0 \voiceOne     c4 a d e    f1   }
          \new Voice \with  { \consists "Ambitus_engraver" }
                \relative c'  { \voiceTwo es4 f g as    b1   }
        >>
        
Se si aggiunge l’incisore Ambitus_engraver al contesto Staff viene creato un solo ambitus per il rigo, anche nel caso di righi che hanno più voci.
\new Staff \with {
          \consists "Ambitus_engraver"
          }
        <<
          \new Voice \relative c'' {
            \voiceOne
            c4 a d e
            f1
          }
          \new Voice \relative c' {
            \voiceTwo
            es4 f g as
            b1
          }
        >>

È possibile cambiare le impostazioni predefinite dell’intervallo tra le teste di nota dell’ambitus e la linea che le collega.
\layout {
      \context {
        \Voice
        \consists "Ambitus_engraver"
      }
    }
    \new Staff { \time 2/4
      % Default setting
      c'4 g''
    }
    \new Staff { \time 2/4
      \override AmbitusLine.gap = #0
      c'4 g''
    }
    \new Staff { \time 2/4
      \override AmbitusLine.gap = #1
      c'4 g''
    }
    \new Staff { \time 2/4
      \override AmbitusLine.gap = #1.5
      c'4 g''
    }
    
bar - stanghetta
delimita la misura o battuta. Viene messa automaticamente o con | tra le note o con il comando \bar:
\relative {
  f'1 \bar "|"
  f1 \bar "."
  g1 \bar "||"
  a1 \bar ".|"
  b1 \bar ".."
  c1 \bar "|.|"
  d1 \bar "|."
  e1

  f,1 \bar ";"
  g1 \bar "!"
  a1

  f1 \bar ".|:"
  g1 \bar ":..:"
  a1 \bar ":|.|:"
  b1 \bar ":|.:"
  c1 \bar ":.|.:"
  d1 \bar "[|:"
  e1 \bar ":|][|:"
  f1 \bar ":|]"
  g1 \bar ":|."
  a1
battute: numerare
per scrivere su ogni battuta:
\override Score.BarNumber.break-visibility = ##(#f #t #t)
per impostare il numero iniziale:
\set Score.currentBarNumber = #51
battute: ripetere
{ \relative c'' { \repeat unfold 3 {  c4 c c c  } } }

[image of music]

beam coda della nota
1 per croma ...
\autoBeamOff disabilita la travatura automatica) - \autoBeamOn riabilita travatura automatica
{ \time 2/4 { \relative c'' {
                 c4 c8 c16 c32 c64 c128 c128 |
    \autoBeamOff c4 c8 c16 c32 c64 c128 c128 |
    \autoBeamOn  c4 c8 c16 c32 c64 c128 c128 } } }

[image of music]

chitarra
\include "predefined-guitar-fretboards.ly"
           \new FretBoards { \accordi }
           
coda della nota beam
corona
\fermata
dopo la nota
dimensioni
nome del tipo di carattere altezza del rigo (pt) altezza del rigo (mm) uso
feta11 11.22 3.9 partiture tascabili
feta13 12.60 4.4
feta14 14.14 5.0
feta16 15.87 5.6
feta18 17.82 6.3 canzonieri
feta20 20 7.0 parti standard
feta23 22.45 7.9
feta26 25.2 8.9
gamba della nota stem
Intestazioni
\header { title = "Nannì"
        subtitle = "'Na gita a li Castelli"
        subsubtitle = "1928"
        poet = "parole: F. Silvestri"
        composer = "musica: F. Silvestri"
        tagline = "Lilypond vers 2.18.2"
        copyright = "www.cantoeprego.it -> impariamo -> canzoni" }
        

[image of music]

Intestazioni - data automatica
        % 1. definire una variable per stabilire il formato della data
        date = #(strftime "%d-%m-%Y" (localtime (current-time)))
        % 2. usarla nel blocco titolo
        \header {
          title = "Inserire la data!"
          subtitle = \date
        }   

[image of music]

legatura di valore
legatura di valore tie
{ c''2~ c''4 }

[image of music]

legatura di portamento
legatura di espressione slur
{ \relative c' { d4( c16) cis( d e c cis d) e( d4) } }

[image of music]

legatura di frase
{ \relative c' { a8(\( ais b c) cis2 b'2 a4 cis,\) } }

[image of music]

metronomo
(prima delle note)
\override Score.MetronomeMark #'padding = #3
note head testa della nota
testa della nota note head
\easyHeadsOn scrive il nome della nota dentro la nota
note stem gamba della nota
note beam coda della nota
tie legatura di valore
\easyHeadsOn scrive il nome della nota dentro la nota
\paper
16.3.2022
   \paper {
      print-page-number = ##f
      top-margin = 2\cm
      bottom-margin = 1\cm
      ragged-bottom = ##t
      ragged-last-bottom = ##t
      left-margin = 2\cm
      line-width = 17\cm
      interscoreline = 4\cm
  }
\paper {
   %paper-width = 2\cm
   %paper-height = 2\cm
   top-margin = 2\cm
   bottom-margin = 1\cm
   %heap-separation = 7\cm
   %foot-separation = 7\cm
   ragged-bottom = ##t
   ragged-last-bottom = ##t
   left-margin = 3\cm
   line-width = 15\cm
   %rigthmargin = 3\cm
   interscoreline = 4\cm
   %between-system-padding = #1
}

parentesi
in Lilypond vengono usate vari tipi di parentesi, aperta e chiusa, con vari significati
{ ... }
parentesi graffe
racchiude una espressione musicale
( ... )
parentedi tonde
indica una legatura di espressione. Le note indicate vengono legate alla nota precedente
< ... >
indica un accordo: le note saranno scritte sovrapposte
q ripete l'accordo precedente solo come note, non durata, ...
<< ... >>
Una o più espressioni musicali racchiuse tra due coppie di parentesi uncinate sono considerate simultanee. Se la prima espressione inizia con una nota singola o se l’intera espressione simultanea appare esplicitamente all’interno di una voce, sarà posta in un solo rigo; altrimenti gli elementi dell’espressione simultanea saranno messi in righi separati.
\new Voice {  % voce singola esplicita
              << { a4 b g2 } { d4 g c,2 } >>
            }

[image of music]

[ ... ]
parentesi quadre
partitura, spartito score
pentagramma, rigo (musicale) staff (plurale staves)
pentagramma: lunghezza
Le impostazioni più basilari per influire sullo spazio del pentagramma sono: indent e line-width (del blocco \layout.
They control the indentation of the first line of music, and the lengths of the lines. If ragged-right is set to true in the \layout block, then systems ends at their natural horizontal length, instead of being spread horizontally to fill the whole line. This is useful for short fragments, and for checking how tight the natural spacing is. The normal default setting is false, but if the score has only one system the default value is true. The option ragged-last is similar to ragged-right, but only affects the last line of the piece. No restrictions are put on that line. The result is similar to formatting text paragraphs. In a paragraph, the last line simply takes its natural horizontal length.
\layout {
          indent = #0
          line-width = #150
          ragged-last = ##t
        }
ripetere diverso
\include "italiano.ly" #(set-global-staff-size 17.82 )
    { \relative do' {
        \repeat volta 2 { sol'4 sol8 fa sol4 la  }
        \alternative {
            { re4 re do la | re2 re2  }
            { re4 re do si | do2 do2  }
        } \bar"|."
    } }
    

[image of music]

sistema - system
slur - legatura di espressione
\slurUp sopra
\slurDown sotto
\slurNeutral normale
scrivere sopra: cerchietto: Solo, Assemblea, Tutti
^\markup { \override #'(thickness . 2) { \circle "S" } }
dopo la nota
scrivere sotto: data
\markup { \italic \fontsize #-3 #(strftime "%d.%m.%Y" (localtime (current-time))) }
segna da...
{ \relative c'' { c \segno b a g } }

score - partitura, spartito
Strofe dopo la musica
melody = \relative c' {
e d c d | e e e e |
d d e d | c1 |
}

text = \lyricmode {
\set stanza = #"1." Ma- ry had a lit- tle lamb,
its fleece was white as snow.
}

\score{ <<
  \new Voice = "one" { \melody }
  \new Lyrics \lyricsto "one" \text
>>
  \layout { }
}
\markup { \column{
  \line{ Verse 2. }
  \line{ All the children laughed and played }
  \line{ To see a lamb at school. }
  }
}
\markup{
  \wordwrap-string #"
  Verse 3.

  Mary took it home again,

  It was against the rule."
}

[image of music]

staff pentagramma, rigo (musicale)(plurale staves)
stampare foglio musica bianco
#(set-global-staff-size 20)

\score {
  {
    \repeat unfold 12 { s1 \break }
  }
  \layout {
    indent = 0\in
    \context {
      \Staff
      \remove "Time_signature_engraver"
      \remove "Clef_engraver"
      \remove "Bar_engraver"
    }
    \context {
      \Score
      \remove "Bar_number_engraver"
    }
  }
}

\paper {
  #(set-paper-size "letter")
  ragged-last-bottom = ##f
  line-width = 7.5\in
  left-margin = 0.5\in
  bottom-margin = 0.25\in
  top-margin = 0.25\in
}
        
stem gamba della nota
di default la gamba della nota viene disegnata per rientrare dentro il rigo musicale:
do centrale ... si in giù; dal do alto ... in su
il si centrale può essere modificato:
\override Stem.neutral-direction = #up in su
\override Stem.neutral-direction = #down in giù
per seguire la melodia:
\layout {
    \context {
    \Voice
    \consists "Melody_engraver"
    \override Stem.neutral-direction = #'()
  }
}
system sistema
raccolta di uno o più staff
tempo
\time 2/4
\tempo "Allegro" 4 = 160
tempo - \time ritmo
\time 4/4 e \time 2/2 possono essere indicati con il numero o con segni propri
{ c'1
        \numericTimeSignature \time 4/4  c'
        \defaultTimeSignature \time 4/4   c'
        }

[image of music]

terzina
 \language "italiano"
        \times  2/3 { r8 sol'8 sol'8 }
\language "italiano"
         \tuplet 3/2 { r8 sol'8 sol'8  }
lilypond>
tie legatura di valore
la nota che deve essere legata va messa tra ( ... )
{ g'2 (g'4.) r8 }

[image of music]

in Lilypond rosso

\include "gregorian.ly"
#(set-global-staff-size 40)

music = {
  \repeat unfold 20 a
  % \augmentum
  b
  \repeat unfold 20 a
}
\new VaticanaStaff \music
\new Staff \music 
    \include "gregorian.ly"
puoi usare:
\divisioMinima
    \divisioMaior
    \divisioMaxima
    \finalis
    \virgula
    \caesura
    
    \clef "vaticana-do1"
    \clef "vaticana-do2"
    \clef "vaticana-do3"
    \clef "vaticana-fa1"
    \clef "vaticana-fa2"
  
\[ sol \flexa fa \]
\score { <<
    \new VaticanaVoice = "cantus" {
        \set Staff.midiInstrument = "church organ"
        \melodia }
        \include "gregorian.ly"
#(set-global-staff-size 40)
\score {
  \new VaticanaVoice {
    \override TextScript.font-family = #'typewriter
    \override TextScript.font-shape = #'upright
    \override Script.padding = #-0.1
    a\ictus_"ictus " \bar "" \break
    a\circulus_"circulus " \bar "" \break
    a\semicirculus_"semicirculus " \bar "" \break
    a\accentus_"accentus " \bar "" \break
    \[ a_"episema" \episemInitium \pes b \flexa a b \episemFinis \flexa a \]
  }
}

[image of music]

in Lilypond

modernGregorian

predisposizione

  1. da terminale, modificare i permessi della cartella
    cd ../../
    cd usr/share/lilypond/2.18.2
    sudo chmod 777 ly

  2. salvare con nome: "modernGregorian.ily", le istruzioni che seguono:
    %%%%% Defs to be saved as "modernGregorian.ily" %%%%%%%%%
    
    %%%% Defining new stem/ligatures:
    % long stem
    lst = #(define-music-function (parser location mus)
         (ly:music?)
       #{
         \stemDown
         \undo\omit Stem
         \once\override Stem.length = #7
         \once\override Stem.X-extent = #'(.1 . 0)
         \once\override NoteHead.stem-attachment = #'(1.5 . .1)
         $mus
         \omit Stem
       #})
    
    %long curved ligature
    #(define (long-curved-ligature grob)
       (if (ly:stencil? (ly:stem::print grob))
         (let* ((stencil (ly:stem::print grob))
                (X-ext (ly:stencil-extent stencil X))
                (Y-ext (ly:stencil-extent stencil Y))
                (width (interval-length X-ext))
                (len (interval-length Y-ext)))
           (ly:stencil-translate
             (grob-interpret-markup grob
               (markup
                 (#:path width
                   (list (list (quote moveto) -0.7 -0.65)
                       (list (quote curveto) -1.2 -0.4 -1.1 -0.2 -0.9 0.5)
                       (list (quote curveto) -0.9 0.5 -0.4 2 -0.8 2.2)))))
             (cons 0 (interval-start Y-ext))))
         #f))
    
    lli = #(define-music-function (parser location mus)
         (ly:music?)
            #{
              \stemUp
              \undo\omit Stem
              \override Stem.stencil = #long-curved-ligature
              $mus
              \omit Stem
            #})
    
    %medium curved ligature
    #(define (medium-curved-ligature grob)
       (if (ly:stencil? (ly:stem::print grob))
         (let* ((stencil (ly:stem::print grob))
                (X-ext (ly:stencil-extent stencil X))
                (Y-ext (ly:stencil-extent stencil Y))
                (width (interval-length X-ext))
                (len (interval-length Y-ext)))
           (ly:stencil-translate
             (grob-interpret-markup grob
               (markup
                 (#:path width
                   (list (list (quote moveto) -0.7 -0.65)
                       (list (quote curveto) -1.2 -0.4 -1.1 -0.2 -0.9 0.5)
                       (list (quote curveto) -0.9 0.5 -0.4 1.9 -1.4 1.8)))))
             (cons 0 (interval-start Y-ext))))
         #f))
    
    mli = #(define-music-function (parser location mus)
         (ly:music?)
            #{
              \stemUp
              \undo\omit Stem
              \override Stem.stencil = #medium-curved-ligature
              $mus
              \omit Stem
            #})
    
    %short curved ligature
    #(define (short-curved-ligature grob)
       (if (ly:stencil? (ly:stem::print grob))
         (let* ((stencil (ly:stem::print grob))
                (X-ext (ly:stencil-extent stencil X))
                (Y-ext (ly:stencil-extent stencil Y))
                (width (interval-length X-ext))
                (len (interval-length Y-ext)))
           (ly:stencil-translate
             (grob-interpret-markup grob
               (markup
                 (#:path width
                   (list (list (quote moveto) -0.7 -0.65)
                       (list (quote curveto) -1.2 -0.4 -1.1 -0.2 -1 0.4)
                       (list (quote curveto) -1 0.4 -0.8 1.5 -1.4 1.3)))))
             (cons 0 (interval-start Y-ext))))
         #f))
    
    sli = #(define-music-function (parser location mus)
         (ly:music?)
            #{
              \stemUp
              \undo\omit Stem
              \override Stem.stencil = #short-curved-ligature
              $mus
              \omit Stem
            #})
    
    %tiny curved ligature
    #(define (tiny-curved-ligature grob)
       (if (ly:stencil? (ly:stem::print grob))
         (let* ((stencil (ly:stem::print grob))
                (X-ext (ly:stencil-extent stencil X))
                (Y-ext (ly:stencil-extent stencil Y))
                (width (interval-length X-ext))
                (len (interval-length Y-ext)))
           (ly:stencil-translate
             (grob-interpret-markup grob
               (markup
                 (#:path width
                   (list (list (quote moveto) -0.7 -0.65)
                       (list (quote curveto) -1.2 -0.4 -1.1 -0.1 -1 0.2)
                       (list (quote curveto) -1 0.2 -0.8 0.7 -1.4 0.6)))))
             (cons 0 (interval-start Y-ext))))
         #f))
    
    tli = #(define-music-function (parser location mus)
         (ly:music?)
            #{
              \stemUp
              \undo\omit Stem
              \override Stem.stencil = #tiny-curved-ligature
              $mus
              \omit Stem
            #})
    
    %% Ornament function
    orn =
      -\tweak self-alignment-X #LEFT
      -\tweak Y-offset #0.5
      -\tweak X-offset #1
      -\tweak outside-staff-priority ##f
      -\markup
          \raise #-.3
          \scale #'(1 . .85)
          \rotate #90
          \musicglyph #"ties.lyric.short"
    
    %% Left aligning lyric :
    lal = \once\override LyricText.self-alignment-X = #LEFT
    
    %% horizontal inside staff spacer
    space =
    #(define-music-function
         (parser location anzahl)
         (number?)
       #{
         \grace { \repeat unfold #anzahl s }
       #})
    
    % Given some music that represents lyrics, add a prefix to the first
    % lyric event.
    % syntax is \versus { some lyrics }
    % resp. \responsum { some lyrics }
    #(define (add-prefix-to-lyrics prefix music)
       (let ((found? #f))
         (map-some-music
          (lambda (m)
            (if found? m
                (and (music-is-of-type? m 'lyric-event)
                     (begin
                       (set! (ly:music-property m 'text)
                             (string-append prefix (ly:music-property m 'text)))
                       (set! found? #t)
                       m))))
          music)))
    % Add unicode 2123 (versicle) as prefix to lyrics.
    versus =
    #(define-music-function (parser location music) (ly:music?)
       (add-prefix-to-lyrics "℣. " music))
    % Add unicode 211F (response) as prefix to lyrics.
    responsum =
    #(define-music-function (parser location music) (ly:music?)
       (add-prefix-to-lyrics "℟. " music))
    
    %% Defining notelaces (neume, melisma) and dedicated context:
    gregorianContext = {
      \cadenzaOn
      \omit Clef
      \omit TimeSignature
      \omit StaffSymbol
      \omit Rest
      \omit Flag
      \omit Beam
      \override SpacingSpanner.packed-spacing = ##t
      \override NoteHead.stencil =
        #(lambda (grob)
           (let ((pos (ly:grob-property grob 'staff-position)))
             (cond ((= pos -6)
                 (grob-interpret-markup grob
                   #{
                      \markup
                      \concat {
                        \with-dimensions #'(0 . 0) #'(0 . 0)
                        \translate-scaled #'(-.45 . 0)
                        \override #'(thickness . 2)
                        \draw-line #'(1.78 . 0)
                        \hspace #-.21
                        \musicglyph #"noteheads.s2"
                        \hspace #-.25
                      }
                   #}))
               ((= pos -7)
                   (grob-interpret-markup grob
                     #{
                        \markup
                        \concat {
                          \with-dimensions #'(0 . 0) #'(0 . 0)
                          \override #'(thickness . 2)
                          \translate-scaled #'(-.45 . .5)
                          \draw-line #'(1.78 . 0)
                          \hspace #-.21
                          \musicglyph #"noteheads.s2"
                          \hspace #-.25
                        }
                     #}))
               ((= pos -8)
                   (grob-interpret-markup grob
                     #{
                        \markup
                        \concat {
                          \with-dimensions #'(0 . 0) #'(0 . 0)
                          \override #'(thickness . 2)
                          \translate-scaled #'(-.45 . 1)
                          \draw-line #'(1.78 . 0)
                          \with-dimensions #'(0 . 0) #'(0 . 0)
                          \override #'(thickness . 2)
                          \translate-scaled #'(-.45 . 0)
                          \draw-line #'(1.78 . 0)
                          \hspace #-.21
                          \musicglyph #"noteheads.s2"
                          \hspace #-.25
                        }
                      #}))
               (else
                  (grob-interpret-markup grob
                         #{
                            \markup
                            \concat {
                              \hspace #-.21
                              \musicglyph #"noteheads.s2"
                              \hspace #-.25
                            }
                          #})))))
      \override Accidental.extra-offset = #'(-.2 . 0)
      %%% TODO: find a fixed ledger line with no dimension
      %% see: http://lilypond.1069038.n5.nabble.com/Fixed-ledger-line-width-with-no-dimension-tc172180.html
      %\override LedgerLineSpanner.length-fraction = #'() %%% ???
      %\override LedgerLineSpanner.minimum-length-fraction = #'() %%% ???
    }
    
    neume = #(define-music-function (parser location mus)
         (ly:music?)
       #{
         \once\override NoteHead.stencil = #(lambda (grob)
             (grob-interpret-markup grob
               #{
                  \markup\concat {
                    \hspace #-2
                    \score {
                      \transpose c c' { \omit Stem $mus }
                      \layout {
                        indent = 0
                        ragged-right = ##t
                        \context {
                          \Score
                          \gregorianContext
                        }
                      }
                    }
                  }
               #}))
       #})
    
    melisma = #(define-music-function (parser location mus)
         (ly:music?)
         #{
            {
              \once\override Lyrics.LyricText.self-alignment-X = #LEFT
              \neume { $mus }
              \omit Accidental
              \omit Dots
              #(make-music
                'NoteEvent
                'pitch
                (ly:make-pitch -1 6 0)
                'duration
                (ly:make-duration 2 0 1))
            }
         #})
    
    % Declare default layout
    \layout {
      \context {
        \Score
        \omit TimeSignature
      }
    }
    
    %%%%%%%%%%%% end of "modernGregorian.ily" %%%%%%%%%

Utilizzo

name[s] - nome
nome della nota a b c d e f g
se ho inserito in comando: \include "italiano.ly", posso usare i nomi italiani: do re mi fa sol la si do
note - nota - nota
\once \override NoteHead #'transparent = ##t
note head - testa della nota - nota
natan
riferisce a Tol che riferisce ad Aruba
musi La nota
ha tre significati diversi:
  1. altezza di un suono
  2. tasto di un pianoforte o organo
  3. segno scritto sul pentagramma che indica il suono da riprodurre (altezza e durata)
le note si scrivono in minuscolo lilypond
le note: a b c d e f g
altezza
do' re, - se non indicato = in rapporto alla nota precedente
head
testa della nota
name[s] - nome
nome della nota a b c d e f g
se ho inserito in comando: \include "italiano.ly", posso usare i nomi italiani: do re mi fa sol la si do
value
- valore della nota, durata
beam - coda
linea che congiunge una serie di note (più corte di un quarto). il numero delle code determina il valore delle note.
stem - gamba
linea verticale sopra o sotto la testa di una nota (di valore minore di una semibreve).
alterazione
dod = do diesis - mib = mi bemolle
durata
do4 re8 mi16 fa2 sol1 se non indicato = alla nota precedente
terzina
\times 2/3 { la8 la la }
nuovo rigo :: \break
ornamento
\staccato c \mordent \turn \fermata
musi parentesi - bracket
{ .. } lilypond - racchiude una espressioni o segmento sequenziale di musica
Ogni { o } deve essere preceduta e seguita da uno spazio a meno che essi non siano all'inizio o alla fine di una riga.
Un comando seguito da una semplice espressione tra parentesi graffe ( es.: "\relative { }" ) vale come una singola espressione musicale.
< .. > - Racchiude le note di un accordo es. < c d >4.
<< .. >> - Encloses simultaneous music expressions
( .. ) - Indica l'inizio e la fine di una legatura (slur)
\( .. \) - Marks the start and end of a phrasing slur
[ .. ] - Indica l'inizio e la fine di unaa manual beam
or across notes: ties (marked by a tilde, ~), tuplets written as \times x/y {..}, and grace notes written as \grace{..}.
\pes
punto di espressione
Figura della notazione musicale. Indica lo staccato quando è posto sopra la nota.