I already asked some question about \markup and \midi and get some usefull answer. Here I attached the real code I'm working on.
I would like to generate the midi and I would appreciate some suggestion.
Kieren suggest to separate the layout and midi. Pro: clear and easy to do; Cons: a bit verbose and difficult to maintain.
Thomas Morley proposed a scheme method to extract the score from the markup. Pro: it works nicely with some test examples. Cons: complex.
I personally would prefer Kieren solution because I can handle it better. But maybe organizing the code differently gives better solution....?
* * *
My code looks to me very redundant. For example:
\markup \justify-line {
\score {{ \set Staff.instrumentName = #(nextcount)
\clef bass \override Score.TimeSignature #'stencil = ##f
\cadenzaOn
\tetrachordOneUp
\cadenzaOff}
}
\score {{ \set Staff.instrumentName = #(nextcount)
\clef bass \override Score.TimeSignature #'stencil = ##f
\cadenzaOn
\tetrachordOneDn
\cadenzaOff}
}
\score {{ \set Staff.instrumentName = #(nextcount)
\clef bass \override Score.TimeSignature #'stencil = ##f
\cadenzaOn
\tetrachordOneUpDn
\cadenzaOff}
}
}
This repeats three times the same thing except for referencing different variables:
\tetrachordOneUp
\tetrachordOneDn
\tetrachordOneUpDn
Is this the correct way to go or is there any way to simplify it?