lilypond-user
[Top][All Lists]
Advanced

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

Re: shorten a broken hairpin at a linebreak?


From: David Nalesnik
Subject: Re: shorten a broken hairpin at a linebreak?
Date: Thu, 1 Sep 2011 12:59:44 -0500

Hi Harm,


Using David's last-bar-Definition [ . . . ]


I just wanted to point out that my definition can be shortened a little (by sorting in order from largest coordinate to smallest):

#(define (last-bar grob)
   ;; return the X-coordinate of the last barline on a line
   (let* ((sys (ly:grob-system grob))
 (array (ly:grob-object sys 'all-elements))
 (grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
 (lst (filter (lambda (x) (eq? 'BarLine (grob-name x)))
                       (ly:grob-array->list array)))
 (bar-coords (sort (map (lambda (x) (cdr (ly:grob-extent x sys X))) lst) >)))
 
     (car bar-coords)))

Best,
David
 

reply via email to

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