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: down stem notes shift dots down,
31 up stem up. In case of chords, all dots should be in a column. The
32 dots go along as rests are shifted to avoid collisions.
36 Multiple measure rests do not collide with barlines and clefs. They
37 are not expanded when you set \verb+Score.SkipBars+. Although the
38 multi-measure-rest is a Spanner, minimum distances are set to keep it
39 colliding from barlines.
41 \mudelafile{multi-measure-rest.ly}
45 Stem tremolos (official naming?) or rolls are tremolo signs that look
46 like beam segments crossing stems. If the stem is in a beam, the
47 tremolo must be parallel to the beam. If the stem is invisible
48 (eg. on a whole note), the tremolo must be centered on the note.
50 \mudelafile{stem-tremolo.ly}
52 Chord tremolos look like beams, but are a kind of repeat symbol.
53 To avoid confusion, chord tremolo beams do not reach the stems, but
54 leave a gap. Chord tremolo beams on half notes are not ambiguous,
55 as half notes cannot appear in a regular beam, and should reach the
58 \mudelafile{chord-tremolo.sly}
60 Beams, stems and noteheads often have communication troubles, since
61 the two systems for y dimensions (1 unit = staffspace, 1 unit = 1
64 Stems, beams, ties and slurs should behave similarly, when placed
65 on the middle staff line. Of course stem-direction is down for high
66 notes, and up for low notes.
68 \mudelafile{stem-direction.sly}
70 Similarly, if \verb+stem_default_neutral_direction+ is set to \verb+-1+.
72 \mudelafile{stem-direction-down.ly}
76 Grace notes are typeset as an encapsulated piece of music. You can
77 have beams, notes, chords, stems etc. within a \verb|\grace| section.
78 Slurs that start within a grace section, but aren't ended are attached
79 to the next normal note. Grace notes have zero duration. If there
80 are tuplets, the grace notes won't be under the brace. Grace notes
81 can have accidentals, but they are (currently) spaced at a fixed
82 distance. Grace notes (of course) come before the accidentals of the
83 main note. Grace notes can also be positioned after the main note.
88 \section{Beams, slurs and other spanners}
90 Beaming is generated automatically. Beams may cross bar lines. In that
91 case, line breaks are forbidden. Yet clef and key signatures are
92 hidden just as with breakable bar lines.
94 \mudelafile{beaming.ly}
96 %Beams should not interfere with various items on the staff (amongst
99 % \mud elafile{beam-repeat.ly}
101 Beams should behave reasonably well, even under extreme circumstances.
102 Stems may be short, but noteheads should never touch the beam.
104 \mudelafile{beam-extreme.ly}
106 Beams should always reach the middle staff line, the second beam
107 counting from the note head side, should never be lower than the
108 second staff line. This does not hold for grace note beams.
110 \mudelafile{beam-position.sly}
112 Slurs should look nice and symmetric. The curvature may increase
113 only to avoid noteheads, and as little as possible.
115 \mudelafile{slur-symmetry.ly}
116 \mudelafile{slur-symmetry-1.ly}
118 Ties are strictly horizontal. They are placed in between note heads.
119 The horizontal middle should not overlap with a staffline.
123 Beams can be typeset over fixed distance aligned staffs, beam
124 beautification doesn't really work, but knees do. Beams should be
125 behave well, wherever the switching point is.
127 \mudelafile{beam-interstaff.ly}
129 The same goes for slurs. They behave decently when broken across
132 \mudelafile{slur-interstaff.ly}
134 Tuplets are indicated by a bracket with a number. There should be no
135 bracket if there is one beam that matches the length of the tuplet.
136 The bracket does not interfere with the stafflines, and the number is
137 centered in the gap in the bracket.
143 LilyPond has three modes for repeats: folded, unfolded and
144 semi-unfolded. Unfolded repeats are fully written out. Semi unfolded
145 repeats have the body written and all alternatives sequentially.
146 Folded repeats have the body written and all alternatives
147 simultaneously. If the number of alternatives is larger than the
148 repeat count, the excess alternatives are ignored. If the number of
149 alternatives is smaller, the first alternative is multiplied to get to
150 the number of repeats.
154 \mudelafile{repeat-unfold.ly}
156 Semi (un)folded behavior. Voltas can start on non-barline moments.
157 If they don't barlines should still be shown.
159 \mudelafile{repeat-semifold.ly}
161 Folded. This doesn't make sense without alternatives, but it works.
163 \mudelafile{repeat-fold.ly}
167 Lyrics can be set to a melody automatically. Excess lyrics will be
168 dumped. Lyrics will not be set over rests. You can have melismata
169 either by setting a property melismaBusy, or by setting
170 automaticMelismas (which will set melismas during slurs and ties). If
171 you want a different order than first Music, then Lyrics, you must
172 precook a chord of staffs/lyrics and label those. Of course
173 \verb+\rhythm+ ignores any other rhythms in the piece. Hyphens and
174 extenders do not assume anything about lyric lengths, so they continue
177 \mudelafile{lyric-combine.ly}
179 \section{Multiple notes}
181 Rests should not collide with beams, stems and noteheads. Rests may
182 be under beams. Rests should be move by integral number of spaces
183 inside the staff, and by half spaces outside. Notice that the half
184 and whole rests just outside the staff get ledger lines in different
187 % \m udelafile{rest-collision.ly}
189 Normal collisions. We have support for four voice polyphony, where the
190 middle voices are horizontally shifted in a limited number of cases.
192 \mudelafile{collisions.ly}
194 In some cases, collisions may be hairy to resolve, or the typesetter
195 may have special whishes. For those special cases, note shifts can be
198 \mudelafile{note-shift.sly}
200 The number of stafflines of a staff can be set with the property
201 numberOfStaffLines. Ledger lines both on note heads and rests are
202 adjusted. Barlines also are adjusted.
205 \mudelafile{number-staff-lines.fly}
209 In a limited number of cases, LilyPond corrects for optical spacing
210 effects. In this example, space for opposite pointed stems is adjusted
212 \mudelafile{stem-spacing.sly}
214 Even if a line is very tightly spaced, there will still be room
215 between prefatory matter and the following notes. The space after the
216 prefatory is very rigid. In contrast, the space before the barline
217 must stretch like the space within the measure.
221 \mudelafile{spacing-tight.ly}
225 \mudelafile{spacing-natural.ly}
229 \mudelafile{spacing-loose.ly}
232 \section{Global stuff}
234 Markings that are attached to (invisible) barlines are
235 delicate: the are attached to the rest of the score without the score
236 knowing it. Consequently, they fall over often.
238 \mudelafile{bar-scripts.ly}
240 Staff margins are also markings attached to barlines. They should be
241 left of the staff, and be centered vertically wrt the staff. They may
242 be on normal staffs, but also on compound staffs, like the PianoStaff
244 \mudelafile{staff-margin.ly}
246 Breathing signs, also used for phrasing, do normally not influence
247 global spacing -- only if space gets tight, notes are shifted to make
248 room for the breathing sign. Breathing signs break beams running
249 through their voice. In the following example, the notes in the first
250 two measures all have the same distance from each other:
252 \mudelafile{breathing-sign.ly}
254 Fonts are available in a default set of sizes: 11, 13, 16, 20, 23 and
255 26pt staffheight. Sizes of the text fonts and symbol fonts are made
256 to match the staff dimensions.
258 \mudelafile{size11.ly}
260 \mudelafile{size13.ly}
262 \mudelafile{size16.ly}
264 \mudelafile{size20.ly}
266 \mudelafile{size23.ly}
268 \mudelafile{size26.ly}
271 \section{Clefs and Time Signatures}
273 The transparent clef should not occupy any space and with style
274 \texttt{fullSizeChanges}, the changing clef should be typeset in full
275 size. For octaviated clefs, the ``8'' should appear closely above or
276 below the clef respectively. The ``8'' is processed in a convoluted
277 way, so this is fragile as well.
279 \mudelafile{clefs.ly}
281 \def\bla#1{%the input file is too long and does not test for specific bugs
282 By default, time signatures are written with two numbers. With style
283 ``C'', 4/4 and 2/2 are written with their corresponding symbols and
284 with style ``old'', 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and
285 9/8 are typeset with symbols, all other signatures retain the default
286 layout. The style ``1'', gives single number signatures for all
289 \mu delafile{time.fly}