lilypond-user
[Top][All Lists]
Advanced

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

Re: \override multiple properties?


From: Aaron Hill
Subject: Re: \override multiple properties?
Date: Sun, 02 Feb 2020 03:09:30 -0800
User-agent: Roundcube Webmail/1.4.2

On 2020-02-02 2:26 am, David Kastrup wrote:
Aaron Hill <address@hidden> writes:

Music functions certainly give you the most flexibility, although
there are simple cases where you can use 2.19's \etc keyword as a
shorthand to defining the function yourself:

%%%%
\version "2.19"

stemColor = \override Stem.color = \etc

{ d'8 \stemColor #red e' f' \undo \stemColor ##f g' }
%%%%

Note the \undo command above is less ideal as one needs to provide a
dummy argument to the function.

Why not \undo \stemColor #red here ?  ##f makes no sense.

I did not want to give the impression that the arguments *had* to match. One could just as easily say \undo \stemColor #blue and get the same outcome. \undo only seems to care about which properties are \overridden, not the specific values. So the argument to the music function in this case does not matter. My choice of "false" was purely arbitrary, but I guess it was too confusing.

A scenario where the mismatch would make sense is using the function several times in a row:

%%%%
{ d \stemColor #red e f \stemColor #blue g a
  \stemColor #green f c \undo \stemColor #'() d }
%%%%

This pattern reinforces that it is not required to \undo each application of the function.

If \undo \stemColor #'() proves to be undesirable, nothing stops a user just doing the \undo by hand with a manual \revert Stem.color or a suitably-defined \noStemColor.


-- Aaron Hill



reply via email to

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