From 689f63e0473f8325b63d6bba66f9a56335548303 Mon Sep 17 00:00:00 2001 From: Trevor Daniels Date: Tue, 28 Apr 2015 23:50:31 +0100 Subject: [PATCH] Issue 3687 (part 1): Provide a compress MM function for MM rests only 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. --- ly/music-functions-init.ly | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 20a9e49700..e039c1cf7c 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -287,6 +287,17 @@ as @code{\\compoundMeter #'((3 2 8))} or shorter \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") -- 2.39.2