]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/programmer/regression-test.tely
3675d89ca7c7f7d6cf20ebfc1a9676319fe0ebc4
[lilypond.git] / Documentation / programmer / regression-test.tely
1 \input texinfo @c -*-texinfo-*-   vim:tw=72
2 @setfilename regression-test.info
3 @settitle LilyPond Regression test
4
5 @c fool ls-latex
6 @ignore
7 @author Han-Wen Nienhuys and Jan Nieuwenhuizen
8 @title LilyPond Regression test
9 @end ignore
10
11 @node Top, , ,
12
13 @section Introduction
14
15 This document tries give an brief overview of LilyPond features.  When
16 the text correspond with the shown notation, we consider LilyPond
17 Officially BugFree (tm).  This document is intended for finding bugs,
18 and documenting bugfixes.
19
20 @section Notes and rests
21
22 Rests.  Note that the dot of 8th, 16th and 32nd rests rest should be
23 next to the top of the rest.  All rests except the whole rest are
24 centered on the middle staff line.  
25
26 @mudelafile{rest.fly}
27
28 Note head shapes are settable.  The stem endings should be adjusted
29 per note head.  If you want different note head styles on one stem,
30 you must create a special context called Thread.
31
32 @mudelafile{noteheadstyle.ly}
33
34 Noteheads can have dots, and ---although this is bad style in duple
35 meters--- rests can too.  Augmentation dots should never be printed on
36 a staff line, but rather be shifted vertically. They should go up, but
37 in case of multiple parts, the down stems have down shifted dots.
38 (Wanske p. 186) In case of chords, all dots should be in a column.
39 The dots go along as rests are shifted to avoid collisions.
40
41 @mudelafile{dots.fly}
42
43 Multiple measure rests do not collide with barlines and clefs.  They
44 are not expanded when you set @code{Score.skipBars}.  Although the
45 multi-measure-rest is a Spanner, minimum distances are set to keep it
46 colliding from barlines. 
47
48 @mudelafile{multi-measure-rest.ly}
49
50 @section Stems
51
52 Stem tremolos (official naming?) or rolls are tremolo signs that look
53 like beam segments crossing stems.  If the stem is in a beam, the
54 tremolo must be parallel to the beam.  If the stem is invisible
55 (eg. on a whole note), the tremolo must be centered on the note.
56
57 @mudelafile{stem-tremolo.ly}
58
59 Chord tremolos look like beams, but are a kind of repeat symbol.
60 To avoid confusion, chord tremolo beams do not reach the stems, but 
61 leave a gap.  Chord tremolo beams on half notes are not ambiguous,
62 as half notes cannot appear in a regular beam, and should reach the 
63 stems.
64   
65 @mudelafile{chord-tremolo.sly}
66
67 Beams, stems and noteheads often have communication troubles, since
68 the two systems for y dimensions (1 unit = staffspace, 1 unit = 1
69 point) are mixed.
70
71 Stems, beams, ties and slurs should behave similarly, when placed
72 on the middle staff line. Of course stem-direction is down for high
73 notes, and up for low notes.
74
75 @mudelafile{stem-direction.sly}
76
77 Similarly, if @code{stem_default_neutral_direction} is set to @code{-1}.
78
79 @mudelafile{stem-direction-down.ly}
80
81 @section Scripts
82
83 The staccato dot (and all scripts with follow-into-staff set), must
84 not be on staff lines.
85
86 @mudelafile{staccato-pos.sly}
87
88 @section Grace notes
89
90 Grace notes are typeset as an encapsulated piece of music. You can
91 have beams, notes, chords, stems etc. within a @code{\grace} section.
92 Slurs that start within a grace section, but aren't ended are attached
93 to the next normal note.  Grace notes have zero duration.  If there
94 are tuplets, the grace notes won't be under the brace.  Grace notes
95 can have accidentals, but they are (currently) spaced at a fixed
96 distance.  Grace notes (of course) come before the accidentals of the
97 main note.  Grace notes can also be positioned after the main note.
98
99 @mudelafile{grace.ly}
100
101
102 @section Beams, slurs and other spanners
103
104 Beaming is generated automatically. Beams may cross bar lines. In that
105 case, line breaks are forbidden.  Yet clef and key signatures are
106 hidden just as with breakable bar lines.
107
108 @mudelafile{beaming.ly}
109
110 Beams should behave reasonably well, even under extreme circumstances.
111 Stems may be short, but noteheads should never touch the beam.
112
113 @mudelafile{beam-extreme.ly}
114
115 Beams should always reach the middle staff line, the second beam
116 counting from the note head side, should never be lower than the
117 second staff line.  This does not hold for grace note beams.
118
119 @mudelafile{beam-position.sly}
120
121 Slurs should look nice and symmetric.  The curvature may increase
122 only to avoid noteheads, and as little as possible.
123
124 @mudelafile{slur-symmetry.ly}
125 @mudelafile{slur-symmetry-1.ly}
126
127 Ties are strictly horizontal.  They are placed in between note heads.
128 The horizontal middle should not overlap with a staffline.
129
130 @mudelafile{tie.ly}
131
132 When tieing notes with accidentals across a bar boundary, the accidental
133 must not be drawn on the note in the new bar.  Instead, the next note of
134 the same pitch in this bar should always show the accidental (even if
135 it's natural).  Slurring a accidentaled note to a natural one across bar
136 boundaries should be explicit.
137
138 Pitches can be verified by printing them  with the @code{NoteNames} context.
139
140 @mudelafile{tie-accidental.ly}
141
142 Beams can be typeset over fixed distance aligned staffs, beam
143 beautification doesn't really work, but knees do. Beams should be
144 behave well, wherever the switching point is.
145
146 @mudelafile{beam-cross-staff.ly}
147
148 The same goes for slurs. They behave decently when broken across
149 linebreak.
150
151 @mudelafile{slur-cross-staff.ly}
152
153 Tuplets are indicated by a bracket with a number.  There should be no
154 bracket if there is one beam that matches  the length of the tuplet.
155 The bracket does not interfere with the stafflines, and the number is
156 centered in the gap in the bracket.
157
158 @mudelafile{tup.ly}
159
160 @section Repeats
161
162 LilyPond has three modes for repeats: folded, unfolded and
163 semi-unfolded.  Unfolded repeats are fully written out. Semi unfolded
164 repeats have the body written and all alternatives sequentially.
165 Folded repeats have the body written and all alternatives
166 simultaneously.  If the number of alternatives is larger than the
167 repeat count, the excess alternatives are ignored.  If the number of
168 alternatives is smaller, the first alternative is multiplied to get to
169 the number of repeats.
170
171 Unfolded behavior:
172
173 @mudelafile{repeat-unfold.ly}
174
175 Volta (Semi folded) behavior.  Voltas can start on non-barline moments.
176 If they don't barlines should still be shown.
177
178 @mudelafile{repeat-volta.ly}
179
180 Folded.  This doesn't make sense without alternatives, but it works.
181
182 @mudelafile{repeat-fold.ly}
183
184 @section Lyrics
185
186 Lyrics can be set to a melody automatically.  Excess lyrics will be
187 dumped.  Lyrics will not be set over rests.  You can have melismata
188 either by setting a property melismaBusy, or by setting
189 automaticMelismas (which will set melismas during slurs and ties).  If
190 you want a different order than first Music, then Lyrics, you must
191 precook a chord of staffs/lyrics and label those.  Of course
192 @code{\rhythm} ignores any other rhythms in the piece.  Hyphens and
193 extenders do not assume anything about lyric lengths, so they continue
194 to work.
195
196 @mudelafile{lyric-combine.ly}
197
198 @section Multiple notes
199
200 Rests should not collide with beams, stems and noteheads.  Rests may
201 be under beams.  Rests should be move by integral number of spaces
202 inside the staff, and by half spaces outside.  Notice that the half
203 and whole rests just outside the staff get ledger lines in different
204 cases.
205
206 @mudelafile{rest-collision.ly}
207
208 Normal collisions. We have support for polyphony, where the
209 middle voices are horizontally shifted.
210
211 @mudelafile{collisions.ly}
212
213 The number of stafflines of a staff can be set with the property
214 numberOfStaffLines.  Ledger lines both on note heads and rests are
215 adjusted.  Barlines also are adjusted.
216
217
218 @mudelafile{number-staff-lines.fly}
219
220 @section Spacing
221
222 In a limited number of cases, LilyPond corrects for optical spacing
223 effects.  In this example, space for opposite pointed stems is adjusted
224
225 @mudelafile{stem-spacing.sly}
226
227 If there are accidentals in the music, we add space, but the space
228 between note and accidentals is less than between the notes with the
229 same value.  Clef changes also get extra space, but not as much as
230 barlines.
231
232
233 Even if a line is very tightly spaced, there will still be room
234 between prefatory matter and the following notes.  The space after the
235 prefatory is very rigid.  In contrast, the space before the barline
236 must stretch like the space within the measure.
237
238 Tight:
239
240 @mudelafile{spacing-tight.ly}
241
242 Natural:
243
244 @mudelafile{spacing-natural.ly}
245
246 Loose:
247
248 @mudelafile{spacing-loose.ly}
249
250 Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that
251 lyrics don't collide with barlines.
252
253 @mudelafile{lyrics-bar.ly}
254
255 @section Global stuff
256
257 Breaks can be encouraged and discouraged using @code{\break} and
258 @code{\nobreak}.  They are abbrevs for @code{\penalty} commands.
259
260 @mudelafile{break.ly}
261
262
263 Markings that are attached to (invisible) barlines are 
264 delicate: the are attached to the rest of the score without the score
265 knowing it.  Consequently, they fall over  often.
266
267 @mudelafile{bar-scripts.ly}
268
269 Staff margins are also markings attached to barlines.  They should be
270 left of the staff, and be centered vertically wrt the staff.  They may
271 be on normal staffs, but also on compound staffs, like the PianoStaff
272
273 @mudelafile{staff-margin.ly}
274
275 Breathing signs, also used for phrasing, do normally not influence
276 global spacing -- only if space gets tight, notes are shifted to make
277 room for the breathing sign. Breathing signs break beams running
278 through their voice. In the following example, the notes in the first
279 two measures all have the same distance from each other:
280
281 @mudelafile{breathing-sign.ly}
282
283 Fonts are  available in a default set of sizes: 11, 13, 16, 20, 23 and
284 26pt staffheight.  Sizes of the text fonts and symbol fonts are made
285 to match the staff dimensions.    
286
287 @mudelafile[nofly]{size11.ly}
288
289 @mudelafile[nofly]{size13.ly}
290
291 @mudelafile[nofly]{size16.ly}
292
293 @mudelafile[nofly]{size20.ly}
294
295 @mudelafile[nofly]{size23.ly}
296
297 @mudelafile[nofly]{size26.ly}
298
299
300 @section Clefs and Time Signatures
301
302 The transparent clef should not occupy any space and with style
303 @code{fullSizeChanges}, the changing clef should be typeset in full
304 size. For octaviated clefs, the ``8'' should appear closely above or
305 below the clef respectively.  The ``8'' is processed in a convoluted
306 way, so this is fragile as well.
307
308 @mudelafile{clefs.ly}
309
310 @ignore
311 @c the input file is too long and does not test for specific bugs
312 By default, time signatures are written with two numbers. With style
313 ``C'', 4/4 and 2/2 are written with their corresponding symbols and
314 with style ``old'', 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and
315 9/8 are typeset with symbols, all other signatures retain the default
316 layout. The style ``1'', gives single number signatures for all
317 signatures. 
318 %
319 \mu delafile{time.fly}
320 @end ignore
321
322 @bye