--- definition.ily-orig 2015-08-23 16:16:13.428995010 -0300 +++ definition.ily 2015-08-23 16:13:43.995254184 -0300 @@ -18,6 +18,17 @@ (or (has-one-or-less lst) (and (pred (car lst) (cadr lst)) (all-equal (cdr lst) pred)))) +% merge a list of rests, by moving the first one to the specified +% offset, and disabling all the other ones including any associated dots. +#(define (merge-to-offset rests offset) + (ly:grob-set-property! (car rests) 'Y-offset offset) + (for-each + (lambda (rest) + (ly:grob-set-property! rest 'stencil #f) + (if (not (null? (ly:grob-object rest 'dot))) + (ly:grob-set-property! (ly:grob-object rest 'dot) 'stencil #f))) + (cdr rests))) + #(define merge-rests-engraver (lambda (context) (let ((rest-same-length @@ -30,10 +41,7 @@ (stop-translation-timestep . ,(lambda (trans) (if (and (has-at-least-two rests) (all-equal rests rest-same-length)) - (for-each - (lambda (rest) - (ly:grob-set-property! rest 'Y-offset 0)) - rests)))) + (merge-to-offset rests 0)))) (acknowledgers (rest-interface . ,(lambda (engraver grob source-engraver) (if (eq? 'Rest (assoc-ref @@ -51,10 +59,7 @@ (if (all-equal rests mmrest-same-length) (let ((offset (if (eq? (ly:grob-property (car rests) 'measure-count) 1) 1 0))) - (for-each - (lambda (rest) (ly:grob-set-property! rest - 'Y-offset offset)) - rests))))) + (merge-to-offset rests offset))))) (curr-rests '()) (rests '())) `((start-translation-timestep . ,(lambda (trans)