]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/regression-test.tely
patch::: 1.3.111.jcn1
[lilypond.git] / Documentation / 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, , , (dir)
12
13 @section Introduction
14
15 This document tries give a 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 [TODO: revise and completize this. ]
21
22 [TODO: should generate out of header fields using ly2dvi?]
23
24
25
26 @section Notes and rests
27
28 Rests.  Note that the dot of 8th, 16th and 32nd rests rest should be
29 next to the top of the rest.  All rests except the whole rest are
30 centered on the middle staff line.  
31
32 @lilypondfile{rest.ly}
33
34 Note head shapes are settable.  The stem endings should be adjusted
35 per note head.  If you want different note head styles on one stem,
36 you must create a special context called Thread.
37
38 Harmonic notes have a different shape and different
39 dimensions. Nevertheless, noteheads in both styles can be combined, on
40 either up or down stems.
41
42 @lilypondfile{noteheadstyle.ly}
43
44 Noteheads can have dots, and rests can too.  Augmentation dots should
45 never be printed on a staff line, but rather be shifted vertically. They
46 should go up, but in case of multiple parts, the down stems have down
47 shifted dots.  (Wanske p. 186) In case of chords, all dots should be in
48 a column.  The dots go along as rests are shifted to avoid collisions.
49
50 @lilypondfile{dots.ly}
51
52 Accidentals work: the second note does not get a sharp. The third and
53 fourth show forced and courtesy accidentals
54
55 @lilypondfile{accidental.ly}
56
57 Multiple measure rests do not collide with barlines and clefs.  They
58 are not expanded when you set @code{Score.skipBars}.  Although the
59 multi-measure-rest is a Spanner, minimum distances are set to keep it
60 colliding from barlines. 
61
62
63 @lilypondfile{multi-measure-rest.ly}
64
65 If @code{Score.skipBars} is set,
66 the signs for four, two, and one measure rest are combined to
67 produce the graphical representation of rests for up to 10 bars.
68 The number of bars will be written above the sign.
69
70 @lilypondfile{mm-rests2.ly}
71
72 A sharp sign after a double sharp sign, as well as a flat sign
73 after a double flat sign is automatically prepended with a
74 natural sign.
75
76 @lilypondfile{accidental-single-double.ly}
77
78 @section Stems
79
80 Stem tremolos or rolls are tremolo signs that look like beam segments
81 crossing stems.  If the stem is in a beam, the tremolo must be parallel
82 to the beam.  If the stem is invisible (eg. on a whole note), the
83 tremolo must be centered on the note.
84
85 @lilypondfile{stem-tremolo.ly}
86
87 Chord tremolos look like beams, but are a kind of repeat symbol.
88 To avoid confusion, chord tremolo beams do not reach the stems, but 
89 leave a gap.  Chord tremolo beams on half notes are not ambiguous,
90 as half notes cannot appear in a regular beam, and should reach the 
91 stems.
92   
93 @lilypondfile{chord-tremolo.ly}
94
95 Beams, stems and noteheads often have communication troubles, since
96 the two systems for y dimensions (1 unit = staffspace, 1 unit = 1
97 point) are mixed.
98
99 Stems, beams, ties and slurs should behave similarly, when placed
100 on the middle staff line. Of course stem-direction is down for high
101 notes, and up for low notes.
102
103 @lilypondfile{stem-direction.ly}
104
105 Similarly, if @code{stem_default_neutral_direction} is set to @code{-1}.
106
107 @lilypondfile{stem-direction-down.ly}
108
109 @section Scripts
110
111 The staccato dot (and all scripts with follow-into-staff set), must
112 not be on staff lines.
113
114 @lilypondfile{staccato-pos.ly}
115
116 Dynamics appear below or above the staff.  If multiple dynamics are
117 linked with (de)crescendi, they should be on the same line.
118
119 @lilypondfile{dyn-line.ly}
120
121
122 Arpeggios are supported, both cross-staff and broken single staff. 
123
124 @lilypondfile{arpeggio.ly}
125
126 Simple glissando lines between notes are supported.
127
128 @lilypondfile{glissando.ly}
129
130
131
132 @section Chord names
133
134 Chord names are generated from a list pitches, and are customisable
135 from guile.  For some unlogical names, guile customisation is used
136 by default.
137
138 @lilypondfile{chord-names.ly}
139
140 @section Grace notes
141
142 Grace notes are typeset as an encapsulated piece of music. You can
143 have beams, notes, chords, stems etc. within a @code{\grace} section.
144 Slurs that start within a grace section, but aren't ended are attached
145 to the next normal note.  Grace notes have zero duration.  If there
146 are tuplets, the grace notes won't be under the brace.  Grace notes
147 can have accidentals, but they are (currently) spaced at a fixed
148 distance.  Grace notes (of course) come before the accidentals of the
149 main note.  Grace notes can also be positioned after the main note.
150
151 Grace notes without beams should have a slash, if @code{flagStyle} is
152 not set.  Main note scripts don't end up on the grace note.
153
154 @lilypondfile{grace.ly}
155
156 @section Beams, slurs and other spanners
157
158 Beaming is generated automatically. Beams may cross bar lines. In that
159 case, line breaks are forbidden.  Yet clef and key signatures are
160 hidden just as with breakable bar lines.
161
162 @lilypondfile{beaming.ly}
163
164 Beams should behave reasonably well, even under extreme circumstances.
165 Stems may be short, but noteheads should never touch the beam.
166
167 @lilypondfile{beam-extreme.ly}
168
169 Beams should always reach the middle staff line.  The second beam
170 counting from the note head side, should never be lower than the
171 second staff line.  This does not hold for grace note beams.
172 Override with @code{noStemExtend}.
173
174 @lilypondfile{beam-position.ly}
175
176 Slurs should look nice and symmetric.  The curvature may increase
177 only to avoid noteheads, and as little as possible.  Slurs never
178 run through noteheads or stems.
179
180 @lilypondfile{slur-nice.ly}
181 @lilypondfile{slur-symmetry.ly}
182 @lilypondfile{slur-symmetry-1.ly}
183
184 Across line breaks, slurs behave nicely.  On the left, they extend to
185 just after the preferatory matter, and on the right to the end of the
186 staff.  A slur should follow the same vertical direction it would have
187 in unbroken state.
188
189 @lilypondfile{slur-broken-trend.ly}
190
191 Ties are strictly horizontal.  They are placed in between note heads.
192 The horizontal middle should not overlap with a staffline.
193
194 @lilypondfile{tie.ly}
195
196 When tieing chords, the outer slurs point outwards, the inner slurs
197 point away from the center of the staff.  Override with
198 @code{tieVerticalDirection}.
199
200 @lilypondfile{tie-chord.ly}
201
202 When tieing notes with accidentals across a bar boundary, the accidental
203 must not be drawn on the note in the new bar.  Instead, the next note of
204 the same pitch in this bar should always show the accidental (even if
205 it's natural).  Slurring a accidentaled note to a natural one across bar
206 boundaries should be explicit.
207
208 Pitches can be verified by printing them  with the @code{NoteNames} context.
209
210 @lilypondfile{tie-accidental.ly}
211
212 Beams can be typeset over fixed distance aligned staffs, beam
213 beautification doesn't really work, but knees do. Beams should be
214 behave well, wherever the switching point is.
215
216 @lilypondfile{beam-cross-staff.ly}
217
218 The same goes for slurs. They behave decently when broken across
219 linebreak.
220
221 @lilypondfile{slur-cross-staff.ly}
222
223 Tuplets are indicated by a bracket with a number.  There should be no
224 bracket if there is one beam that matches  the length of the tuplet.
225 The bracket does not interfere with the stafflines, and the number is
226 centered in the gap in the bracket.
227
228 @lilypondfile{tup.ly}
229
230 @section Property details
231
232 More specific settings take precendence over less specific settings. The
233 second slur has slurDirection set to down, overriding the stemup  setting.
234
235 @lilypondfile{generic-property-override.ly}
236
237 @section Repeats
238
239 LilyPond has three modes for repeats: folded, unfolded and
240 semi-unfolded.  Unfolded repeats are fully written out. Semi unfolded
241 repeats have the body written and all alternatives sequentially.
242 Folded repeats have the body written and all alternatives
243 simultaneo.ly.  If the number of alternatives is larger than the
244 repeat count, the excess alternatives are ignored.  If the number of
245 alternatives is smaller, the first alternative is multiplied to get to
246 the number of repeats.
247
248 Unfolded behavior:
249
250 @lilypondfile{repeat-unfold.ly}
251
252 Volta (Semi folded) behavior.  Voltas can start on non-barline moments.
253 If they don't barlines should still be shown.
254
255 @lilypondfile{repeat-volta.ly}
256
257 Folded.  This doesn't make sense without alternatives, but it works.
258
259 @lilypondfile{repeat-fold.ly}
260
261 Across linebreaks, the left edge of a first and second alternative
262 bracket should be equal
263
264 @lilypondfile{repeat-line-break.ly}
265
266 Auto change piano staff switches  voices  between up and down staffs
267 automatically; rests are switched along with the coming note.
268
269 @lilypondfile{auto-change.ly}
270
271 @section Lyrics
272
273 Lyrics can be set to a melody automatically.  Excess lyrics will be
274 dumped.  Lyrics will not be set over rests.  You can have melismata
275 either by setting a property melismaBusy, or by setting
276 automaticMelismas (which will set melismas during slurs and ties).  If
277 you want a different order than first Music, then Lyrics, you must
278 precook a chord of staffs/lyrics and label those.  Of course
279 @code{\rhythm} ignores any other rhythms in the piece.  Hyphens and
280 extenders do not assume anything about lyric lengths, so they continue
281 to work.
282
283 @lilypondfile{lyric-combine.ly}
284
285 Multiple stanzas
286
287 @lilypondfile{lyrics-multi-stanza.ly}
288
289 @section Multiple notes
290
291 Rests should not collide with beams, stems and noteheads.  Rests may
292 be under beams.  Rests should be move by integral number of spaces
293 inside the staff, and by half spaces outside.  Notice that the half
294 and whole rests just outside the staff get ledger lines in different
295 cases.
296
297 @lilypondfile{rest-collision.ly}
298
299 Normal collisions. We have support for polyphony, where the
300 middle voices are horizontally shifted.
301
302 @lilypondfile{collisions.ly}
303
304 The number of stafflines of a staff can be set with the property
305 numberOfStaffLines.  Ledger lines both on note heads and rests are
306 adjusted.  Barlines also are adjusted.
307
308
309 @lilypondfile{number-staff-lines.ly}
310
311 @section Spacing
312
313 In a limited number of cases, LilyPond corrects for optical spacing
314 effects.  In this example, space for opposite pointed stems is adjusted
315
316 @lilypondfile{stem-spacing.ly}
317
318 If there are accidentals in the music, we add space, but the space
319 between note and accidentals is less than between the notes with the
320 same value.  Clef changes also get extra space, but not as much as
321 barlines.
322
323 Even if a line is very tightly spaced, there will still be room
324 between prefatory matter and the following notes.  The space after the
325 prefatory is very rigid.  In contrast, the space before the barline
326 must stretch like the space within the measure.
327
328 Tight:
329
330 @lilypondfile{spacing-tight.ly}
331
332 Natural:
333
334 @lilypondfile{spacing-natural.ly}
335
336 Loose:
337
338 @lilypondfile{spacing-loose.ly}
339
340 Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that
341 lyrics don't collide with barlines.
342
343 @lilypondfile{lyrics-bar.ly}
344
345 Text is set with empty horizontal dimensions.  The boolean property
346 textNonEmpty is used to respect the horizontal size of text.
347
348 @lilypondfile{non-empty-text.ly}
349
350
351
352
353 @section PianoStaff
354
355
356
357 @section Global stuff
358
359 Breaks can be encouraged and discouraged using @code{\break} and
360 @code{\nobreak}.  They are abbrevs for @code{\penalty} commands.
361
362 @lilypondfile{break.ly}
363
364 Markings that are attached to (invisible) barlines are 
365 delicate: the are attached to the rest of the score without the score
366 knowing it.  Consequently, they fall over  often.
367
368 @lilypondfile{bar-scripts.ly}
369
370 Staff margins are also markings attached to barlines.  They should be
371 left of the staff, and be centered vertically wrt the staff.  They may
372 be on normal staffs, but also on compound staffs, like the PianoStaff
373
374 @lilypondfile{staff-margin.ly}
375
376 Breathing signs, also used for phrasing, do normally not influence
377 global spacing -- only if space gets tight, notes are shifted to make
378 room for the breathing sign. Breathing signs break beams running
379 through their voice. In the following example, the notes in the first
380 two measures all have the same distance from each other:
381
382 @lilypondfile{breathing-sign.ly}
383
384 Hara kiri staffs kill themselves if they are empty.  This example really
385 contains two staffs, but the second contains only spaces, and is
386 therefore removed. 
387
388 @lilypondfile{hara-kiri-short.ly}
389
390 In orchestral scores and hymns, voices are traditionally combined onto
391 one staff.  LilyPond has a part combiner, that combines or separates two
392 voices according to actual rhythm and pitch.  User-defined texts such as
393 ``solo'' and ``@`a2'' are typeset automagically, as appropriate.
394
395 @lilypondfile{part-combine.ly}
396
397
398 Fonts are  available in a default set of sizes: 11, 13, 16, 20, 23 and
399 26pt staffheight.  Sizes of the text fonts and symbol fonts are made
400 to match the staff dimensions.    
401
402 @lilypondfile[nonfragment]{size11.ly}
403
404 @lilypondfile[nonfragment]{size13.ly}
405
406 @lilypondfile[nonfragment]{size16.ly}
407
408 @lilypondfile[nonfragment]{size20.ly}
409
410 @lilypondfile[nonfragment]{size23.ly}
411
412 @lilypondfile[nonfragment]{size26.ly}
413
414
415 @section Clefs and Time Signatures
416
417 The transparent clef should not occupy any space and with style
418 @code{fullSizeChanges}, the changing clef should be typeset in full
419 size. For octaviated clefs, the ``8'' should appear closely above or
420 below the clef respectively.  The ``8'' is processed in a convoluted
421 way, so this is fragile as well.
422
423 @lilypondfile{clefs.ly}
424
425
426 Key signatures appear on key  changes. They may also
427 appear without barlines.  The restoration accidentals are not printed at
428 the start of the line. If @code{createKeyOnClefChange} is set, they're
429 also created on a clef change.
430
431 @lilypondfile{keys.ly}
432
433
434
435
436 @ignore
437 @c the input file is too long and does not test for specific bugs
438
439 By default, time signatures are written with two numbers. With style
440 ``C'', 4/4 and 2/2 are written with their corresponding symbols and
441 with style ``old'', 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and
442 9/8 are typeset with symbols, all other signatures retain the default
443 layout. The style ``1'', gives single number signatures for all
444 signatures. 
445 %
446 \mu delafile{time.ly}
447 @end ignore
448
449
450
451 @section Hacks and Features
452
453 As a last resort, the placement of items can be adjusted manually, by
454 setting the @code{extra-offset} of an output object.
455
456 @lilypondfile{generic-output-property.ly}
457
458 The same mechanism can be  used  to force pagebreaks.
459
460 @lilypondfile{between-systems.ly}
461
462 @bye
463