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: Sat, 01 Feb 2020 16:06:59 -0800
User-agent: Roundcube Webmail/1.4.2

On 2020-02-01 7:54 am, David Kastrup wrote:
Bric <address@hidden> writes:
Is it possible to override multiple with just one "\override" directive?

something like this (wrong syntax):

\override { Voice.Stem.thickness = #3.0
            Voice.Stem.color = #(rgb-color 0.3 0.1 0.1)
          }

to reduce redundant syntax, if one had to override many at once.

No.  It's not like the savings in this case would be overwhelming.

To that point, the better and already existing solution is to move these related \overrides into their own music variable or function, if there needs to be some parameterization:

%%%%
\version "2.18"

emphasizeStem = {
  \override Stem.thickness = #3.0
  \override Stem.color = #'(0.5 0.3 0.2)
}

% . . .
\new Voice \with { \emphasizeStem } { b'4 c''2. }
% . . .
\new Voice { e'8 g' \once \emphasizeStem f'4 a'2 }
% . . .
%%%%

Grouping related \overrides together in a well-named variable promotes readability, reusability and maintainability. As an added bonus, \once can be used with the variable without needing to apply it to every \override.


-- Aaron Hill



reply via email to

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