Hi Tina,
Am 22.03.26 um 01:10 schrieb Tina Petzel:
as you might remember I am creating a musicXML exporter for Lilypond. I have
reworked the system last weekend, but currently struggling to get this into
the interface I want it to be in.
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.
Do I understand correctly that the problem is what can be observed in
the following example?
\version "2.27.0"
musicXMLAddFeatureA =
\layout {
\context {
\Voice
\remove Note_heads_engraver
}
\context {
\Staff
\override StaffSymbol.color = #darkgreen
}
}
musicXMLAddFeatureB =
\layout {
\context {
\Staff
\override StaffSymbol.thickness = 2
}
}
\layout {
\musicXMLAddFeatureA % does not work if put after the \override
\override Staff.Clef.color = #blue
% \musicXMLAddFeatureB % uncomment to trigger error
}
{
a4
b
}
In that case, I think LilyPond should support this. I don't have time
right now to check the issues, but this is something we should work on IMO.
Lukas