lilypond-user
[Top][All Lists]
Advanced

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

Re: barline at end of staff


From: David Nalesnik
Subject: Re: barline at end of staff
Date: Sat, 23 Mar 2013 09:26:37 -0500

Hi Arno,

On Sat, Mar 23, 2013 at 8:59 AM, Arno Rog <address@hidden> wrote:
Arno Rog <arno.rog <at> gmail.com> writes:

>
Below a MWE of what I am trying to achieve (mind the wordwrap)
I hope someone has a solution to automatically place it at the end
of the staff, irrespective of the width of the staff.

I'd like to have the last barline exactly at the end of the last staff
without having to trial and error with the extra offset paramater.

The following override still uses 'extra-offset, but the values are set automatically:

 \override Staff.BarLine #'extra-offset = #(lambda (grob)
    (let* ((refp (ly:grob-system grob))
           (blot (ly:output-def-lookup (ly:grob-layout grob) 'blot-diameter))
           (staff (ly:grob-object grob 'staff-symbol))
           (staff-X (ly:grob-extent staff staff X))
           (bar-extent-X (ly:grob-extent grob grob X))
           (current-X (ly:grob-relative-coordinate grob refp X)))
      (cons (- (cdr staff-X) current-X (interval-length bar-extent-X) (- blot))
            0)))

HTH,
David

reply via email to

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