On Tue, 2023-12-12 at 02:31 -0800, Aaron Hill wrote: > Would this not work? > > %%%% > #(define (add-midi-to-score score) > #{ \score { $score \midi {} } #}) > > toplevel-score-handler = > #(lambda (score) > (collect-scores-for-book (add-midi-to-score score))) > %%%%
Indeed it does! Without a \midi block one midi file is produced. However, if there is already a \midi block, two midi files are produced. I'm not sure if that's going to be a problem aside from the extra processing time. If there are multiple \score blocks, I don't know what would happen... ly2video is only intended to process a single score. Or perhaps even just a single instrument. And tries to do so on files that already produce a pdf. There is another project called LilypondToBandVideoConverter which outputs multiple midi tracks and multiple videos. It requires a unique lilypond file that won't compile to anything on it's own. It just puts the music in predefined variables that the python code then puts into a purpose built lilypond file to create what it needs.