Next: \set versus \override, Previous: Objects connected to the input, Up: The \override command
\tweakThe main disadvantage of \tweak is its syntactical
inflexibility. For example, the following produces a syntax error.
F = \tweak #'font-size #-3 -\flageolet
\relative c'' {
c4^\F c4_\F
}
With other words, \tweak doesn't behave like an articulation
regarding the syntax; in particular, it can't be attached with
`^' and `_'.
Using Scheme, this problem can be circumvented. The route to the
result is given in Adding articulation to notes (example),
especially how to use \displayMusic as a helping guide.
F = #(let ((m (make-music 'ArticulationEvent
'articulation-type "flageolet")))
(set! (ly:music-property m 'tweaks)
(acons 'font-size -3
(ly:music-property m 'tweaks)))
m)
\relative c'' {
c4^\F c4_\F
}
Here, the tweaks properties of the flageolet object
`m' (created with make-music) are extracted with
ly:music-property, a new key-value pair to change the
font size is prepended to the property list with the
acons Scheme function, and the result is finally
written back with set!. The last element of the
let block is the return value, `m' itself.
Next: \set versus \override, Previous: Objects connected to the input, Up: The \override command
Diese Seite ist für LilyPond-2.11.28 (Entwicklungszweig).
Fehler bitte an http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs melden.
Your suggestions for the documentation are welcome.