Multi-measure rests were previously compressed (i.e. all bars
following the first were removed) by using the \compressFullBarRests
predef. This simply turned on 'skipBars, which causes bar lines at
the ends of bars which contain either no rhythmic event or contain
a rhythmic event with a duration extending beyond the bar to be removed.
Such bars are generated by notes with durations longer than a bar,
like a1*3, or by shorter notes which extend beyond the bar.
This patch provides a function which also uses 'skipBars, but with
a filter so that 'skipBars is activated only when an actual MM rest
is encountered and deactivated by the first following rhythmic event.
\set Timing.measureLength = #mlen
#} ))
+compressMMRests =
+#(define-music-function (parser location music) (ly:music?)
+ (_i "Remove the empty bars created by multi-measure rests,
+leaving just the first bar containing the MM rest itself.")
+ (music-map
+ (lambda (m)
+ (if (eq? 'MultiMeasureRestMusic (ly:music-property m 'name))
+ #{ \once \set Score.skipBars = ##t #m #}
+ #{ #m #} ))
+ music))
+
crossStaff =
#(define-music-function (parser location notes) (ly:music?)
(_i "Create cross-staff stems")