B.1.2 Einfache Ersetzungsfunktionen
Hier ist ein einfaches Beispiel:
padText = #(define-music-function (parser location padding) (number?) #{ \once \override TextScript #'padding = #$padding #}) \relative c''' { c4^"piu mosso" b a b \padText #1.8 c4^"piu mosso" d e f \padText #2.6 c4^"piu mosso" fis a g }
Musikalische Ausdrücke können auch ersetzt werden:
custosNote = #(define-music-function (parser location note) (ly:music?) #{ \once \override Voice.NoteHead #'stencil = #ly:text-interface::print \once \override Voice.NoteHead #'text = \markup \musicglyph #"custodes.mensural.u0" \once \override Voice.Stem #'stencil = ##f $note #}) { c' d' e' f' \custosNote g' }
Mehrere Variablen können benutzt werden:
tempoPadded = #(define-music-function (parser location padding tempotext) (number? string?) #{ \once \override Score.MetronomeMark #'padding = $padding \tempo \markup { \bold $tempotext } #}) \relative c'' { \tempo \markup { "Low tempo" } c4 d e f g1 \tempoPadded #4.0 #"High tempo" g4 f e d c1 }