\version "2.15.24" cadenzaNotes = #(define-music-function (parser location fermata? music cad-music) (boolean? ly:music? ly:music?) (let* ((mus-len (ly:music-length cad-music)) (num (ly:moment-main-numerator mus-len)) (denom (ly:moment-main-denominator mus-len)) (fermata (make-music 'MultiMeasureTextEvent 'tweaks (list ;; Set the 'text based on the 'direction (cons 'text (lambda (grob) (if (eq? (ly:grob-property grob 'direction) DOWN) (markup #:musicglyph "scripts.dfermata") (markup #:musicglyph "scripts.ufermata")))) (cons 'outside-staff-priority 40) (cons 'outside-staff-padding 0)))) (lst (list #{ \set Timing.measureLength = $mus-len \scaleDurations #(cons num denom) $music \unset Timing.measureLength #})) ) (make-sequential-music (if fermata? (cons fermata lst) lst)))) othernotes = \relative c'' { d1 c1 } cnotes = \relative c'' { c8[ d e f g] c,8[ d e f g]} snotes = { $(skip-of-length cnotes) } mnotesI = \cadenzaNotes ##t R1 \cnotes mnotesII = \cadenzaNotes ##f \relative c'' { c2 d } \cnotes \score { << \new Staff { \othernotes \cnotes \othernotes } \new Staff { \othernotes \snotes \othernotes } \new Staff { \othernotes \mnotesI \othernotes } \new Staff { \othernotes \mnotesII \othernotes } \new Staff \relative c'' { d1 c1~ \cadenzaNotes ##t { c2\fermata g4\fermata c~ } \cnotes c1 d } % manually: \new Staff { \othernotes R1*10/8\fermataMarkup \othernotes } \new Staff { \othernotes \scaleDurations #'(10 . 8) \relative c'' { c2\fermata g4\fermata c } \othernotes } >> }