bug-lilypond
[Top][All Lists]
Advanced

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

Re: Feature request: let \layout accept several \layouts stored in varia


From: Urs Liska
Subject: Re: Feature request: let \layout accept several \layouts stored in variables
Date: Sun, 15 Jul 2018 09:54:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0



Am 15.07.2018 um 09:24 schrieb Malte Meyn:
Hi list,

it’s possible to write something like

%%%%%%%%%%%%%%%%%%%%%%%%%
ambitus = \layout {
  \context {
    \Voice
    \consists Ambitus_engraver
  }
}

\score {
  \relative { c' d e f g a b c }
  \ambitus
}
%%%%%%%%%%%%%%%%%%%%%%%%%

or put the \layout variable in a \layout block:

%%%%%%%%%%%%%%%%%%%%%%%%%
\score {
  \relative { c' d e f g a b c }
  \layout { \ambitus }
}
%%%%%%%%%%%%%%%%%%%%%%%%%

Now it would be nice if \layout could accept several such \layout variables:

%%%%%%%%%%%%%%%%%%%%%%%%%
musicaFicta = \layout {
  \context {
    \Voice
    suggestAccidentals = ##t
  }
}

\score {
  \relative { c' d e f g a b c }
  \layout {
    \ambitus
    \musicaFicta
  }
}
%%%%%%%%%%%%%%%%%%%%%%%%%

Currently, that gives an “error: bad expression type” for \musicaFicta. If not putting \ambitus and \musicaFicta in another \layout layer, that will give two scores, one with Ambitus_engraver and one with suggestAccidentals.

Would it be possible to implement this?

Cheers,
Malte

Indeed that would be a nice tool.

I was once directed to a solution that basically has that effect. You can find it at https://git.openlilylib.org/bfsc/kayser/blob/master/includes/lib/engrave.ily#L126 (up to line 146).

Maybe it would be possible to generalize that, but I haven't thought about that (and it would probably be over my head anyway).

HTH
Urs



reply via email to

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