From: Trevor Daniels Date: Tue, 28 Apr 2015 22:50:31 +0000 (+0100) Subject: Issue 3687 (part 1): Provide a compress MM function for MM rests only X-Git-Tag: release/2.19.20-1~19 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=689f63e0473f8325b63d6bba66f9a56335548303;p=lilypond.git 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. --- 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")