[Lilypond] Optical spacing

Recommendations concerning notation and publishing software in a non-partisan environment.
Post Reply
User avatar
OCTO
Posts: 1742
Joined: 05 Oct 2015, 06:52
Location: Sweden

[Lilypond] Optical spacing

Post by OCTO »

Split theme from another thread.
tisimst wrote:
OCTO wrote:I wonder if the optical spacing in M26 / RH / beat 1 / voice 2 - is done automatically?
Thanks, OCTO! Yes, the optical spacing is automatic, but can be turned on/off at-will.
shot 3.jpg
shot 3.jpg (14.76 KiB) Viewed 5448 times
What is programming setting-rule of the optical spacing in LP?
User avatar
tisimst
Posts: 416
Joined: 08 Oct 2015, 17:57
Location: UT, USA
Contact:

Re: [Lilypond] Optical spacing

Post by tisimst »

OCTO wrote:
tisimst wrote:Yes, the optical spacing is automatic, but can be turned on/off at-will.
What is programming setting-rule of the optical spacing in LP?
LilyPond's optical spacing is governed by a handful of tweakable properties. Normally, spacing is NOT truly proportional, but more generally based on the width of the black notehead (NHW). Thus, the duration that is deemed "most common" in a passage will have a minimum horizontal space of 1 NHW between symbols. For example, if a quaver ( :3 ) is the "most common" duration, then a crotchet ( :4 ) will be spaced by 2 NHW, a minim ( :5 ) is spaced with 3 NHW, etc. For shorter durations, the horizontal spacing is proportional to duration. Thus, a semiquaver ( :2 ) gets 1/2 NHW, etc. If the measure needs to stretch to help fill up a system, the individual spaces are scaled by the same amount.

Localized spacing corrections are done by the NoteSpacing object, which accounts for the following:

- Spacing of notes between kneed beams (or cross-staff beams) where stems are both up and down and the beam is between them.
- Spacing of notes when the stems are the same direction
- Spacing of notes when the stems are in opposing directions

For more global tweaks, the SpacingSpanner object takes care of that with a handful of properties, including:

- Uniform spacing, which means that spaces between notes will stretch proportionally to their natural separation based on durations. This looks better in complex polyphonic patterns.

- Strict note spacing, which means that "musical" symbols (e.g., notes, accidentals) are given spacing priority over "non-musical" symbols (e.g., clefs)

- Strict grace note spacing, which means that the notes that grace notes are attached to are given spacing priority, thus moving grace notes more left than they would normally be.

There is also a general Score property called "proportionalNotationDuration" which is useful for turning on truly proportional spacing, meaning that the horizontal space a minim takes up is the same as 4 quavers.

There are other things about how or why some decisions are made that I don't understand yet, but hopefully that helps a little.
Music Typeface Designer & Engraver - LilyPond | Sibelius | Finale | MuseScore | Dorico | SMuFL | Inkscape | FontForge
uliska
Posts: 2
Joined: 08 Oct 2015, 21:00

Re: [Lilypond] Optical spacing

Post by uliska »

Post Reply