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 11:23:17 -0500

Hi Arno,

On Sat, Mar 23, 2013 at 10:29 AM, Arno Rog <address@hidden> wrote:
Hi David,

It sure does!!
With Lilypond 2.16.1 it is almost(!) at the outer right side of the staff,
there is still a little bit of staff visible after the final barline.

I just tried this with 2.16.1, and there is quite a noticeable difference in alignments.  (I was using 2.17.14 when I wrote the snippet.) 

Please ignore my ignorance but can I add a value 0.5 or 1.0 somewhere in
your code to nudge it a little to the right?

You could do this, but this would be covering over a problem with the function itself.  This rewrite seems to produce good alignment with 2.16.1:

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

This works with the ending barline you want to use, but if you try it with an ordinary barline, you'll see the bar very slightly to the left of where it ought to be.  I will drive myself nuts trying to figure out the right combination of blot-diameter, etc., so I'll leave it with this.  If anyone reading this knows the right calculations to generalize this, please let me know!

Best,
David

reply via email to

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