Next: \set vs. \override, Previous: Determining the grob property, Up: The \override command
In some cases, it is possible to take a short-cut for tuning graphical
objects. For objects that result directly from a piece of the input,
you can use the \tweak
function, for example
< c \tweak #'color #red d g \tweak #'duration-log #1 a >4-\tweak #'padding #10 -.
As you can see, properties are set directly in the objects directly, without mentioning the grob name or context where this should be applied.
This technique only works for objects that are directly connected to an event from the input, for example
It notably does not work for stems and accidentals (these are caused by note heads, not by music events) or clefs (these are not caused by music inputs, but rather by the change of a property value).
There are very few objects which are directly connected to
output. A normal note (like c4
) is not directly connected
to output, so
\tweak #'color #red c4
will not change color. See Displaying music expressions for
details.
Next: \set vs. \override, Previous: Determining the grob property, Up: The \override command
This page is for LilyPond-2.10.33 (stable-branch).