It is possible with ly:music-compress , to make a function that fit all kind of musicBut I was annoyed by having two functions with very similiar code.
NB I have tested this snippet only with 2.14 but it should work with 2.15
%%%%%%%%%%%%%%%%%%%%%%%%% \layout { \context { \Staff \remove "Time_signature_engraver" } } cadenzaToMusic = #(define-music-function (parser location cadenzaMusic music) (ly:music? ly:music?) "Adjust the length of `music and the measureLength, to fit the length of `cadenzaMusic" (let* ((clen (ly:music-length cadenzaMusic)) (mlen (ly:music-length music)) (factor (ly:moment-div clen mlen)) (compressed (ly:music-compress music factor))) ;; (format #t "factor : ~a\n" factor) #{ \set Timing.measureLength = $clen $compressed \unset Timing.measureLength #})) cadenzaText = \markup \box "cadenza!" cnotes = \relative c'' { c8[ d e f g] } snotes = \cadenzaToMusic \cnotes s1_\cadenzaText mnotes = \cadenzaToMusic \cnotes R1^\fermataMarkup_\cadenzaText nnotes = \cadenzaToMusic \cnotes \relative c'' { c2^\fermata _\cadenzaText d^\fermata } \score { << \new Staff \cnotes \new Staff \mnotes \new Staff \snotes \new Staff \nnotes >> } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<<attachment: cadenzaToMusic.png>>
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user