[Top][All Lists]

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

Re: length of staff lines in score with only spacer notes

From: Neil Puttock
Subject: Re: length of staff lines in score with only spacer notes
Date: Thu, 5 Nov 2009 22:58:12 +0000

2009/11/5 Reinhold Kainhofer <address@hidden>:
> If I have a score containing only an s8 spacer rest, the staff lines will
> always have the same length, no matter how wide the key/clef/time signatures
> are. As a consequence, in some cases the staff lines are way too short 
> (leaving
> to the time signature without staff lines) and in some cases they are too 
> long.
> Attached is an example.
> Any idea where the problem is and how it might be fixed?

I'm not sure why this happens, though it's something to do with SpacingSpanner.

As a workaround, you can get the extent of the prefatory items from
BreakAlignment, then use this to set the width of StaffSymbol:

\override StaffSymbol #'after-line-breaking =
#(lambda (grob)
   (let* ((system (ly:grob-system grob))
          (elts (ly:grob-object system 'elements))
          (break-alignment #f))

           (lambda (x)
             (let ((elt (ly:grob-array-ref elts x)))
               (if (grob::has-interface elt
                   (set! break-alignment elt))))
           (iota (ly:grob-array-length elts)))

          (if break-alignment
              (set! (ly:grob-property grob 'width)
                    (+ (ly:output-def-lookup (ly:grob-layout grob) 'indent)
                         (ly:grob-extent break-alignment system X) 0.4)))))))

> The other problem appears with the key signature, when you remove the
> Clef_engraver (because sometimes you only want to print the original key
> signature in an incipit of a critical edition): The key signature has no
> padding on the left, so it starts even a little bit before the staff lines...

Change the default spacing between LeftEdge and KeySignature:

\override Score.LeftEdge #'space-alist =
    #'((custos extra-space . 0.0)
     (ambitus extra-space . 2.0)
     (time-signature extra-space . 1.0)
     (staff-bar extra-space . 0.0)
     (breathing-sign minimum-space . 0.0)
     (clef extra-space . 0.8)
     (first-note fixed-space . 2.0)
     (right-edge extra-space . 0.0)
     (key-signature extra-space . 0.8)
     (key-cancellation extra-space . 0.0))


reply via email to

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