On 24 November 2012 09:18, Eby Mani <eby...@yahoo.com> wrote: > Oh, that is to combine rests of two choir voices on the same staff, as you > can see I'm using two voices per staff. > > If i disable it, it shows no errors. > > Is there a better way of combining rests the same without using "\revert Rest > #'direction" ?.
You mean like the "Merge Rests Engravers" developed by Jay Anderson as solution for bug #1228 ? http://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00793.html http://code.google.com/p/lilypond/issues/detail?id=1228 %%%% Snippet \version "2.15.30" %% merge-rests-engraver and merge-mmrests-engraver provided by %% Jay Anderson %% http://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00793.html %% See also issue #1228 %% http://code.google.com/p/lilypond/issues/detail?id=1228 #(define has-one-or-less (lambda (lst) (or (null? lst) (null? (cdr lst))))) #(define has-at-least-two (lambda (lst) (not (has-one-or-less lst)))) #(define (all-equal lst pred) (or (has-one-or-less lst) (and (pred (car lst) (cadr lst)) (all-equal (cdr lst) pred)))) #(define merge-rests-engraver (lambda (context) (let ((rest-same-length (lambda (rest-a rest-b) (eq? (ly:grob-property rest-a 'duration-log) (ly:grob-property rest-b 'duration-log)))) (rests '())) `((start-translation-timestep . ,(lambda (trans) (set! rests '()))) (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)))) (acknowledgers (rest-interface . ,(lambda (engraver grob source-engraver) (if (eq? 'Rest (assoc-ref (ly:grob-property grob 'meta) 'name)) (set! rests (cons grob rests)))))))))) #(define merge-mmrests-engraver (lambda (context) (let* ((mmrest-same-length (lambda (rest-a rest-b) (eq? (ly:grob-property rest-a 'measure-count) (ly:grob-property rest-b 'measure-count)))) (merge-mmrests (lambda (rests) (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))))) (curr-rests '()) (rests '())) `((start-translation-timestep . ,(lambda (trans) (set! curr-rests '()))) (stop-translation-timestep . ,(lambda (trans) (if (has-at-least-two curr-rests) (set! rests (cons curr-rests rests))))) (finalize . ,(lambda (translator) (for-each merge-mmrests rests))) (acknowledgers (rest-interface . ,(lambda (engraver grob source-engraver) (if (eq? 'MultiMeasureRest (assoc-ref (ly:grob-property grob 'meta) 'name)) (set! curr-rests (cons grob curr-rests)))))))))) global = {\compressFullBarRests \override MultiMeasureRest #'expand-limit = #1 } voixI = \relative c'' { R1*4 g1 a g r4 g4 a g } voixII = \relative c' { R1*4 e1 f e r4 e r e } voixIII = \relative c' { R1*4 c1 ~ c ~ c c4 r c r } voixIIII = \relative c { R1*4 c1 f c c4 f c r } paroles = \lyricmode { a b c d } \score { \new ChoirStaff << \new Staff << \new Voice = one { \voiceOne \global \voixI } \new Voice = two { \voiceTwo \global \voixII } >> \new Lyrics \lyricsto "one" { \paroles } \new Staff << \clef bass \new Voice = one { \voiceOne \global \voixIII } \new Voice = two { \voiceTwo \global \voixIIII } >> >> \layout { \context { \Staff \consists #merge-rests-engraver \consists #merge-mmrests-engraver } } } %%%% End of snippet -- Xavier Scheuer <x.sche...@gmail.com> _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user