| [ << Changing defaults ] | [Top][Contents][Index] | [ Notation manual tables >> ] |
| [ < The set command ] | [ Up : Modifying properties ] | [ The tweak command > ] |
5.3.3 The \override command
There is a special type of context property: the grob
description. Grob descriptions are named in StudlyCaps
(starting with capital letters). They contain the
‘default settings’ for a particular kind of grob as an
association list. See ‘scm/define-grobs.scm’
to see the settings for each grob description. Grob descriptions
are modified with \override.
The syntax for the \override command is
\override [context.]GrobName.property = #value
For example, we can increase the thickness of a note stem by
overriding the thickness property of the Stem
object:
c''4 c'' \override Voice.Stem.thickness = #3.0 c''4 c''
If no context is specified in an \override, the bottom
context is used:
\override Staff.Stem.thickness = #3.0 << \relative { e''4 e \override Stem.thickness = #0.5 e4 e } \\ \relative { c''4 c c c } >>
Some tweakable options are called ‘subproperties’ and reside inside properties. To tweak those, use commands in the form
\override Stem.details.beamed-lengths = #'(4 4 3)
or to modify the ends of spanners, use a form like these
\override TextSpanner.bound-details.left.text = "left text" \override TextSpanner.bound-details.right.text = "right text"
The effects of \override can be undone by \revert.
The syntax for the \revert command is
\revert [context.]GrobName.property
For example,
\relative { c''4 \override Voice.Stem.thickness = #3.0 c4 c \revert Voice.Stem.thickness c4 }
The effects of \override and \revert apply to all
grobs in the affected context from the current time forward:
<< \relative { e''4 \override Staff.Stem.thickness = #3.0 e4 e e } \\ \relative { c''4 c c \revert Staff.Stem.thickness c4 } >>
\once can be used with \override or \revert
to affect only the current time step:
<< \relative c { \override Stem.thickness = #3.0 e''4 e e e } \\ \relative { c''4 \once \override Stem.thickness = #3.0 c4 c c } >>
See also
Internals Reference: Backend.
| [ << Changing defaults ] | [Top][Contents][Index] | [ Notation manual tables >> ] |
| [ < The set command ] | [ Up : Modifying properties ] | [ The tweak command > ] |
![[image of music]](../d7/lily-3cf3b799.png)
![[image of music]](../53/lily-acbb2672.png)
![[image of music]](../27/lily-071c4f3d.png)
![[image of music]](../ad/lily-9df6c157.png)
![[image of music]](../04/lily-6465a626.png)