Next: , Previous: Determining the grob property, Up: The \override command


9.3.5 Objects connected to the input

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 -.

[image of music]

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: , Previous: Determining the grob property, Up: The \override command

This page is for LilyPond-2.10.33 (stable-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.