Next: , Previous: Objects connected to the input, Up: The \override command


9.3.6 \set vs. \override

We have seen two methods of changing properties: \set and \override. There are actually two different kinds of properties.

Contexts can have properties, which are usually named in studlyCaps. They mostly control the translation from music to notatino, eg. localKeySignature (for determining whether to print accidentals), measurePosition (for determining when to print a barline). Context properties can change value over time while interpreting a piece of music; measurePosition is an obvious example of this. Context properties are modified with \set.

There is a special type of context property: the element description. These properties are named in StudlyCaps (starting with capital letters). They contain the “default settings” for said graphical object as an association list. See scm/define-grobs.scm to see what kind of settings there are. Element descriptions may be modified with \override.

\override is actually a shorthand;

\override context.name #'property = #value

is more or less equivalent to

\set context.name #'property = #(cons (cons 'property value) <previous value of context)

The value of context (the alist) is used to initalize the properties of individual grobs. Grobs also have properties, named in Scheme style, with dashed-words. The values of grob properties change during the formatting process: formatting basically amounts to computing properties using callback functions.

fontSize is a special property: it is equivalent to entering \override ... #'font-size for all pertinent objects. Since this is a common change, the special property (modified with \set) was created.


Next: , Previous: Objects connected to the input, 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.