On 2020-02-01 7:54 am, David Kastrup wrote:
Bric <[email protected]> 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