lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create engravers for merging rests (issue 321930043 by address@hidde


From: horndude77
Subject: Re: Create engravers for merging rests (issue 321930043 by address@hidden)
Date: Sat, 20 May 2017 21:27:33 -0700


https://codereview.appspot.com/321930043/diff/100001/scm/scheme-engravers.scm
File scm/scheme-engravers.scm (right):

https://codereview.appspot.com/321930043/diff/100001/scm/scheme-engravers.scm#newcode151
scm/scheme-engravers.scm:151: (define (rest-eqv rest-len-prop)
On 2017/05/20 12:18:33, thomasmorley651 wrote:
The current patch-set fails with:
"Variable used before given a value: rest-eqv"
because subsequent usage of 'define ...' is equivalent to let not let*

Moving (define (rest-eqv rest-len-prop) before the engraver-definiton
starts
will work or something at the lines of

...
   (let* ((rest-eqv
            (lambda (rest-len-prop)
              (define (rest-len rest) (ly:grob-property rest
rest-len-prop))
              (lambda (rest-a rest-b)
                (eqv? (rest-len rest-a) (rest-len rest-b)))))
          (mmrest-same-length (rest-eqv 'measure-count))
          (rest-same-length (rest-eqv 'duration-log)))

   (define (merge-mmrests rests)
...


Interesting. I didn't run into that error. I'm using the latest lilydev
which is using guile 2. That could be the difference. In any case I've
removed the methods so this shouldn't happen.

https://codereview.appspot.com/321930043/diff/100001/scm/scheme-engravers.scm#newcode167
scm/scheme-engravers.scm:167: (lambda (rest) (ly:grob-set-property! rest
'Y-offset (rest-offset rest)))
On 2017/05/20 14:33:15, david.nalesnik wrote:
Just moving one rest on top of the other might cause offsets with some
printers.
  This happened at one time with flags on chords: see
http://lists.gnu.org/archive/html/bug-lilypond/2015-08/msg00080.html

Would it work to set 'stencil of all of the cdr to point-stencil?

Using point-stencil causes odd alignment issues with text connected to
multimeasure rests. Making them invisible doesn't have this issue. Would
that solve the above potential problem?

Related to this, is there a way to re-parent grobs onto the surviving
rest? If so we could then use point-stencil (or possibly fully destroy)
the other rests.

https://codereview.appspot.com/321930043/diff/100001/scm/scheme-engravers.scm#newcode193
scm/scheme-engravers.scm:193: ((eq? 'MultiMeasureRest (grob::name grob))
On 2017/05/20 14:33:15, david.nalesnik wrote:
The only two grobs you could get are Rest and MultiMeasureRest, so you
could
just write

(else
   (set! [...]


[I think looking at the grob name is fine.]

It was simple enough to switch over and use (else ...) as well.

https://codereview.appspot.com/321930043/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]