lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set vs. Override - I'm confused


From: Michael Brennan
Subject: Re: Set vs. Override - I'm confused
Date: Fri, 28 Apr 2006 22:27:17 +0200
User-agent: Thunderbird 1.5.0.2 (Windows/20060308)

Erik Sandberg wrote:

Great! You now officially know more about this area than me, because I don't have a clue when to use \override or \set. Please take a few minutes to send me some clarifications or additions for the manual:
http://lilypond.org/web/devel/participating/documentation-adding
My simple understanding of it is that:
\set sets a property for the whole context, and the objects contained in that context while
\override is for a particular graphical object.

Just a little explanation like that, that separates them would be good to have in the docs,
or better yet, Eric's more thorough explanation below.

Hm. Here's my understanding of it:

You can say it's all about the granularity of the setting. \override
manipulates
settings which are specific to one graphical object/grob (e.g. a NoteHead).
\set
changes settings on a higher level, and can modify more than one type of grob.
For example, fontSize is a context property (modified with \set) because it
changes the behaviour of several different types of grobs (e.g., noteheads and
rests). You can also change the fontsize of all noteheads only, by overriding a
grob property of NoteHead grobs only. Or you can modify the fontsize of a
single
notehead using \tweak.
You can notice that \set and \override use different syntaxes:
\set ctx.prop = val
\override ctx Grob.prop = val
Rule of thumb is: If you can figure out a type of Grob that the tweak is
specific to, then it's probably an \override.

This rule requires a rough knowledge of which grob types that exist. The only
way I know to get this knowledge is by reading the internals reference.

Erik


What is a \tweak? I can't recall reading about it in the manual. You say that you can modify the fontsize of a single notehead with \tweak. Would that give any difference than using a
\once \override NoteHead #'font-size = size






reply via email to

[Prev in Thread] Current Thread [Next in Thread]