lilypond-user
[Top][All Lists]
Advanced

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

Controlling vertical spacing exactly - mini HOWTO


From: Trevor Bača
Subject: Controlling vertical spacing exactly - mini HOWTO
Date: Wed, 17 Jan 2007 15:28:38 -0600

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
address@hidden

reply via email to

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