Menu

#5382 Feature request: let \layout accept several \layouts stored in variables

Invalid
nobody
None
Enhancement
2018-07-16
2018-07-16
No

On Sun, 15 Jul 2018 09:24:22 +0200, Malte Meyn lilypond@maltemeyn.de wrote:

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.

Also see: thread: http://lists.gnu.org/archive/html/bug-lilypond/2018-07/msg00043.html

Discussion

  • David Kastrup

    David Kastrup - 2018-07-16
    • status: New --> Invalid
     
  • David Kastrup

    David Kastrup - 2018-07-16

    The code is creating two different \layout blocks and then expects to use both at once. That's just not possible since, as explained in the reference mail threads, no information remains in the layout blocks how they were created and which components can be considered "additional".

    The normal way to achieve that kind of effect is using context modifications. There is no equivalent "output modification" which would only carry modifications to be applied to an existing output definition.