lilypond-devel
[Top][All Lists]
Advanced

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

Re: Controlling vertical spacing exactly - mini HOWTO


From: Daniel Johnson
Subject: Re: Controlling vertical spacing exactly - mini HOWTO
Date: Tue, 30 Jan 2007 16:46:42 -0800 (PST)
User-agent: SquirrelMail/1.4.8

> Hi Graham & Max (and everyone),
>
> I've been reading through chapter 11 on vertical spacing and getting
> some vertical spacing examples ready for the manual.
>
> And on reflection I think I've now figured out why it's been tricky
> for me to get a good conceptual handle on vertical spacing. So I'd
> like to bounce two ideas off of you guys and see if the way that I'm
> thinking about the problem makes sense.
>
> 1. First, it seems that there are two *different* models for
> controlling vertical spacing, which we might term "permissive" and
> "strict", respectively. The first model corresponds roughly to chapers
> 11.3.1 and 11.3.3, and concerns overrides to VerticalAxisGroup and
> settings in the paper block like
>
>   \override Staff.VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
>
>   \paper {
>      between-system-space = 1.5\cm
>      between-system-padding = #1
>      ragged-bottom=##f
>      ragged-last-bottom=##f
>   }

<snip>

Hi Trevor,

There is a way I've found to make the VerticalAxisGroup stuff strict.  It
roughly involves the following:

\override Staff.VerticalAxisGroup #'minimum-Y-extent = ##f
\override Staff.VerticalAxisGroup #'Y-extent = #'(-3 . 3)

Sometime in the 2.7 dev cycle this started to cause misaligned beams, and
someone was kind enough to point me in the direction of a fix, which I've
incorporated into a Scheme function.  I don't know if this bug still
exists, but I've just gotten used to including this function whenever I
want to set absolute staff distances (for two-staff choral scores, for
example). I can verify that it works with the 2.10 series.

Usage:
\include "set-y-extent.ly"
\new Staff {
  \setYextent #'(-3 . 3)
  a' b' c'' d''
}

And the function itself:

setYextent = #(define-music-function (parser location yExtent)
                                     (pair?)
  (make-music
    'SequentialMusic
    'elements
    (list (make-music
            'ContextSpeccedMusic
            'property-operations
            '()
            'context-type
            'Staff
            'element
            (make-music
              'OverrideProperty
              'grob-property-path
              (list (quote minimum-Y-extent))
              'grob-value
              #f
              'symbol
              'VerticalAxisGroup
              'pop-first
              #t))
          (make-music
            'ContextSpeccedMusic
            'property-operations
            '()
            'context-type
            'Staff
            'element
            (make-music
              'OverrideProperty
              'grob-property-path
              (list (quote Y-extent))
              'grob-value
              (lambda (g)
               (begin
                 (ly:axis-group-interface::height g)
                 yExtent))
              'symbol
              'VerticalAxisGroup
              'pop-first
              #t)))))





reply via email to

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