Thanks to those who suggested improvements. The following, and
some more experiments, reflects them - I think it's ready for the
refman now.
John

---------------------------------

Global Note Spacing

The space taken by a note is determined by two parameters. The
space between notes is proportional to arithmetic_multiplier, and
the ratio of the space between long notes and short notes in the
same measure (bar) is based on arithmetic_basicspace. By default

arithmetic_basicspace= 2.;
arithmetic_multiplier = 0.9 * \quartwidth;

and for the default 20 point staff,

quartwidth = 6.61 \pt;

So, to double the space between all notes, set

arithmetic_multiplier =1.8 * \quartwidth;

in the paper block.

To make long and short note spaces more closely equal within
measures, increase arithmetic_basicspace. A value of 4. will
approximately halve the difference between notes of different
lengths compared to the default value of 2. However, a_b
interacts with a_m - a_m must be reduced as a_b is increased.

arithmetic_basicspace= 4.;
arithmetic_multiplier = 0.5 * \quartwidth;

works, for example.

After 'arithmetic' note spacing is done as above, measure by
measure, all spacings in each score line are increased or reduced
as required to justify the line. The justification scheme depends
on the version of Lily, and will cover up small changes in a_b
and a_m.

Horizontal note shifts

Lilypond always arranges note heads on alternate sides of a stem
(that is, within a single voice) as necessary to prevent
collisions (note head overlaps) - the upper note of a colliding
pair is placed on the right side of the stem, the lower on the
left.

Lily also attempts to prevent collisions of note heads in
different voices. She defines an collision as two or more voices
occupying the same horizontal position (column) on one staff. By
default, if only two voices are in this 'collision group', one of
the voices is  shifted by \quartwidth if there are unisons or
seconds between the voices. 

If there are more than two voices in a collision group, shifting
is inactive by default. To activate it, Lily must be told the
priority for shifting of the various voices. This is done with

\property Voice.horizontalNoteShift = <n>

where n is a different integer (0,1,2,...) for each voice. Then,
all note heads in collision groups (not just unisons and seconds)
will be offset, one voice relative another, in this manner:

    |
    |  | 
   0u  |  |
      1u  |
         2u

   2d
   |  1d
   |  |  0d
      |  |
         |

(0,1,2,.. = V.hNS value; u,d = stem up / stem down)

The amount of collision shift is set by
Voice.forceHorizontalShift, which defaults to 1.0 (in units of
\quartwidth), but may be set to any desired value independently
for each voice. The only way of deactivating all collision
shifting is to set V.fHS to zero. So, to take control of note
position shifts in complex passages, specify

\property Voice.horizontalNoteShift = <n>
\property Voice.forceHorizontalShift = "0.0"

at the start of each voice, set V.fHS to a suitable value before
each note that really needs it (unisons and seconds), then reset
it to 0.0 after the note.   Identifiers such as

zs = {\property Voice.forceHorizontalShift = "0.0"}

are useful, of course. 

\quartwidth is the width of the largest notehead used by Lily,
1.5 times the width of a quarternote head. To offset colliding
quarternote seconds so they are just separate, set V.fHS = "0.61"
or "-0.61" in one of the colliding voices. Determine the values
for other collisions by experiment as needed.

Note that V.fHS does not force a shift - only note heads in
colliding columns will be shifted.

Reply via email to