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