On Tuesday, July 29, 2014 11:15:50 AM EDT, David Kastrup wrote:
Uh, \unset Timing.measureLength? I don't think that LilyPond is going
to be happy with an unset measure length.
That makes sense, but does it apply to this case? There's a meter change
just after the \cadenzaToMusic call; wouldn't that reset the measure length
to that of the new time signature?
That is, if we have:
someMoment:
\set Timing.measureLength = $clen
music...
someMoment + music's duration:
\unset Timing.measureLength
\time 2/4
Will LilyPond unset the measure length, and then set it to a moment of "1
2"? Or will the unset somehow override what \time is doing? (It seems to be
more like the latter, by observation, but this makes no sense.)
In any case, I found a solution for my score: instead of stretching rests
in other parts to match the cadenzas' durations, compress the cadenza notes
to match the duration of the other parts' rests.
squeezeCadenza =
#(define-music-function (parser location targetDur music)
(ly:moment? ly:music?)
"Adjust the length of `music and the measureLength, to fit the length of
`cadenzaMusic"
(let* ((mlen (ly:music-length music))
(factor (ly:moment-div targetDur mlen))
(compressed (ly:music-compress music factor)))
#{
$compressed
#}))
Resting part: \cadenzaOn R1 \cadenzaOff
Solo part: \cadenzaOn \squeezeCadenza #(ly:make-moment 1 1) \cadenzaNotes
\cadenzaOff
... and the subsequent meter changes behave as they should.
hjh
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user