On Mon, 2023-12-11 at 17:22 +0100, Jean Abou Samra wrote: > ly2video or not, you need to unfold repeats as soon as you want > correct MIDI output. I agree that requiring to do it explicitly is > not very user-friendly, but auto-adding \unfoldRepeats sounds like > solving the problem at the wrong level. Also, what ly2video does is > not always correct since \score { \midi { ... } \music } is valid but > \score { \unfoldRepeats \midi { ... } \music } is not — it would need > to be \score { \midi { ... } \unfoldRepeats \music }.
One thing occurred to me. If the original \score did not have a \midi block, would it be possible to ask lilypond to produce midi output without modifying the input file? At present, if there is no midi file produced, ly2video fails. That means the user has to at least edit the file to add midi output. It would be nice to avoid that.