lilypond-user
[Top][All Lists]
Advanced

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

Re: calculation of the total duration of a score


From: Paul
Subject: Re: calculation of the total duration of a score
Date: Sat, 10 Sep 2016 10:40:51 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 09/09/2016 05:27 PM, Thomas Morley wrote:

Attached you'll find a different version.
It avoids creating all those grobs and killing most of them in the
end. Instead a preexisting RehearsalMark (or more of them) is taken
and 'text is reset.
Some other changes for better usability.

Hi Harm, Nice work! I'd say this is a good candidate for the LSR, particularly because it demonstrates listeners, acknowledgers, and finalize in one engraver.

One little thing I noticed is that

  (if duration-marks

should be something like

  (if (not (null? duration-marks))

Because:

  \version "2.19.42"
  #(define empty-list '())
  #(display (if empty-list #t #f))
  % --> #t
  #(display (if (not (null? empty-list)) #t #f))
  % --> #f

Also, I wonder, where you clear out these variables at the end of the finalize stage:

         (set! evts '())
         (set! last-evt #f)
         (set! tempo-change-evts '())
         (set! duration-marks '())

Of course, it doesn't hurt, but is it necessary? If so I need to do that in my code.

-Paul



reply via email to

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