Discussion:
Controlling vertical spacing exactly - mini HOWTO
Trevor Bača
2007-01-17 21:28:38 UTC
Permalink
Hi,

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".

Proportional notation gives near-complete control of *horizontal*
spacing. Less obvious is the fact that the NonMusicalPaperColumn grob
gives similar control of *vertical* spacing. The relevant parameter is
the line-break-system-details attribute and the different values you
can assign to it.

Consider the following two-staff score with line-breaking information
entered in a dedicated voice.

%%% BEGIN EX 1 %%%

\version "2.11.7"

\new Score <<
\new Staff <<
\new Voice {
s1 * 6 \break
s1 * 6 \break
s1 * 6 \break
}
\new Voice { \repeat unfold 18 { c'4 c'4 c'4 c'4 } }
\new Staff {
\repeat unfold 18 { d'4 d'4 d'4 d'4 }
}
%%% END EX 1 %%%


Explicit \breaks evenly divide the music into six measures per line.
Vertical spacing results from Lily's defaults.

To set the vertical startpoint of each system explicitly, we can set
the Y-offset pair in the line-break-system-details attribute of the
NonMusicalPaperColumn grob:

%%% BEGIN EX 2 %%%

\version "2.11.7"

\new Score <<
\new Staff <<
\new Voice {
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 0))
s1 * 6 \break
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 40))
s1 * 6 \break
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 80))
s1 * 6 \break
}
\new Voice { \repeat unfold 18 { c'4 c'4 c'4 c'4 } }
\new Staff {
\repeat unfold 18 { d'4 d'4 d'4 d'4 }
}
%%% END EX 2 %%%

Note that line-break-system-details takes an alist of potentially many
values but that we set only one value here.

Now that we have set the vertical startpoint of each system
explicitly, we can also set the vertical startpoint of each staff
within each system manually. We do this using the alignment-offsets
pair which likewise assigns to the line-break-system-details:

%%% BEGIN EX 3 %%%

\version "2.11.7"

\new Score <<
\new Staff <<
\new Voice {
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 20)
(alignment-offsets . (0 -15)))
s1 * 6 \break
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 60)
(alignment-offsets . (0 -15)))
s1 * 6 \break
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 100)
(alignment-offsets . (0 -15)))
s1 * 6 \break
}
\new Voice { \repeat unfold 18 { c'4 c'4 c'4 c'4 } }
\new Staff {
\repeat unfold 18 { d'4 d'4 d'4 d'4 }
}
%%% END EX 3 %%%

Note that here we assign two different values to the
line-break-system-details attribute of the NonMusicalPaperColumn grob.
Though the line-break-system-details attribute alist accepts many
additional spacing parameters (including, for example, a corresponding
X-offset pair), we need only set the Y-offset and alignment-offsets
pairs to control the vertical startpoint of every system and every
staff.

WHO MIGHT FIND THIS USEFUL? As mentioned above, those working with
proportional notation. Also anyone adding complex graphics to LilyPond
output using Illustrator of Inkscape. And possibly also users making
either simple or complex charts or tables of music notation for
precomposition or music education.

WHAT MAKES THESE SETTINGS A LITTLE DIFFICULT TO FIND IN THE DOCS? Both
features entered the program during the 2.7 development series and are
documented in the 2.8 NEWS file here:
http://lilypond.org/doc/v2.8/Documentation/topdocs/NEWS.html. The only
tricky thing is identifying the two pairs that need to be set and
knowing that the values of those pairs may combine freely in the
line-break-system-details alist.

WHAT MAKES THESE SETTINGS DIFFICULT TO TYPE? Most grobs override with
the \override command. The NonMusicalPaperColumn grob overrides with
the special \overrideProperty command. The NonMusicalPaperColumn grob
also likes matching double-quotes as in \overrideProperty
"Score.NonMusicalPaperColumn". Matching double-quotes do not appear in
the overrides to most other grobs.
--
Trevor Bača
trevorba
Maximilian Albert
2007-01-18 01:37:41 UTC
Permalink
Hi Trevor, hi everyone,
Post by Trevor Bača
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 }
Maybe it would also be a good idea to mention that the numbers are
interpreted as multiples of the distance between adjacent staff lines
and that positive numbers move the staves/lyrics up and negative values
move them down (better to read it in the docs than having to cook up an
example to find out by trial and error).

Thanks again for your contribution! As I said, I strongly engourage you
to include it in the docs.

Cheers
Max
Trevor Bača
2007-01-30 23:04:01 UTC
Permalink
Post by Maximilian Albert
Hi Trevor, hi everyone,
Post by Trevor Bača
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
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 ...
Post by Maximilian Albert
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.)
Graham Percival
2007-01-19 00:23:59 UTC
Permalink
Post by Trevor Bača
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".
Definitely. I don't think you need to make many changes; I'd get rid of
the capital-letter sections at the end, though. Or integrate that
material into the rest of stuff.

In the future, it's safest if you cc'd potential doc stuff to the -devel
list, since I don't read -user in any great detail these days.

Cheers,
- Graham
Trevor Bača
2007-01-19 00:56:59 UTC
Permalink
Post by Graham Percival
Post by Trevor Bača
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".
Definitely. I don't think you need to make many changes; I'd get rid of
the capital-letter sections at the end, though. Or integrate that
material into the rest of stuff.
In the future, it's safest if you cc'd potential doc stuff to the -devel
list, since I don't read -user in any great detail these days.
Cool, on both counts.

I'll touch up and resend to -devel and your mail.
--
Trevor
Trevor Bača
2007-01-31 00:30:32 UTC
Permalink
Post by Graham Percival
Post by Trevor Bača
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".
Definitely. I don't think you need to make many changes; I'd get rid of
the capital-letter sections at the end, though. Or integrate that
material into the rest of stuff.
In the future, it's safest if you cc'd potential doc stuff to the -devel
list, since I don't read -user in any great detail these days.
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
}

My analysis of this type of vertical spacing control is that what
we're really doing here is mostly setting *padding* in different
guises. We're not really saying "this staff should be so far away from
this other staff; and then this system should be so far away from this
other system further down the page". Instead we're saying "I want at
least this much padding between these staves or between these systems;
beyond those padding specifications, just let Lily figure out what to
do." So we might term this padding-based way of thinking about
vertical spacing something like "permissive". And an interesting
characteristic of this way of tweaking vertical spacing is that -- I
think -- you can *not* cause staves or systems to *overlap*. And this
relates to the primary disadvantage of using VerticalAxisGroup
overrides (and paper and margin adjustments) to control vertical
spacing: it can sometimes seem frustratingly difficult to draw staves
or systems close enough together.[1]

[1] Feel free to contradict me here; Is it possible to cause staff- or
system-overlaps using the commands given in 11.1 and 11.3? And maybe I
was alone in my experience of feeling frustrated trying to game
VerticalAxisGroup to move staves closer together.

The second model for controlling vertical spacing centers around
NonMusicalPaperColumn line-break-system-details, is very lightly
touched on in 11.4, and concerns commands like:

\overrideProperty
#"Score.NonMusicalPaperColumn"
#'line-break-system-details
#'((alignment-offsets . (0 -5 -20)))

\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 20)
(alignment-offsets . (0 -15)))

\overrideProperty
#"Score.NonMusicalPaperColumn"
#'line-break-system-details
#'((fixed-alignment-extra-space . 15))

These overrides to line-break-system-details might be termed the
"strict" (or "control freak") approach to vertical spacing (as opposed
to the traditional, more "permissive" approach) because what we're
doing with these settings is saying "I want control here; start this
staff at exactly this vertical offset and then start this staff at
this vertical offset and finally put this staff at this vertical
offset; the vertical spacing that results is whatever results and I
don't even care if there are overlaps; just do what I say; oh and same
with the systems, too". If we want to be precise, we might even point
out that these overrides to line-break-system-details don't so much
control the spacing *between* staves and systems so much as the exact
vertical *positions at which* staves and systems begin on the page
(with the vertical spacing just a side-effect of these explicit
positioning commands).

The advantages and disadvantages to the line-break-system-details
approach to vertical spacing are pretty much what we would expect
versus the VerticalAxisGroup approach: line-break-system-details makes
it extremely easy to draw staves and system quite close to each other
but does indeed allow for staff or system overprinting.

So, to sum up this first point: it seems to me that there are two
different approaches to controlling vertical spacing: by
VerticalAxisGroup + paper settings or else by
line-break-system-details. These two methods aren't so much at odds
with each other as in a kind of cascade relationship: you can make
whatever VerticalAxisGroup + paper settings you want, but any
overrides to line-break-system-dettails will have the last say. Seems
relatively important to keep the relationship between these
"permissive" and "strict" approaches in mind to see what your vertical
spacing tweaks are really doing in any one particular score.

(One last parenthetical distinction is this: overrides to
VerticalAxisGroup will almost always be context-global and appear in
the with-block whereas overrides to line-break-system-details will
almost always appear inter alia in the middle of music input just
after an explicit \break command. So this suggests that maybe
"permissive" and "strict" might also be termed "global" and "local"
... but that pair of terms seems much less descriptive somehow.)


Second major concept running through the vertical spacing stuff is the
PianoStaff / nonPianoStaff dichotomy.

There's another thread active right now on the topic of whether
PianoStaff really needs to be special with regards to vertical spacing
at all. But for now PianoStaff is special with regards to vertical
spacing. This complicates the vertical spacing docs simply because
PianoStaff overrides introduce a new set of properties, viz 11.3.2 and
11.3.4:

\override VerticalAlignment #'forced-distance = #7

\overrideProperty
#"Score.NonMusicalPaperColumn"
#'line-break-system-details
#'((fixed-alignment-extra-space . 15))

(IMO, possibly the best reason to remove the specialness of PianoStaff
with regards to fixed spacing is to clean up this part of the docs.)

So these are the two different dichotomies I see in the background of
any decisions (or docs) on vertical spacing: which "method" to use
(either "permissive" with VerticalAxisGroup or "strict" with
line-break-system-details) and then PianoStaff / nonPianoStaff. The
dichotomies are completely orthogonal: whether you decide to use
"permissive" or "strict" vertical spacing, you still must be
constantly aware of whether you're setting spacing for a PianoStaff or
not and select properties to override accordingly.

* * *

So I guess my point in all this is to see if anyone resonates with
this way of looking at user control of vertical spacing. Perhaps all
this is quite obvious, but it certainly took me a good while to figure
out.

Thoughts?

If we do like this way of thinking about vertical spacing then I'll
probably reorganize chapter 11 into three parts (permissive, strict,
two-pass); the section on permissive vertical spacing will cover
nonPianoStaff syntax first and then PianoStaff staff syntax second, as
will the section on strict vertical spacing.
--
Trevor Bača
tre
Trent Johnston
2007-01-31 01:32:47 UTC
Permalink
Hi Trevor and all,

I've been watching your thread on controlling vertical space as I'm very
interested in this area.

Joe Neeman gave me the following advice early in January of putting the
"strict" control into the layout blook as follows:

\layout {
\context { \Score \override NonMusicalPaperColumn
#'line-break-system-details = #'((alignment-offsets . (0 -15 -30 ))) }
}

he went on to say:

"If you want to change it mid-piece, you can use \override instead of
\overrideProperty, but I think you have to do the \override one timestep
before you want it to take effect."

I've been using the "layout block" method of controlling vertial spacing in
the Handel opera I'm typesetting. This is an easier way than inputting after
every line break which can be frustrating if the page layout changes or the
score is large and takes a long time to compile with each change. You can
also change spacing for those systems that require a little more or less
space. For the most part I haven't needed to change vertical spacing
mid-score except in one instance and that was only for 2 systems instead the
4.

I hope that this can help others as well.

Trent

P.S. The one thing I can't figure out is what the numbers refer to. Are they
staff spaces as in what you would using in overriding minimum-Y-extent? I
seem to be using larger numbers than what I would use when setting
minimum-Y-extent..


----- Original Message -----
From: "Trevor Bača" <***@gmail.com>
To: "Graham Percival" <***@gmail.com>; "Maximilian Albert"
<***@gmx.de>
Cc: "lilypond-user" <lilypond-***@gnu.org>; "lilypond-devel"
<lilypond-***@gnu.org>
Sent: Wednesday, January 31, 2007 11:30 AM
Subject: Re: Controlling vertical spacing exactly - mini HOWTO
Post by Trevor Bača
Post by Graham Percival
Post by Trevor Bača
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".
Definitely. I don't think you need to make many changes; I'd get rid of
the capital-letter sections at the end, though. Or integrate that
material into the rest of stuff.
In the future, it's safest if you cc'd potential doc stuff to the -devel
list, since I don't read -user in any great detail these days.
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
}
My analysis of this type of vertical spacing control is that what
we're really doing here is mostly setting *padding* in different
guises. We're not really saying "this staff should be so far away from
this other staff; and then this system should be so far away from this
other system further down the page". Instead we're saying "I want at
least this much padding between these staves or between these systems;
beyond those padding specifications, just let Lily figure out what to
do." So we might term this padding-based way of thinking about
vertical spacing something like "permissive". And an interesting
characteristic of this way of tweaking vertical spacing is that -- I
think -- you can *not* cause staves or systems to *overlap*. And this
relates to the primary disadvantage of using VerticalAxisGroup
overrides (and paper and margin adjustments) to control vertical
spacing: it can sometimes seem frustratingly difficult to draw staves
or systems close enough together.[1]
[1] Feel free to contradict me here; Is it possible to cause staff- or
system-overlaps using the commands given in 11.1 and 11.3? And maybe I
was alone in my experience of feeling frustrated trying to game
VerticalAxisGroup to move staves closer together.
The second model for controlling vertical spacing centers around
NonMusicalPaperColumn line-break-system-details, is very lightly
\overrideProperty
#"Score.NonMusicalPaperColumn"
#'line-break-system-details
#'((alignment-offsets . (0 -5 -20)))
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 20)
(alignment-offsets . (0 -15)))
\overrideProperty
#"Score.NonMusicalPaperColumn"
#'line-break-system-details
#'((fixed-alignment-extra-space . 15))
These overrides to line-break-system-details might be termed the
"strict" (or "control freak") approach to vertical spacing (as opposed
to the traditional, more "permissive" approach) because what we're
doing with these settings is saying "I want control here; start this
staff at exactly this vertical offset and then start this staff at
this vertical offset and finally put this staff at this vertical
offset; the vertical spacing that results is whatever results and I
don't even care if there are overlaps; just do what I say; oh and same
with the systems, too". If we want to be precise, we might even point
out that these overrides to line-break-system-details don't so much
control the spacing *between* staves and systems so much as the exact
vertical *positions at which* staves and systems begin on the page
(with the vertical spacing just a side-effect of these explicit
positioning commands).
The advantages and disadvantages to the line-break-system-details
approach to vertical spacing are pretty much what we would expect
versus the VerticalAxisGroup approach: line-break-system-details makes
it extremely easy to draw staves and system quite close to each other
but does indeed allow for staff or system overprinting.
So, to sum up this first point: it seems to me that there are two
different approaches to controlling vertical spacing: by
VerticalAxisGroup + paper settings or else by
line-break-system-details. These two methods aren't so much at odds
with each other as in a kind of cascade relationship: you can make
whatever VerticalAxisGroup + paper settings you want, but any
overrides to line-break-system-dettails will have the last say. Seems
relatively important to keep the relationship between these
"permissive" and "strict" approaches in mind to see what your vertical
spacing tweaks are really doing in any one particular score.
(One last parenthetical distinction is this: overrides to
VerticalAxisGroup will almost always be context-global and appear in
the with-block whereas overrides to line-break-system-details will
almost always appear inter alia in the middle of music input just
after an explicit \break command. So this suggests that maybe
"permissive" and "strict" might also be termed "global" and "local"
... but that pair of terms seems much less descriptive somehow.)
Second major concept running through the vertical spacing stuff is the
PianoStaff / nonPianoStaff dichotomy.
There's another thread active right now on the topic of whether
PianoStaff really needs to be special with regards to vertical spacing
at all. But for now PianoStaff is special with regards to vertical
spacing. This complicates the vertical spacing docs simply because
PianoStaff overrides introduce a new set of properties, viz 11.3.2 and
\override VerticalAlignment #'forced-distance = #7
\overrideProperty
#"Score.NonMusicalPaperColumn"
#'line-break-system-details
#'((fixed-alignment-extra-space . 15))
(IMO, possibly the best reason to remove the specialness of PianoStaff
with regards to fixed spacing is to clean up this part of the docs.)
So these are the two different dichotomies I see in the background of
any decisions (or docs) on vertical spacing: which "method" to use
(either "permissive" with VerticalAxisGroup or "strict" with
line-break-system-details) and then PianoStaff / nonPianoStaff. The
dichotomies are completely orthogonal: whether you decide to use
"permissive" or "strict" vertical spacing, you still must be
constantly aware of whether you're setting spacing for a PianoStaff or
not and select properties to override accordingly.
* * *
So I guess my point in all this is to see if anyone resonates with
this way of looking at user control of vertical spacing. Perhaps all
this is quite obvious, but it certainly took me a good while to figure
out.
Thoughts?
If we do like this way of thinking about vertical spacing then I'll
probably reorganize chapter 11 into three parts (permissive, strict,
two-pass); the section on permissive vertical spacing will cover
nonPianoStaff syntax first and then PianoStaff staff syntax second, as
will the section on strict vertical spacing.
--
Trevor Bača
--------------------------------------------------------------------------------
Post by Trevor Bača
_______________________________________________
lilypond-user mailing list
http://lists.gnu.org/mailman/listinfo/lilypond-user
Trevor Bača
2007-01-31 04:53:28 UTC
Permalink
Post by Trent Johnston
Hi Trevor and all,
I've been watching your thread on controlling vertical space as I'm very
interested in this area.
Joe Neeman gave me the following advice early in January of putting the
\layout {
\context { \Score \override NonMusicalPaperColumn
#'line-break-system-details = #'((alignment-offsets . (0 -15 -30 ))) }
}
"If you want to change it mid-piece, you can use \override instead of
\overrideProperty, but I think you have to do the \override one timestep
before you want it to take effect."
Hi Trent,

Ah, right. I'd forgotten that you can \override the
NonMusicalPaperColumn grob globally for an entire context (which is
why all the examples I'd put into the thread so far show the
NonMusicalPaperColumn grob being overriden with \overrideProperty in
the middle of note input).

(FWIW, I think the same breadcrumb appears in the
alignment-vertical-spacing.ly reg test comments, viz: For technical
reasons, overrideProperty has to be used for setting properties on
individual object. \override in a \context block may still be used for
global overrides.)

I'm sure you already know that context settings in the layout-block
are equivalent to context settings in the with-block. But here's an
example just in case:

%%% WITH-BLOCK BEGIN %%%

\version "2.11.14"

\layout { indent = #0 }

\new Score \with {
\override NonMusicalPaperColumn
#'line-break-system-details = #'((alignment-offsets . (0 -15)))
} <<
\new Staff {
\repeat unfold 18 { c'4 c'4 c'4 c'4 }
}
\new Staff {
\repeat unfold 18 { d'4 d'4 d'4 d'4 }
}
%%% END %%%

I'm a huge fan of with-blocks :-)
Post by Trent Johnston
P.S. The one thing I can't figure out is what the numbers refer to. Are they
staff spaces as in what you would using in overriding minimum-Y-extent? I
seem to be using larger numbers than what I would use when setting
minimum-Y-extent.
Maybe it would also be a good idea to mention that the numbers are
interpreted as multiples of the distance between adjacent staff lines
and that positive numbers move the staves/lyrics up and negative values
move them down (better to read it in the docs than having to cook up an
example to find out by trial and error).

I haven't tested this myself, but it certainly sounds right
Joe Neeman
2007-01-31 08:36:44 UTC
Permalink
Post by Trevor Bača
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
Yes, I think this is a good way of explaining it.
Post by Trevor Bača
And an interesting
characteristic of this way of tweaking vertical spacing is that -- I
think -- you can *not* cause staves or systems to *overlap*. And this
relates to the primary disadvantage of using VerticalAxisGroup
overrides (and paper and margin adjustments) to control vertical
spacing: it can sometimes seem frustratingly difficult to draw staves
or systems close enough together.[1]
In the 2.11 branch, systems will interleave with one another so you
will get tighter vertical spacing. However, you cannot make them
overlap in the sense that things will print on top of each other. Note
that overriding Y-extent (as suggested by someone further down in the
thread) will no longer work.
Post by Trevor Bača
Second major concept running through the vertical spacing stuff is the
PianoStaff / nonPianoStaff dichotomy.
There's another thread active right now on the topic of whether
PianoStaff really needs to be special with regards to vertical spacing
at all. But for now PianoStaff is special with regards to vertical
spacing. This complicates the vertical spacing docs simply because
PianoStaff overrides introduce a new set of properties, viz 11.3.2 and
\override VerticalAlignment #'forced-distance = #7
This will be removed in 2.11
Post by Trevor Bača
\overrideProperty
#"Score.NonMusicalPaperColumn"
#'line-break-system-details
#'((fixed-alignment-extra-space . 15))
as will this. In addition (I think it was mentioned somewhere in this
thread), two Staves inside a PianoStaff will be treated as _two_
staves for the purposes of line-break-system-details instead of one as
they are currently.
Post by Trevor Bača
If we do like this way of thinking about vertical spacing then I'll
probably reorganize chapter 11 into three parts (permissive, strict,
two-pass); the section on permissive vertical spacing will cover
nonPianoStaff syntax first and then PianoStaff staff syntax second, as
will the section on strict vertical spacing.
Two-pass spacing will hopefully be going away soon, too. We can do
these things in one-pass now. I can't tell you exactly when it will be
done, but the main tweaking property (a permissive property) will be
Score.VerticalAlignment #'max-stretch. You can set it to zero if you
want a system to be tightly spaced or to a large number if you want
the system to be spaced so that it fills the page. Note that the
stretching is done after page-breaking, so it won't make you use up
any extra pages.

Loading...