1 % -*-LaTeX-*- vim:tw=72
2 \documentclass{article}
4 \title{LilyPond feature test}
5 \author{Han-Wen Nienhuys}
9 This document tries give an brief overview of LilyPond features. When
10 the text correspond with the shown notation, we consider LilyPond
11 Officially BugFree (tm). This document is intended for finding bugs,
12 and documenting bugfixes.
14 \section{Notes and rests}
16 Rests. Note that the dot of 8th, 16th and 32nd rests rest should be
17 next to the top of the rest. All rests except the whole rest are
18 centered on the middle staff line.
22 Note head shapes are settable. The stem endings should be adjusted
23 per note head. If you want different note head styles on one stem,
24 you must create a special context called Thread.
26 \mudelafile{noteheadstyle.ly}
28 Noteheads can have dots, and ---although this is bad style in duple
29 meters--- rests can too. Augmentation dots should never be printed on
30 a staff line, but rather be shifted vertically. They should go up, but
31 in case of multiple parts, the down stems have down shifted dots.
32 (Wanske p. 186) In case of chords, all dots should be in a column.
33 The dots go along as rests are shifted to avoid collisions.
37 Multiple measure rests do not collide with barlines and clefs. They
38 are not expanded when you set \verb+Score.SkipBars+. Although the
39 multi-measure-rest is a Spanner, minimum distances are set to keep it
40 colliding from barlines.
42 \mudelafile{multi-measure-rest.ly}
46 Stem tremolos (official naming?) or rolls are tremolo signs that look
47 like beam segments crossing stems. If the stem is in a beam, the
48 tremolo must be parallel to the beam. If the stem is invisible
49 (eg. on a whole note), the tremolo must be centered on the note.
51 \mudelafile{stem-tremolo.ly}
53 Chord tremolos look like beams, but are a kind of repeat symbol.
54 To avoid confusion, chord tremolo beams do not reach the stems, but
55 leave a gap. Chord tremolo beams on half notes are not ambiguous,
56 as half notes cannot appear in a regular beam, and should reach the
59 \mudelafile{chord-tremolo.sly}
61 Beams, stems and noteheads often have communication troubles, since
62 the two systems for y dimensions (1 unit = staffspace, 1 unit = 1
65 Stems, beams, ties and slurs should behave similarly, when placed
66 on the middle staff line. Of course stem-direction is down for high
67 notes, and up for low notes.
69 \mudelafile{stem-direction.sly}
71 Similarly, if \verb+stem_default_neutral_direction+ is set to \verb+-1+.
73 \mudelafile{stem-direction-down.ly}
77 The staccato dot (and all scripts with follow-into-staff set), must
78 not be on staff lines.
80 \mudelafile{staccato-pos.sly}
84 Grace notes are typeset as an encapsulated piece of music. You can
85 have beams, notes, chords, stems etc. within a \verb|\grace| section.
86 Slurs that start within a grace section, but aren't ended are attached
87 to the next normal note. Grace notes have zero duration. If there
88 are tuplets, the grace notes won't be under the brace. Grace notes
89 can have accidentals, but they are (currently) spaced at a fixed
90 distance. Grace notes (of course) come before the accidentals of the
91 main note. Grace notes can also be positioned after the main note.
96 \section{Beams, slurs and other spanners}
98 Beaming is generated automatically. Beams may cross bar lines. In that
99 case, line breaks are forbidden. Yet clef and key signatures are
100 hidden just as with breakable bar lines.
102 \mudelafile{beaming.ly}
104 Beams should behave reasonably well, even under extreme circumstances.
105 Stems may be short, but noteheads should never touch the beam.
107 \mudelafile{beam-extreme.ly}
109 Beams should always reach the middle staff line, the second beam
110 counting from the note head side, should never be lower than the
111 second staff line. This does not hold for grace note beams.
113 \mudelafile{beam-position.sly}
115 Slurs should look nice and symmetric. The curvature may increase
116 only to avoid noteheads, and as little as possible.
118 \mudelafile{slur-symmetry.ly}
119 \mudelafile{slur-symmetry-1.ly}
121 Ties are strictly horizontal. They are placed in between note heads.
122 The horizontal middle should not overlap with a staffline.
126 Beams can be typeset over fixed distance aligned staffs, beam
127 beautification doesn't really work, but knees do. Beams should be
128 behave well, wherever the switching point is.
130 \mudelafile{beam-interstaff.ly}
132 The same goes for slurs. They behave decently when broken across
135 \mudelafile{slur-interstaff.ly}
137 Tuplets are indicated by a bracket with a number. There should be no
138 bracket if there is one beam that matches the length of the tuplet.
139 The bracket does not interfere with the stafflines, and the number is
140 centered in the gap in the bracket.
146 LilyPond has three modes for repeats: folded, unfolded and
147 semi-unfolded. Unfolded repeats are fully written out. Semi unfolded
148 repeats have the body written and all alternatives sequentially.
149 Folded repeats have the body written and all alternatives
150 simultaneously. If the number of alternatives is larger than the
151 repeat count, the excess alternatives are ignored. If the number of
152 alternatives is smaller, the first alternative is multiplied to get to
153 the number of repeats.
157 \mudelafile{repeat-unfold.ly}
159 Semi (un)folded behavior. Voltas can start on non-barline moments.
160 If they don't barlines should still be shown.
162 \mudelafile{repeat-semifold.ly}
164 Folded. This doesn't make sense without alternatives, but it works.
166 \mudelafile{repeat-fold.ly}
170 Lyrics can be set to a melody automatically. Excess lyrics will be
171 dumped. Lyrics will not be set over rests. You can have melismata
172 either by setting a property melismaBusy, or by setting
173 automaticMelismas (which will set melismas during slurs and ties). If
174 you want a different order than first Music, then Lyrics, you must
175 precook a chord of staffs/lyrics and label those. Of course
176 \verb+\rhythm+ ignores any other rhythms in the piece. Hyphens and
177 extenders do not assume anything about lyric lengths, so they continue
180 \mudelafile{lyric-combine.ly}
182 \section{Multiple notes}
184 Rests should not collide with beams, stems and noteheads. Rests may
185 be under beams. Rests should be move by integral number of spaces
186 inside the staff, and by half spaces outside. Notice that the half
187 and whole rests just outside the staff get ledger lines in different
190 \mudelafile{rest-collision.ly}
192 Normal collisions. We have support for polyphony, where the
193 middle voices are horizontally shifted.
195 \mudelafile{collisions.ly}
197 The number of stafflines of a staff can be set with the property
198 numberOfStaffLines. Ledger lines both on note heads and rests are
199 adjusted. Barlines also are adjusted.
202 \mudelafile{number-staff-lines.fly}
206 In a limited number of cases, LilyPond corrects for optical spacing
207 effects. In this example, space for opposite pointed stems is adjusted
209 \mudelafile{stem-spacing.sly}
211 If there are accidentals in the music, we add space, but the space
212 between note and accidentals is less than between the notes with the
213 same value. Clef changes also get extra space, but not as much as
217 Even if a line is very tightly spaced, there will still be room
218 between prefatory matter and the following notes. The space after the
219 prefatory is very rigid. In contrast, the space before the barline
220 must stretch like the space within the measure.
224 \mudelafile{spacing-tight.ly}
228 \mudelafile{spacing-natural.ly}
232 \mudelafile{spacing-loose.ly}
235 \section{Global stuff}
237 Markings that are attached to (invisible) barlines are
238 delicate: the are attached to the rest of the score without the score
239 knowing it. Consequently, they fall over often.
241 \mudelafile{bar-scripts.ly}
243 Staff margins are also markings attached to barlines. They should be
244 left of the staff, and be centered vertically wrt the staff. They may
245 be on normal staffs, but also on compound staffs, like the PianoStaff
247 \mudelafile{staff-margin.ly}
249 Breathing signs, also used for phrasing, do normally not influence
250 global spacing -- only if space gets tight, notes are shifted to make
251 room for the breathing sign. Breathing signs break beams running
252 through their voice. In the following example, the notes in the first
253 two measures all have the same distance from each other:
255 \mudelafile{breathing-sign.ly}
257 Fonts are available in a default set of sizes: 11, 13, 16, 20, 23 and
258 26pt staffheight. Sizes of the text fonts and symbol fonts are made
259 to match the staff dimensions.
261 \mudelafile[nofly]{size11.ly}
263 \mudelafile[nofly]{size13.ly}
265 \mudelafile[nofly]{size16.ly}
267 \mudelafile[nofly]{size20.ly}
269 \mudelafile[nofly]{size23.ly}
271 \mudelafile[nofly]{size26.ly}
274 \section{Clefs and Time Signatures}
276 The transparent clef should not occupy any space and with style
277 \texttt{fullSizeChanges}, the changing clef should be typeset in full
278 size. For octaviated clefs, the ``8'' should appear closely above or
279 below the clef respectively. The ``8'' is processed in a convoluted
280 way, so this is fragile as well.
282 \mudelafile{clefs.ly}
284 \def\bla#1{%the input file is too long and does not test for specific bugs
285 By default, time signatures are written with two numbers. With style
286 ``C'', 4/4 and 2/2 are written with their corresponding symbols and
287 with style ``old'', 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and
288 9/8 are typeset with symbols, all other signatures retain the default
289 layout. The style ``1'', gives single number signatures for all
292 \mu delafile{time.fly}