Jakub Pavlík <[email protected]> writes:
> You can use music functions in the \layout block, which allows building
> multiple inheritance hierarchies like this (not mentioning the possibility
> of parametrization):
Without parameterization, that is needlessly complicated.
>
> % ---------------------------
> \version "2.25.35"
>
> unmetered =
> #(define-music-function () ()
> #{
> \override Staff.TimeSignature.stencil = ##f
> \override Staff.BarLine.stencil = ##f
> #})
Just write
unmetered =
{
\override Staff.TimeSignature.stencil = ##f
\override Staff.Barline.stencil = ##f
}
and so on. There is still a difference to parameterless music
functions: when using music like this, everything you use needs to be
defined before you use it for other definitions, and changing the
constituent variables will then not change the expressions you built
using them.
With the music functions, the variables are referenced at the time you
use the music function. So while there is no point in this:
> stemless =
> #(define-music-function () ()
> #{
> \override Stem.length = #0
> #})
the following at least will track changes in \unmetered and \stemless:
> chantStyle =
> #(define-music-function () ()
> #{
> \unmetered
> \stemless
> #})
as opposed to \chantstyle = { \unmetered \stemless } which will not care
whether you change the definitions of \unmetered or \stemless after
defining \chantstyle .
--
David Kastrup