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: Erik Sandberg
Subject: Re: Set vs. Override - I'm confused
Date: Thu, 27 Apr 2006 16:36:06 +0200
User-agent: Internet Messaging Program (IMP) 3.2.7

Citerar Graham Percival <address@hidden>:

> 
> On 26-Apr-06, at 10:36 PM, Michael Brennan wrote:
> 
> > David Feuer wrote:
> >> On 4/19/06, Erik Sandberg <address@hidden> wrote:
> >>> In 2.8 there's an essential difference between grob and context 
> >>> properties,
> >>> which is visible for end-users: the \tweak command only makes sense 
> >>> on layout
> >>> object properties, not on context properties. This difference might 
> >>> make it
> >>> easier for new users to understand grob properties.
> >>
> > Actually it helps me, as a new user.
> > When I first read the manual I didn't see any clear explanation of the 
> > difference,
> > the docs could be more clear on that point. But when I realized that 
> > one was for grobs
> > and the other for context, it became much clearer, for me it helps 
> > separating and understanding
> > grobs and contexts.
> 
> 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

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





reply via email to

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