lilypond-user
[Top][All Lists]
Advanced

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

Re: Controlling vertical spacing exactly - mini HOWTO


From: Trevor Bača
Subject: Re: Controlling vertical spacing exactly - mini HOWTO
Date: Tue, 30 Jan 2007 17:04:01 -0600

On 1/17/07, Maximilian Albert <address@hidden> wrote:
Hi Trevor, hi everyone,

> The following might be of interest to folks using proportional
> notation. If there's any general interest (of if Graham wants it to be
> so) then I'll retype the following as an addition to 11.3.4
> "Controlling spacing of individual systems".

Awesome!! This is exactly what I thought might be of use to many people.
I only recently discovered the "alignment-offsets" property somewhere in
the regression tests and found it to be of great use. For some reason I
missed "Y-extent", though, and am more than happy to learn about it from
your email because it provides precisely the functionality I felt was
missing. I am sure it would be of great value to have it in the docs and
strongly encourage you to retype and include it. One suggestion, though:
I thing using _different_ values of "Y-offset"/"alignment-offsets" for
different staves better emphasizes the effect it has on the output.


Another thing which I think should not go unmentioned because it drove
me nearly mad and which I considered a bug until I found out the correct
behaviour: If you have lyrics with the music then the lyrics lines
behave like staves of their own with respect to alignment-offsets. For
example if you have an upper and a lower staff, each with lyrics beneath
them, then the four numbers in alignment-offsets control the vertical
position of the first staff, the first lyrics line, the second staff and
the second lyrics line, respectively (by the way, is there a
setting/property which controls the distance of lyrics and the
corresponding staff? I found it to require a certain amount of tweaking
to get the "correct" distance from lyrics to staff when manually setting
alignment-offsets; it would be nice to at least know some default
distance). Here is a small code example illustrating the aforementioned
behaviour.


%% Example of alignment-offsets with lyrics
%\version "2.11.10"  % on Debian Linux
\paper{ ragged-right = ##t }

<<
{ \overrideProperty #"Score.NonMusicalPaperColumn"
                    #'line-break-system-details
                    #'((alignment-offsets . (0 -10 -30 -65)))
  c'1
}
\addlyrics { one }

{ e'1 }
\addlyrics { two }
>>

Hi Max,

I'm finally getting around to retyping the line-break-system-details
examples and I was just revisiting your mail. Your comment here ...

Another thing which I think should not go unmentioned because it drove
me nearly mad and which I considered a bug until I found out the correct
behaviour: If you have lyrics with the music then the lyrics lines
behave like staves of their own with respect to alignment-offsets.

... made me investigate the behavior of alignment-offsets against
nested contexts like StaffGroup and the special context PianoStaff.
Here are the examples.


%%% EX 3 with StaffGroup %%%

\version "2.11.14"

\layout { indent = #0 }

\new Score <<
 \new Staff <<
    \new Voice {
       \overrideProperty #"Score.NonMusicalPaperColumn"
       #'line-break-system-details #'((Y-offset . 0)
(alignment-offsets . (0 -30 -40)))
       s1 * 6 \break
       \overrideProperty #"Score.NonMusicalPaperColumn"
       #'line-break-system-details #'((Y-offset . 60)
(alignment-offsets . (0 -10 -20)))
       s1 * 6 \break
       \overrideProperty #"Score.NonMusicalPaperColumn"
       #'line-break-system-details #'((Y-offset . 100)
(alignment-offsets . (0 -10, -40)))
       s1 * 6 \break
    }
    \new Voice { \repeat unfold 18 { c'4 c'4 c'4 c'4 } }
 >>
 \new StaffGroup <<
    \new Staff {
       \repeat unfold 18 { d'4 d'4 d'4 d'4 }
    }
    \new Staff {
       \repeat unfold 18 { e'4 e'4 e'4 e'4 }
    }
 >>


%%% END EX 3 %%%


And here's the exact same example with only the word "StaffGroup"
changed to "PianoStaff"; quite a difference:

%%% BEGIN EX 4 with PianoStaff %%%

\version "2.11.14"

\layout { indent = #0 }

\new Score <<
 \new Staff <<
    \new Voice {
       \overrideProperty #"Score.NonMusicalPaperColumn"
       #'line-break-system-details #'((Y-offset . 0)
(alignment-offsets . (0 -30 -40)))
       s1 * 6 \break
       \overrideProperty #"Score.NonMusicalPaperColumn"
       #'line-break-system-details #'((Y-offset . 60)
(alignment-offsets . (0 -10 -20)))
       s1 * 6 \break
       \overrideProperty #"Score.NonMusicalPaperColumn"
       #'line-break-system-details #'((Y-offset . 100)
(alignment-offsets . (0 -10, -40)))
       s1 * 6 \break
    }
    \new Voice { \repeat unfold 18 { c'4 c'4 c'4 c'4 } }
 >>
 \new PianoStaff <<
    \new Staff {
       \repeat unfold 18 { d'4 d'4 d'4 d'4 }
    }
    \new Staff {
       \repeat unfold 18 { e'4 e'4 e'4 e'4 }
    }
 >>


%%% END EX 4 %%%


So my conclusion is that alignment-offsets works against ...

* staves (which is clear)
* lyrics (as you point out)
* the individual staves inside StaffGroup (which makes sense)

... but NOT against the individual staves inside PianoStaff (which
makes sense because it's well-documented in 11.3.2 that PianoStaff is
specially resistent to most spacing overrides because of the way
cross-staff beams are handled ... at least for now).

I'd be curious to know if alignment-offsets works against chords and
figured bass in the same way that alignment-offsets works against
lyrics; my guess is yes since I remember discussion on the list
pointing out that the chords and figured bass contexts derive from
lyrics, but I'm too lazy to actually cook up any examples and test.

(If anyone does test chords or figured bass against alignment-offsets,
let me know and I'll add to the examples.)


--
Trevor Bača
address@hidden

reply via email to

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