LilyPond Regression Tests

Introduction

This document presents proofs for
LilyPond 2.19.17. When the
text corresponds with the shown notation, we consider LilyPond Officially
BugFree (tm). This document is intended for finding bugs and for
documenting bugfixes.

In the web version of this document, you can click on the file name
or figure for each example to see the corresponding input file.

TODO: order of tests (file names!), test only one feature per test.
Smaller and neater tests.

When two (or more) accidentals modify the same pitch,
they are printed adjacent to one another unless they represent the same
alteration, in which case they are printed in exactly the same position
as one another. In either case, collisions with accidentals of different
pitches are correctly computed.

This shows how modern cross voice auto cautionary accidentals are handled.
The first two fisses get accidentals because they belong to different voices.
The first f gets cautionary natural because of previous measure.
The last f gets cautionary natural because fis was only in the other voice.

Cues are often used at or near the beginning of a piece. Furthermore,
a cue is frequently in a different clef, so the
\cueDuringWithClef command is handy. Using this command at
the beginning of a piece should leave the ambitus displayed based
on the main clef.

The gaps between an AmbitusLine and its
note heads are set by the gap property. By default,
gap is a function that reduces the gap for small intervals
(e.g. a fourth), so that the line remains visible.

Accidentals only show up if they’re not part of key
signature. AmbitusNoteHead grobs also have ledger lines.
The noteheads are printed in overstrike, so there’s only one
visible; the accidentals are prevented from colliding.

The Bärenreiter edition of the Cello Suites is the
most beautifully typeset piece of music in our collection of music (we
both own one. It is also lovely on French Horn). This piece does not
include articulation, but it does follows the same beaming and
linebreaking as the printed edition. This is done in order to
benchmark the quality of the LilyPond output.

As of lilypond 1.5.42, the spacing and beam quanting is almost
identical.

There are two tweaks in this file: a line-break was forced before
measure 25, we get back the linebreaking of Bärenreiter. The stem
direction is forced in measure 24. The last beam of that measure is up
in Bärenreiter because of context. We don’t detect that yet.

Note that the Bärenreiter edition contains a few engraving
mistakes. The second line begins with measure 6 (but prints 5). The |:
half way in measure 13 has been forgotten.

Bar line extent can be customised and the customised value
must be respected when staff symbol is changed temporarily (e.g. to
simulate ledger lines of renaissance prints and manuscripts);
moreover, span bars should not enter the staves.

Fully concave beams should be horizontal. Informally spoken,
concave refers to the shape of the notes that are opposite a
beam. If an up-beam has high notes on its center stems, then we call
it concave.

Beams should behave reasonably well, even under extreme circumstances.
Stems may be short, but noteheads should never touch the beam. Note that
under normal circumstances, these beams would get knees. Here
Beam.auto-knee-gap was set to false.

In complex configurations of knee beaming, according to
Paul Roberts, the first stem of a beam determines the direction of the
beam, and as such the way that following (kneed) stems attach to the
beam. This is in disagreement with the current algorithm.

Kneed beams (often happens with cross-staff beams)
should look good when there are multiple beams: all the beams should
go on continuously at the staff change. Stems in both staves reach up
to the last beam.

Beams on ledgered notes should always reach the middle staff
line. The second beam, counting from the note head side, should never
be lower than the second staff line. This does not hold for grace
note beams. Override with no-stem-extend.

Gregorian chant notation sometimes also uses commas and ticks, but in
smaller font size (we call it ‘virgula’ and ‘caesura’). However, the
most common breathing signs are divisio minima/maior/maxima and
finalis, the latter three looking similar to bar glyphs.

LilyPond knows that breves and longas are wider than whole notes
(because of vertical lines on their sides). Breves and longas don’t collide
with accidentals, barlines, neighbor notes etc. The distance between
accidental and note is the same for whole notes, breves and longas.

The english naming of chords (default) can be changed to german
(\germanChords replaces B and Bes to H and B), semi-german
(\semiGermanChords replaces B and Bes to H and Bb), italian
(\italianChords uses Do Re Mi Fa Sol La Si), or french
(\frenchChords replaces Re to Ré).

Chord tremolos look like beams, but are a kind of repeat symbol.
To avoid confusion, chord tremolo beams do not reach the stems, but
leave a gap. Chord tremolo beams on half notes are not ambiguous,
as half notes cannot appear in a regular beam, and should reach the
stems.

In this example, each tremolo lasts exactly one measure.

(To ensure that the spacing engine is not confused we add some regular
notes as well.)

staffLineLayoutFunction is used to change the position of the notes.
This sets staffLineLayoutFunction to ly:pitch-semitones to
produce a chromatic scale with the distance between a consecutive
space and line equal to one semitone.

Transposition symbols should be correctly positioned
close to the parent clef. Horizontal alignment is fine-tuned
for standard C, G and F clefs: for example, downwards transposition
of a G clef should be centered exactly under the middle of clef hook.
For clefs that don’t have fine-tuned alignment the transposition
number should be centered.

Clefs may be transposed. By default, break-visibility
of ClefModifiers is derived from the associated clef, but it may
be overridden explicitly. The initial treble_8 clef should not have an
8, while the treble_8 clef after the tenor clef should.
These settings also need to apply to clefs on new lines.

Seconds do not confuse the collision algorithm.
The first pair of chords in each measure should merge, mesh,
or come relatively close, but the second in each measure needs
more space to make clear which notes belong to which voice.

If the Note_heads_engraver is replaced by the Completion_heads_engraver,
long notes, longer than measureLength, are split into un-scaled notes,
even if the original note used a scale-factor.
completionFactor controls this behavior.

If the Rest_engraver is replaced by the Completion_rest_engraver,
long rests, longer than measureLength, are split into
un-scaled rests, even if the original duration used a scale-factor.
completionFactor controls this behavior.

Create compound time signatures. The argument is a Scheme list
of lists. Each list describes one fraction, with the last entry being the
denominator, while the first entries describe the summands in the
enumerator. If the time signature consists of just one fraction,
the list can be given directly, i.e. not as a list containing a single list.
For example, a time signature of (3+1)/8 + 2/4 would be created as
\compoundMeter #'((3 1 8) (2 4)), and a time signature of (3+2)/8
as \compoundMeter #'((3 2 8)) or shorter
\compoundMeter #'(3 2 8).

Test for cross-staff stems. The test produces a
piano staff with cross-staff connected crochet, semi-quaver,
dotted quaver (beamed with the semi-quaver) and finally a quaver.
All stems should connect, showing correct spacing and
stem length. The lower connected notes should have no flags.

Clefs for cue notes and line breaks. If the cue notes start in a
new line, the cue clef should not be printed at the end of the previous line.
Similarly, an end clef for cue notes ending at a line break should only be
printed at the end of the line.

Cue notes going over a line break should print the standard clef on the new
line plus an additional cue clef after the time/key signature.

The VerticalAxisGroup.remove-layer
property can be used for typesetting temporary divisi staves where
the switch to split staves is done only at line breaks such that all
complex passages are rendered in separate staves.

Dot Columns are engraved in the Staff by default,
enabling dots to move vertically to make room for dots from another voice.
If Dot_column_engraver is moved to Voice, separate dot columns are engraved,
and these dots avoid notes in other voices.

Both noteheads and rests can have dots.
Augmentation dots should never be printed on a staff line,
but rather be shifted vertically. They should go up, but in case of
multiple parts, the down stems have down shifted dots. In case of
chords, all dots should be in a column. The dots follow the shift
of rests when avoiding collisions.

In drum notation, there is a special clef symbol, drums are
placed to their own staff positions and have note heads according to the
drum, an extra symbol may be attached to the drum, and the number of lines
may be restricted.

Postfix functions for custom crescendo text spanners. The spanners
should start on the first note of the measure. One has to use -\mycresc,
otherwise the spanner start will rather be assigned to the next note.

Dynamic letters are kerned, and their weight
matches that of the hairpin signs. The dynamic scripts should be
horizontally centered on the note head. Scripts that should appear
closer to the note head (staccato, accent) are reckoned with.

The \cresc, \dim and \decresc spanners are now postfix operators
and produce one text spanner. Defining custom spanners is also easy.
Hairpin and text crescendi can be easily mixed. \< and \> produce
hairpins by default, \cresc etc. produce text spanners by default.

A mode switching command like \lyricsto will
‘pop state’ when seeing the lookahead token \time, a music
function, after its non-delimited argument. This must not cause the
extra token parsing state for the music function to disappear.

Bass figures and extenders shall also work correctly if the
figure has a different duration than the bass note. In particular, if a
timestep does not have a new figure (because the old figure still goes on),
extenders should be drawn and not be reset.

Figured bass is created by the FiguredBass context which
responds to figured bass events and rest events. You must enter these
using the special \figuremode { } mode, which allows you to
type numbers, like <4 6+> and add slashes, backslashes and pluses.

You can also enter markup strings. The vertical alignment may also be tuned.

Context modification via \with filters translators
of the wrong type: performers for an Engraver_group and engravers
for a Performer_group. In this test, the
Instrument_name_engraver is added to a StaffGroup, but
does not affect midi output, since it is filtered out.

It is possible to associate
fingerings uniquely with notes. This makes it possible to add
horizontal fingerings to notes. Fingering defaults to not clearing
flags and stems unless there is a collision or a beam.

Setting the font-name property does not change the font
size. The two strings below should be concatenated and have the
same font size.

Note that ‘the same font size’ is related to what lilypond reports
on the console if in verbose mode (3.865234375 units for this
regression test). If you actually look at the two fonts the
optical size differs enormously.

This is an example of automatic footnote numbering
where the number is reset on each page. It uses the symbol-footnotes
numbering function, which assigns the symbols *, †, ‡, § and ¶ to
successive footnotes, doubling up on the symbol after five footnotes
have been reached.

Dots indicating fingerings can be changed in location,
size, and coloring.
It is possible to parenthesize a single dot. The color
of the paranthesis may be taken from dot or default.
A possible collision between parathesis and fret-label-
indication can be resolved by an override for
fret-label-horizontal-offset in fret-diagram-details.

Grace notes do tricky things with timing. If a measure
starts with a grace note, the measure does not start at 0, but
earlier. Nevertheless, lily should not get confused. For example, line
breaks should be possible at grace notes, and the bar number should be
printed correctly.

Hara-kiri staves are suppressed if they are empty. This
example really contains three drum staves, but as it progresses, empty ones
are removed: this example has three staves, but some of them
disappear: note how the 2nd line only has the bar number 2. (That the
bar number is printed might be considered a bug, however, the scenario
of all staves disappearing does not happen in practice.)

Any staff brackets and braces are removed, both in the single staff
and no staff case.

Hara-kiri staves are suppressed if they are empty. This
example really contains three rhythmic staves, but as it progresses, empty ones
are removed: this example has three staves, but some of them
disappear: note how the 2nd line only has the bar number 2. (That the
bar number is printed might be considered a bug, however, the scenario
of all staves disappearing does not happen in practice.)

Any staff brackets and braces are removed, both in the single staff
and no staff case.

Hara-kiri staves kill themselves if they are empty. This
example really contains three staves, but as they progress, empty ones
are removed: this example has three staves, but some of them
disappear: note how the 2nd line only has the bar number 2. (That the
bar number is printed might be considered a bug, however, the scenario
of all staves disappearing does not happen in practice.)

Any staff brackets and braces are removed, both in the single staff
and no staff case.

Hara-kiri staves are suppressed if they are empty. This
example really contains three tab staves, but as it progresses, empty ones
are removed: this example has three staves, but some of them
disappear: note how the 2nd line only has the bar number 2. (That the
bar number is printed might be considered a bug, however, the scenario
of all staves disappearing does not happen in practice.)

Basic harp diagram functionality, including circled pedal boxes.
The third diagram uses an empty string, the third contains invalid characters.
Both cases will create warnings, but should still not fail with an error.

Alignment of lyrics, dynamics, textscripts and articulations
attached to chords with suspended notes doesn’t depend on input order.
All these items are aligned on the "main" notehead (the one at the
end of the stem).

Instrument names horizontal alignment is tweaked by
changing the Staff.Instrument #'self-alignment-X property. The
\layout variables indent and short-indent define
the space where the instrument names are aligned before the first and
the following systems, respectively.

Staff margins are also markings attached to barlines. They should be
left of the staff, and be centered vertically with respect to the staff.
They may be on normal staves, but also on compound staves, like the
PianoStaff.

Key signatures may appear on key changes, even without a barline.
In the case of a line break, the restoration accidentals are printed at
end of a line. If createKeyOnClefChange is set, key signatures
are created also on a clef change.

LilyPond syntax can be used inside scheme to
build music expressions, with the #{ ... #} syntax.
Scheme forms can be introduced inside these blocks by escaping
them with a $, both in a LilyPond context or in a Scheme
context.

In this example, the \withpaddingA, \withpaddingB and
\withpaddingC music functions set different kinds of padding on
the TextScript grob.

Setting 'zigzag style for spanners does not
cause spacing problems: in this example, the first text markup and
zigzag trillspanner have the same outside staff positioning as
the second markup and default trillspanner.

Test the different loglevels of lilypond. Run this file with –loglevel=NONE,
ERROR, WARNING, PROGRESS, DEBUG to see the different loglevels. The errors
are commented out. Comment them in to check the output manually.

Lyrics can be set to a melody automatically. Excess
lyrics will be discarded. Lyrics will not be set over rests. You can
have melismata either by setting a property melismaBusy, or by setting
automaticMelismas (which will set melismas during slurs and ties). If
you want a different order than first Music, then Lyrics, you must
precook a chord of staves/lyrics and label those. Of course, the
lyrics ignore any other rhythms in the piece.

When lyrics are not associated with specific voices, the
lyric placement should follow lyric rhythms. In particular, the
second syllable here should not be attached to the first note of the first staff.

Stem length/thickness, beam spacing/thickness, and
horizontal spacing should be scaled along with notation size when
using the \magnifyMusic command. Stems can get thicker
than the default, but not thinner.

make-relative can make relativization on music
function calls behave as one would expect from looking at the
function’s arguments rather than at the actually resulting
expressions. This regtest defines an example function
\withOctave which works equally well inside and outside of
\relative.

make-relative is a Scheme utility macro mainly
useful for creating music functions accepting pitches as arguments.
Its purpose is to make music functions taking pitch arguments for
producing complex music fragments integrate nicely within a
\relative section. This regtest typesets a short music
fragment twice, once without using \relative, once using it.
The fragment should appear identical in both cases.

A single Pango string is processed according to the
Unicode Bidirectional Algorithm. The strong Hebrew characters in
this example are set right-to-left, and the Latin numerals, space
character, and punctuation are set according to the rules of the
algorithm.

Diacritic marks are rendered and positioned correctly. The
diacritic on line 1 looks like a lower-underline and is centered
beneath the main character. The diacritic on line 2 is positioned
to the left of the main character, with a tiny space of
separation. The diacritic on line 3 is positioned directly above
the main character, either centered or shifted slightly to the
left.

Measures split across line breaks may be numbered in a measure
count. Each segment receives a number. The first number has its ordinary
appearance, but numbers after the break are enclosed in parentheses.

Metronome marks aligned on notes do not interfere with
the positioning of loose columns in other staves. Here the loose
column supporting the clef is correctly placed immediately before
the second note in the lower staff.

In this example, the default is changed to
'(time-signature key-signature): since key-signature
is second in the list, the mark should only be aligned with the key
signature if there is no time signature present, as in the second
measure.

\tempo marks are aligned with the time signature
or the position of the first note.

By overriding break-align-symbols the default alignment can be
changed. If no symbol in break-align-symbols is present, the
property non-break-align-symbols determines the alignment. If
the alignment object is a multi-measure rest, the tempo mark is aligned
with the preceding bar line.

Converting LilyPond input to MIDI and then again back with
midi2ly.py is a reversible procedure in some simple cases,
which mean that the original .ly -file and the one converted
back from the generated .midi -file do not differ.
Here are produced some scales.

In overlapping unisons, within a single MIDI channel,
either the first note is truncated, or the notes are merged if
midiMergeUnisons is #t. Run
timidity -idvvv file.midi |grep Midi to see midi events.

The following shows the interaction between the
properties minimum-length and
minimum-length-after-break. When minimum-length
is used alone, both segments of the tie are affected. The
properties minimum-length-after-break only affects
the sibling starting a line. Both properties may be used
together to create independent changes of both siblings. This
example shows that both properties have an identical effect on
the sibling after the break.

If Score.skipBars is set,
the signs for four, two, and one measure rest are combined to
produce the graphical representation of rests for up to 10 bars.
The number of bars will be written above the sign.

The source is a rather tightly set Peters in Edition is
a heavy font. The Peters edition (4622c) was ‘herausgegeben’ by
Paul Losse, whose name also appears on a 1956 edition of some
other music. Strictly speaking, his edititorial enhancements will
not be in the PD - but I am assuming there are no notable ones in
this small piece.

The original compresses the entire music onto a single page, in 4
systems. Lily does so too if you tune down spacing-increment, but
chooses line breaks differently.

Further manual tweaks: the slur in measure 12 has been flattened
manually. The beam in measure 3, left-hand, technically is wrong, but
has been added following the original. The crescendo in measure 4 has
been lowered

Multi-measure rests do not collide with bar lines and clefs. They
are not expanded when you set Score.skipBars. Although the
multi-measure-rest is a Spanner, minimum distances are set to stop it
colliding with bar lines.

Rests over measures lasting longer than 2 wholes use breve rests. When
more than 10 measures (tunable through expand-limit) are used
then a different symbol is used.

Music functions may be attached to notes;
in this case they must be introduced by a direction
indicator. If a non-neutral direction is given (i.e.
anything else than a dash), then the ’direction property
of the resulting object is set accordingly.

Music functions are generic music transformation functions,
which can be used to extend music syntax seamlessly. Here we
demonstrate a \myBar function, which works similar to
\bar, but is implemented completely in Scheme.

With music-map, you can apply functions operating on a
single piece of music to an entire music expression. In this example,
the function notes-to-skip changes a note to a skip. When
applied to an entire music expression in the 1st measure, the scripts
and dynamics are left over. These are put onto the 2nd measure.

The \offset command may be used to displace various properties
from the default settings contained in grob descriptions. Settings which may be
offset are limited to those of type number, number-pair, or
number-pair-list. Most of the following examples begin with the grob in its
default appearance. The command is demonstrated as a tweak and as an override.

The optimal page breaker will make trade-offs between
horizontal and vertical stretching so that the overall spacing
will be more acceptable. The page-spacing-weight parameter
controls the relative importance of vertical/horizontal spacing.
Because ragged-last-bottom is on, there is no penalty for odd
vertical spacing on the final page. As a result, only the first
page should be horizontally stretched.

Unit expressions like 3\cm can’t be parsed as optional
arguments in one go since they would require lookahead after 3.
The predicate is checked after 3, and if it is suitable,
Lilypond commits to parsing as a unit number, and checks the result
again. For the predicate integer? and 3\cm, you would
actually get a syntax error (since the combination is no longer an
integer) rather than Lilypond trying to see 3\cm as two
separate arguments.

Test optional music function arguments.
The output is nonsensical, but if you wrack your brain,
you’ll figure it out. Remember that optional arguments
are matched left to right, and after the first non-match,
the rest is skipped.

The page breaking algorithm can handle clefs combined
with lyrics. That is, the Y-extent approximations are a little more
accurate than just using bounding boxes. In particular, everything
should fit on one page here.

The max-systems-per-page variable prevents more
than a given number of systems from being on a page. Titles
are not counted as systems. \noPageBreak can override
max-systems-per-page in unusual situations.

The spring at the bottom of a page is fairly flexible (much more so
than the one at the top), so it does not drag the staff to the bottom of the
page. However, it is sufficiently stiff to cause stretching.

The vertical spacing engine is not confused by a
non-staff line below a system followed by a loose line above the
next system. Systems are spaced far enough that loose lines
are not interleaved, even if gaps would allow interleaving.

Non-staff lines between two systems don’t confuse the
layout engine. In particular, they don’t interfere with
system-system-spacing, which controls the flexible spacing
between the two closest staves of consecutive systems.

By default, we start with page 1, which is on the right hand side
of a double page. In this example, auto-first-page-number is set to ##t and the
music won’t fit on a single page, so we should automatically set the first page
number to 2 in order to avoid a bad page turn.

By default, we start with page 1, which is on the right hand side
of a double page. In this example, auto-first-page-number is set to ##t.
Although the first measure could go on a page by itself, this would require
stretching the first page badly, so we should automatically set the first page
number to 2 in order to avoid a bad page turn.

Default values for margins, indents, and offsets are
accessible in paper-defaults-init.ly and apply to the default
paper size returned by (ly:get-option ’paper-size). For other
paper sizes, they are scaled linearly.

Default values for margins, indents, and offsets are
accessible in paper-defaults-init.ly and apply to the default
paper size returned by (ly:get-option ’paper-size). For other
paper sizes, they are scaled linearly.

The parenthesize function should also work on single notes (not inside chords), rests and on whole chords (each note of the chord is parenthesized). Also, parenthesizing articulations, dynamics and text markup is possible. On all other music expressions, parenthesize does not have an effect.

Measure 1: Three parenthesized notes (staccato not parenthesized), one note with staccato in parentheses; Measure 2: Chord and two rests in parentheses (accent and markup not); Measure 3: note (no parentheses) with \p in parentheses, with text in parentheses, and note in parentheses with p not in parentheses, rest (no parentheses); Measure 4: shows that \parenthesize does not apply to other expressions like SequentialMusic

Wait for the next real note for part-combine texts (i.e. don’t
print part-combine texts on rests). This is needed because the part-combiner
needs an override if one voice has a full-bar rest while the other has some
rests and then a solo.

PDF metadata need either Latin1 encoding (not UTF8) or full
UTF-16BE with BOM. The title field uses full UTF-16 (russian characters,
euro, etc), while the composer uses normal european diacrits (which need
to be encoded as Latin1, not as UTF8). Closing parenthesis need to be
escaped by a backslash AFTER encoding!

The PDF backend uses several header fields to store metadata
in the resulting PDF file. Header fields with the prefix pdf override
those without the prefix for PDF creation (not for visual display on the page).

LilyPond does not support multiple concurrent phrasing slurs with the
parentheses syntax. In this case, warnings will be given and the nested
slur will not be generated. However, one can can create a second slur with
a different spanner-id.

Prefatory items maintain sufficient separation from
musical notation for readability, even in tight spacing.
The notes should remain generally on the correct side of the
time signature, key signature and barlines. A key change to
G major should be legible.

Distances between prefatory items (e.g. clef, bar,
etc.) are determined by engraving standards. These distances depend
on which items are combined. Mid-line, the order for clef and
bar-line is different from the start of line.

\unset should be able to unset the
‘DrumStaff’-specific ‘clefGlyph’ equally well as layout
instruction, in a context definition, or as context modification. All
systems here should revert to the ‘Score’-level violin clef.

The cueDuring and quoteDuring forms of quotation
will use the variables quotedCueEventTypes and quotedEventTypes
to determine which events are quoted. This allows different events to be
quoted for cue notes than for normal quotes.

quotedEventTypes is also the fallback for cue notes if
quotedCueEventTypes is not set.

\quoteDuring and \cueDuring shall properly quote
voices that create a sub-voice. The sub-voice will not be quoted, though.
Exceptions are sections of parallel music << {...} \ {...} >>,
which will be quoted.

With \cueDuring and \quoteDuring,
fragments of previously entered music may be
quoted. quotedEventTypes will determines what things are
quoted. In this example, a 16th rest is not quoted, since
rest-event is not in quotedEventTypes.

The \quoteDuring command shall also quote correctly all
\override, \once \override, \revert, \set,
\unset and \tweak events. The first line contains the
original music, the second line quotes the whole music and should look
identical.

By default, not all events are quoted. By setting the quoted event types to
'(StreamEvent), everything should be quoted.

Voices from different cues must not be tied together. In
this example, the first note has a tie. This note should not be tied
to the second visible note (following the rest).
Note that this behavior will not hold for cues in direct succession,
since only one CueVoice context is created
(with context-id ‘cue’).

Quotations take into account the transposition of both
source and target. In this example, all instruments play sounding
central C, the target is a instrument in F. The target part may be
\transposed. The quoted pitches will stay unchanged.

With \quote, fragments of previously entered
music may be quoted. quotedEventTypes will determines what
things are quoted. In this example, a 16th rest is not quoted, since
rest-event is not in quotedEventTypes.

Using repeat unfold within a relative block gives a
different result from writing the notes out in full. The first
system has all the notes within the stave. In the second, the
notes get progressively higher.

LilyPond has two modes for repeats: unfolded and semi-unfolded.
Unfolded repeats are fully written out. Semi unfolded repeats have the body
written and all alternatives sequentially. If the number of alternatives is
larger than the repeat count, the excess alternatives are ignored. If the
number of alternatives is smaller, the first alternative is multiplied to
get to the number of repeats.

Rests should not collide with beams, stems and noteheads. Rests may
be under beams. Rests should be move by integral number of spaces
inside the staff, and by half spaces outside. Notice that the half
and whole rests just outside the staff get ledger lines in different
cases.

Rests avoid notes. Each rest is moved in the direction
of the stems in its voice. Rests may overlap other rests in voices
with the same stem direction, in which case a warning is given, but
is suppressed if the rest has a pitch.

Scheme engravers may be instantiated, with
instance-scoped slots, by defining a 1 argument procedure which
shall return the engraver definition as an alist, with the private
slots defined in a closure. The argument procedure argument is the
context where the engraver is instantiated.

The \score-lines markup returns individual score
lines as stencils rather than a single stencil. Calling a function
like \rotate on \score-lines rotates the lines
individually, as contrasted with rotating an entire \score
markup.

The horizontal placement of staccato dots above an
upstem or below a downstem note differs from the placement of
other scripts in that different positioning is used when the dot is
alone and when it is part of a compound articulation. The
property toward-stem-shift-in-column ensures good default
positioning of the staccato (see first measure below), and allows
precise horizontal control of a column containing a staccato and
of the staccato within it (second measure). (0.0 means
centered on the note head, 1.0 means centered on the stem.)

The toward-stem-shift property controls the precise
horizontal location of scripts that are placed above an upstem or below
a downstem note (0.0 means centered on the note head, 1.0
means centered on the stem).

In addition to Slur, the music function \shape works
with PhrasingSlur, Tie, LaissezVibrerTie, and RepeatTie.
Each is shown below, first unmodified and then (in blue) after application of the
function.

A number of shorthands like (, ), |,
[, ], ~, \(, \) and others can be
redefined like normal commands. ‘ly/declarations-init.ly’ serves
as a regtest for a number of them. This test just demonstrates
replacing ( and ) with melismata commands which are
not articulations.

The skyline-horizontal-padding property can be set for System
in order to keep systems from being spaced too closely together.
In this example, the low notes from a system should not be
interleaved with the high notes from the next system.

Across line breaks, slurs behave nicely. On the left, they extend to
just after the preferatory matter, and on the right to the end of the
staff. A slur should follow the same vertical direction it would have
in unbroken state.

Slur shaping is not adapted to accommodate objects
towards the edges of slur. Said objects are thus ignored,
which should make the slur in this regtest flat. Objects towards
the edges are not, however, ignored in the slur scoring.

LilyPond does not support multiple concurrent slurs with the
parentheses syntax. In this case, warnings will be given and the nested
slur will not be generated. However, one can can create a second slur with
a different spanner-id.

Slur formatting is based on scoring. A large number of
slurs are generated. Each esthetic aspect gets demerits, the best
configuration (with least demerits) wins. This must be tested in
one big file, since changing one score parameter for one situation
may affect several other situations.

Outside staff callbacks that no longer apply to grobs
because they are outside the X boundary of a slur should terminate
early. The example below should generate no warnings about Bezier
curves and there should be no change in StrokeFinger position between
the first and second examples.

Even in case of incorrect contexts (eg. shortlived
contexts) that break linking of columns through spacing wishes,
strict-note-spacing defaults to a robust solution.
This test passes if it does not seg fault; instead it should
produce three programming error messages. Note that, in tight
music with strict note spacing, grace notes will collide with
normal notes. This is expected.

In packed mode, pack notes as tight as possible. This makes
sense mostly in combination with ragged-right mode: the notes
are then printed at minimum distance. This is mostly useful
for ancient notation, but may also be useful for some flavours
of contemporary music. If not in ragged-right mode, lily will
pack as many bars of music as possible into a line, but the
line will then be stretched to fill the whole linewidth.

Notes that are shorter than the common shortest note get a
space (i.e. without the space needed for the note) proportional to
their duration. So, the 16th notes get 1/2 of the space of an eighth note.
The total distance for a 16th (which includes note head) is 3/4 of the
eighth note.

If strict-note-spacing is set, then spacing of
notes is not influenced by bars and clefs half-way on the system.
Rather, they are put just before the note that occurs at the same
time. This may cause collisions.

The SpanBarStub grob takes care of horizontal spacing
for SpanBar grobs. When the SpanBar is disallowed, objects
in contexts that the span bar would have otherwise crossed align as if the
span bar were not there.

Because BarLine grobs take their
extra-positioning-height from their neighbors via the
pure-from-neighbor-interface, the left edge of an
accidental should never fall to the left of the right
edge of a bar line. This spacing should also take place when
SpanBar grobs are present.

The break-overshoot property sets the amount that
a spanner (in this case: the beam and tuplet bracket) in case of a line
break extends beyond the rightmost column and extends to the left beyond the
prefatory matter.

Some scripts must have quantized postions. VErtical
position descend monotonously for a descending scale. The staccato
dot is close to the notehead. If the head is in a space, then the dot
is in the space next to it.

The vertical positions of ledger lines may be customised
by setting the ledger-positions property of the StaffSymbol.
The given pattern is repeated. Bracketed groups are always shown together:
either all or none are shown. Ledger lines can be set to appear sooner or
later by setting the ledger-extra property.

Staves may be present in several sizes within a score.
This is achieved with an internal scaling factor. If the scaling factor is
forgotten in some places, objects generally become too thick or too
large on smaller staves.

Tremolos are positioned a fixed distance from the
end of the beam. Tremolo flags are shortened and made rectangular
on beamed notes or on stem-up notes with a flag. Tremolo flags are
tilted extra on stem-down notes with a flag.

Stem tremolos or rolls are tremolo signs that look like beam segments
crossing stems. If the stem is in a beam, the tremolo must be parallel
to the beam. If the stem is invisible (e.g. on a whole note), the
tremolo must be centered on the note. If the note has a flag (eg. an
unbeamed 8th note), the tremolo should be shortened if the stem is up
and tilted extra if the stem is down.

The tremolos should be positioned a fixed distance from the end of the
stems unless there is no stem, in which case they should be positioned
a fixed distance from the note head.

If an impossible tremolo duration (e.g. :4) is given, a warning is
printed.

Stencils can be scaled using ly:stencil-scale.
Negative values will flip or mirror the stencil without changing its origin; this
may result in collisions unless the scaled stencil is realigned (e.g., the time
signature in this test).

In a TabStaff, the chord repetition function needs
to save the string information. The obsolete function
\tabChordRepetition establishes this setting score-wide.
Nowadays, you would rather use just \tabChordRepeat on the
music in the tabstaff, not affecting other contexts.

Harmonics get angled brackets in tablature.
Harmonics in chords should retain their proper position,
regardless of whether or not strings are specified.
In this example, the harmonics should always be on string 1.

A sample tablature with lettered tab,
using fretLabels to modify the fret letters.

By default, letters are drawn sequentially from the alphabet,
but if the context property fretLabels is defined, these are
substituted. If specified, the length of fretLabels must be
sufficient to label all the frets used. A warning is issued
if the length is too short.

Tremolos will appear on tablature staffs only if
\tabFullNotation is active. Otherwise, no
tremolo indications are displayed on the TabStaff.
Also, tablature beams are the same thickness on TabStaff
and Staff.

The \tag command marks music expressions with a
name. These tagged expressions can be filtered out later. This
mechanism can be used to make different versions of the same music. In
this example, the top stave displays the music expression with all
tags included. The bottom two staves are filtered: the part has cue
notes and fingerings, but the score has not.

TextScripts are spaced closely, following outlines of
the stencil. When markup commands like pad-around and
with-dimensions change the extent of a stencil, these changed
extents have effect in the stencil outline used to place the resulting
TextScript.

Default values for time signature settings can vary by staff if the
Timing_translator and Default_bar_line_engraver are
moved from Score to Staff. In this case, the upper staff
should be beamed 3/4, 1/4. The lower staff should be beamed 1/4, 3/4.

The default behavior of tuplet-bracket visibility is to print a bracket
unless there is a beam of the same length as the tuplet. Overriding
'bracket-visibility changes the bracket visibility as follows:

In tuplets with an even number of stems, the number
may be placed on either side of the beam when the central stems
point in different directions. The exception to this is when
there is a fractional beam on one of the central stems, in which
case the number is placed opposite the partial beam.

Grobs whose parents have outside-staff-priority set
should figure into the vertical skyline of the VerticalAxisGroup
such that grobs with a higher outside-staff-priority are correctly
positioned above them.

Tuplet brackets stay clear of the staff. The
slope is determined by the graphical characteristic of the notes, but
if the musical pattern does not follow graphical slope, then the
bracket is horizontal

Tuplets are indicated by a bracket with a number. There should be no
bracket if there is a beam exactly matching the length of the tuplet.
The bracket does not interfere with the stafflines, and the number is
centered in the gap in the bracket.

The bracket stops at the end of the stems, if the stems have the same
direction as the bracket. The endings can be adjusted with
bracket-flare.

Lyrics without an associatedVoice should align properly.
If there are notes in the PaperColumn, they should align to them,
and when there are no notes, they should align relative to the
PaperColumn itself (represented with blue GridLines here)

unpure-pure containers take two arguments: an unpure property and
a pure property. The pure property is evaluated (and cached) for all
pure calculations, and the unpure is evaluated for all unpure calculations.
In this regtest, there are three groups of two eighth notes. In the first
group, the second note should move to accommodate the flag, whereas it should
not in the second group because it registers the flag as being higher. The
flag, however, remains at the Y-offset dictated by ly:flag::calc-y-offset.
In the third set of two 8th notes, the flag should be pushed up to a Y-offset
of 8.

Various scripts may be used for texts (like titles and
lyrics) introduced by entering them in UTF-8 encoding, and using a
Pango based backend. Depending on the fonts installed, this fragment
will render Bulgarian (Cyrillic), Hebrew, Japanese and Portuguese.

If the ’whiteout property of a
grob is set to #t, that part of all objects in lower
layers which falls under the extent of the grob is
whited out. Here the TimeSignature whites out the
Tie but not the StaffSymbol.