lilypond-user
[Top][All Lists]
Advanced

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

Re: Contexts affected by \override and \overrideProperty


From: David Kastrup
Subject: Re: Contexts affected by \override and \overrideProperty
Date: Tue, 19 Feb 2019 13:24:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Am 19.02.19 um 12:27 schrieb David Kastrup:
>> Urs Liska <address@hidden> writes:
>>
>>> Am 18.02.19 um 17:30 schrieb David Kastrup:
>>>> Urs Liska <address@hidden> writes:
>>>>
>>>>> Can someone explain to me why \overrideProperty Staff.BarLine.color
>>>>> #red colors the barlines in *all* staves while \override
>>>>> Staff.BarLine.color = #red only affects the current Staff context?
>>>>>
>>>>> I have just re-read
>>>>> http://lilypond.org/doc/v2.19/Documentation/notation/set-versus-override
>>>>> and am scratching my head. I do claim to have some experience by now
>>>>> but this page isn't actually really helpful:
>>>>>
>>>>>      "The commands ... |\overrideProperty| change grob properties by
>>>>>      bypassing all context properties completely and, instead, catch
>>>>>      grobs as they are being created, setting properties on them ... for
>>>>>      a specific override."
>>>>>
>>>>> This doesn't give a clue when \overrideProperty should (or must) be
>>>>> used instead of \override or what the difference in behaviour actually
>>>>> is.
>>>>>
>>>>> \overrideProperty is also present on
>>>>> http://lilypond.org/doc/v2.19/Documentation/notation/available-music-functions#index-overrideProperty-1
>>>>>
>>>>>      |overrideProperty| [music] - grob-property-path (list of indexes or
>>>>>      symbols) value (any type)
>>>>>          Set the grob property specified by grob-property-path to value.
>>>>>          grob-property-path is a symbol list of the form
>>>>>          |Context.GrobName.property| or |GrobName.property|, possibly
>>>>>          with subproperties given as well.
>>>>>
>>>>>          As opposed to |\override| which overrides the context-dependent
>>>>>          defaults with which a grob is created, this command uses
>>>>>          |Output_property_engraver| at the grob acknowledge stage. This
>>>>>          may be necessary for overriding values set after the initial
>>>>>          grob creation.
>>>>>
>>>>> This gives an indication for why it may in some cases be necessary to
>>>>> use \overrideProperty but it doesn't explain why it seems to affect
>>>>> objects in all contexts instead of just the one where it is used.
>>>> Because the respective engraver is only active at Score level and
>>>> overrides the properties in _all_ contexts of the given type.
>>>
>>> So this means that if I'm in the situation where I'm forced to use
>>> \overrideProperty this property will always be overridden on the Score
>>> context?
>> No, just in all Staff contexts (if Staff is what you specified).  The
>> Score context property will remain unchanged.
>>
>> This does not sound overly useful, does it?
>
>
> It *does* sound useful, just not for the problem at hand.

Looks like a consequence of
commit 1d1976cb7da1d4625357e59a34837b1d46cac70c
Author: David Kastrup <address@hidden>
Date:   Sun Jul 3 01:37:15 2016 +0200

    Issue 4914/1: Move Output_property_engraver to Score level
    
    This has the advantage of needing only one instantiation of the engraver
    and not having \applyOutput mysteriously refrain from having an effect
    in contexts without Output_property_engraver .
    
    Due to the hierarchical nature of acknowledgers, acknowledgers in lower
    contexts will now get to see the grobs before applyOutput has done its
    work.  However, grobs are still unfinished (except for type, properties
    initialized via context properties and cause) at the time they are
    announced, with other details only getting filled in by the engraver
    after announcement, so the potential for trouble seems low.
    Acknowledgers should usually just register a grob (or write grob data)
    with any actual reading of grob data occurring at the end of the
    timestep instead or in the process-acknowledged phase.

I think that this likely was not thought through.  It's a 2.19.46 change
so it looks like something that needs fixing before 2.20.

Apologies.

> Knowing this it seems I have to find a way to avoide using
> \overrideProperty somewhere in my engraver, which seems somewhat
> daunting at this point. OTOH it may open up a way to *selectively* use
> this behaviour for *all* music types.

Don't do this.  If you want something to apply Score-wide, use a Score
qualifier and work from there.  Consider the current behavior a bug.
I'll try coming up with a good fix within the day.

-- 
David Kastrup



reply via email to

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