Up: Scheme tutorial
We have seen how LilyPond output can be heavily modified using
commands like
\override TextScript #'extra-offset = ( 1 . -1)
. But
we have even more power if we use Scheme. For a full explanation
of this, see the Scheme tutorial, and
Interfaces for programmers.
We can use Scheme to simply \override
commands,
TODO Find a simple example
We can use it to create new commands:
tempoMark = #(define-music-function (parser location padding marktext) (number? string?) #{ \once \override Score . RehearsalMark #'padding = $padding \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup { \bold $marktext } #}) \relative c'' { c2 e \tempoMark #3.0 #"Allegro" g c }
Even music expressions can be passed in:
pattern = #(define-music-function (parser location x y) (ly:music? ly:music?) #{ $x e8 a b $y b a e #}) \relative c''{ \pattern c8 c8\f \pattern {d16 dis} { ais16-> b\p } }
This page is for LilyPond-2.11.58 (development-branch).
Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.
Your suggestions for the documentation are welcome.
Other languages: espaƱol.