On 22/03/2026 00:10, Tina Petzel wrote:
What I want is essentially a structure where I can do

%%%
\layout {
     \musicXMLExport filename
     \musicXMLAddFeatureA
     \musicXMLAddFeatureB
}
%%%

for controlling output. My problem is now that these parts would need to
consist of individual \context { ... \consists ... \override ... } blocks.
Lilypond does not really have a nice way of dealing with something like this.
Naively I would just want to be able to put this into individual \layout
blocks and just splice them together by putting them into one block. But sadly
Lilypond does not do this.

You can wrap the \context { ... } in a scheme function, which is called in the \layout block, e.g.

musicXMLFeatureA = #(define-scheme-function (args) (predicates)
      #{ \context { \Score \consists ... } #} )

\layout { \musicXMLFeatureA \musicXMLFeatureB }


--
Timothy Lanfear, Bristol, UK.

Reply via email to