Objects connected to the input - GNU LilyPond
Description: GNU LilyPond

Next: Difficult tweaks, 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 -.

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

- note heads, caused by chord-pitch (i.e., notes inside a chord).
- articulation signs, caused by articulation instructions.

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.

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

Other languages: English.
Using automatic language selection.