|
From: | Ian Hulin |
Subject: | Re: Repeats and midi blocks |
Date: | Mon, 17 Nov 2008 11:12:48 +0000 |
User-agent: | Thunderbird 2.0.0.17 (Windows/20080914) |
Hi Johan, Johan Vromans wrote:
Graham Percival <address@hidden> writes:It depends on why you're listening to the piece. I *do* want to hear it clunking along, since I only ever listen to midi as a quick "proofread" [...]Yes, though I'd say Ian has a point, too. I use the midi initially to 'proofread', but finally I generate the complete piece with repeats unfold. Should I make some corrections, I'd like to hear it without repeats, and so on. This snippet allows a command line option unfold-repeats to control this behaviour: maybeUnfoldRepeats = #(define-music-function (parser location music) (ly:music?) (if (ly:get-option 'unfold-repeats) #{ \unfoldRepeats $music #} #{ $music #})) \score { \maybeUnfoldRepeats \allMusic \midi { } } Using "lilypond -d unfold-repeats ..." will now generate midi with unfolded repeats. Now, if we could only get rid of the warning "no such internal option: unfold-repeats"... -- Johan
Hmm... I may have a cunning plan. Write some wrapper functions \setMidiRepeats to take a boolean flag and save this in an internal Scheme variable, say unfoldmidirepeats. Your function then tests (if Reinhold does this sort of thing in orchestrallily, so I should be able to steal from the best . . . )
This sort of thing,\setMidiRepeats = #(define-music-function parser location unfoldmidirepeats music) (boolean? ly:music?)
if(unfoldmidirepeats) #{ \unfoldRepeats $music} #{ $music } } )I'll probably need some extra Scheme functions to set the unfoldmidirepeats variable to initial values and a known state but you've given me something to work with.
Dankie en groetjes, Ian
[Prev in Thread] | Current Thread | [Next in Thread] |