]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/regression-test.tely
release: 1.3.65
[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, , ,
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.ly}
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 or rolls are tremolo signs that look like beam segments
69 crossing stems.  If the stem is in a beam, the tremolo must be parallel
70 to the beam.  If the stem is invisible (eg. on a whole note), the
71 tremolo must be centered on the note.
72
73 @mudelafile{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 @mudelafile{chord-tremolo.ly}
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.ly}
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.ly}
103
104 Dynamics appear below or above the staff.  If multiple dynamics are
105 linked with (de)crescendi, they should be on the same line.
106
107 @mudelafile{dyn-line.ly}
108
109 @section Chord names
110
111 Chord names are generated from a list pitches, and are customisable
112 from guile.  For some unlogical names, guile customisation is used
113 by default.
114
115 @mudelafile{chord-names.ly}
116
117 @section Grace notes
118
119 Grace notes are typeset as an encapsulated piece of music. You can
120 have beams, notes, chords, stems etc. within a @code{\grace} section.
121 Slurs that start within a grace section, but aren't ended are attached
122 to the next normal note.  Grace notes have zero duration.  If there
123 are tuplets, the grace notes won't be under the brace.  Grace notes
124 can have accidentals, but they are (currently) spaced at a fixed
125 distance.  Grace notes (of course) come before the accidentals of the
126 main note.  Grace notes can also be positioned after the main note.
127
128 Grace notes without beams should have a slash, if @code{flagStyle} is
129 not set.  Main note scripts don't end up on the grace note.
130
131 @mudelafile{grace.ly}
132
133
134 @section Beams, slurs and other spanners
135
136 Beaming is generated automatically. Beams may cross bar lines. In that
137 case, line breaks are forbidden.  Yet clef and key signatures are
138 hidden just as with breakable bar lines.
139
140 @mudelafile{beaming.ly}
141
142 Beams should behave reasonably well, even under extreme circumstances.
143 Stems may be short, but noteheads should never touch the beam.
144
145 @mudelafile{beam-extreme.ly}
146
147 Beams should always reach the middle staff line.  The second beam
148 counting from the note head side, should never be lower than the
149 second staff line.  This does not hold for grace note beams.
150 Override with @code{noStemExtend}.
151
152 @mudelafile{beam-position.ly}
153
154 Slurs should look nice and symmetric.  The curvature may increase
155 only to avoid noteheads, and as little as possible.
156
157 @mudelafile{slur-symmetry.ly}
158 @mudelafile{slur-symmetry-1.ly}
159
160 Ties are strictly horizontal.  They are placed in between note heads.
161 The horizontal middle should not overlap with a staffline.
162
163 @mudelafile{tie.ly}
164
165 When tieing chords, the outer slurs point outwards, the inner slurs
166 point away from the center of the staff.  Override with
167 @code{tieVerticalDirection}.
168
169 @mudelafile{tie-chord.ly}
170
171 When tieing notes with accidentals across a bar boundary, the accidental
172 must not be drawn on the note in the new bar.  Instead, the next note of
173 the same pitch in this bar should always show the accidental (even if
174 it's natural).  Slurring a accidentaled note to a natural one across bar
175 boundaries should be explicit.
176
177 Pitches can be verified by printing them  with the @code{NoteNames} context.
178
179 @mudelafile{tie-accidental.ly}
180
181 Beams can be typeset over fixed distance aligned staffs, beam
182 beautification doesn't really work, but knees do. Beams should be
183 behave well, wherever the switching point is.
184
185 @mudelafile{beam-cross-staff.ly}
186
187 The same goes for slurs. They behave decently when broken across
188 linebreak.
189
190 @mudelafile{slur-cross-staff.ly}
191
192 Tuplets are indicated by a bracket with a number.  There should be no
193 bracket if there is one beam that matches  the length of the tuplet.
194 The bracket does not interfere with the stafflines, and the number is
195 centered in the gap in the bracket.
196
197 @mudelafile{tup.ly}
198
199 @section Property details
200
201 More specific settings take precendence over less specific settings. The
202 second slur has slurDirection set to down, overriding the stemup  setting.
203
204 @mudelafile{generic-property-override.ly}
205
206 @section Repeats
207
208 LilyPond has three modes for repeats: folded, unfolded and
209 semi-unfolded.  Unfolded repeats are fully written out. Semi unfolded
210 repeats have the body written and all alternatives sequentially.
211 Folded repeats have the body written and all alternatives
212 simultaneo.ly.  If the number of alternatives is larger than the
213 repeat count, the excess alternatives are ignored.  If the number of
214 alternatives is smaller, the first alternative is multiplied to get to
215 the number of repeats.
216
217 Unfolded behavior:
218
219 @mudelafile{repeat-unfold.ly}
220
221 Volta (Semi folded) behavior.  Voltas can start on non-barline moments.
222 If they don't barlines should still be shown.
223
224 @mudelafile{repeat-volta.ly}
225
226 Folded.  This doesn't make sense without alternatives, but it works.
227
228 @mudelafile{repeat-fold.ly}
229
230 Across linebreaks, the left edge of a first and second alternative
231 bracket should be equal
232
233 @mudelafile{repeat-line-break.ly}
234
235
236
237 @section Lyrics
238
239 Lyrics can be set to a melody automatically.  Excess lyrics will be
240 dumped.  Lyrics will not be set over rests.  You can have melismata
241 either by setting a property melismaBusy, or by setting
242 automaticMelismas (which will set melismas during slurs and ties).  If
243 you want a different order than first Music, then Lyrics, you must
244 precook a chord of staffs/lyrics and label those.  Of course
245 @code{\rhythm} ignores any other rhythms in the piece.  Hyphens and
246 extenders do not assume anything about lyric lengths, so they continue
247 to work.
248
249 @mudelafile{lyric-combine.ly}
250
251 @section Multiple notes
252
253 Rests should not collide with beams, stems and noteheads.  Rests may
254 be under beams.  Rests should be move by integral number of spaces
255 inside the staff, and by half spaces outside.  Notice that the half
256 and whole rests just outside the staff get ledger lines in different
257 cases.
258
259 @mudelafile{rest-collision.ly}
260
261 Normal collisions. We have support for polyphony, where the
262 middle voices are horizontally shifted.
263
264 @mudelafile{collisions.ly}
265
266 The number of stafflines of a staff can be set with the property
267 numberOfStaffLines.  Ledger lines both on note heads and rests are
268 adjusted.  Barlines also are adjusted.
269
270
271 @mudelafile{number-staff-lines.ly}
272
273 @section Spacing
274
275 In a limited number of cases, LilyPond corrects for optical spacing
276 effects.  In this example, space for opposite pointed stems is adjusted
277
278 @mudelafile{stem-spacing.ly}
279
280 If there are accidentals in the music, we add space, but the space
281 between note and accidentals is less than between the notes with the
282 same value.  Clef changes also get extra space, but not as much as
283 barlines.
284
285
286 Even if a line is very tightly spaced, there will still be room
287 between prefatory matter and the following notes.  The space after the
288 prefatory is very rigid.  In contrast, the space before the barline
289 must stretch like the space within the measure.
290
291 Tight:
292
293 @mudelafile{spacing-tight.ly}
294
295 Natural:
296
297 @mudelafile{spacing-natural.ly}
298
299 Loose:
300
301 @mudelafile{spacing-loose.ly}
302
303 Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that
304 lyrics don't collide with barlines.
305
306 @mudelafile{lyrics-bar.ly}
307
308 @section Global stuff
309
310 Breaks can be encouraged and discouraged using @code{\break} and
311 @code{\nobreak}.  They are abbrevs for @code{\penalty} commands.
312
313 @mudelafile{break.ly}
314
315
316 Markings that are attached to (invisible) barlines are 
317 delicate: the are attached to the rest of the score without the score
318 knowing it.  Consequently, they fall over  often.
319
320 @mudelafile{bar-scripts.ly}
321
322 Staff margins are also markings attached to barlines.  They should be
323 left of the staff, and be centered vertically wrt the staff.  They may
324 be on normal staffs, but also on compound staffs, like the PianoStaff
325
326 @mudelafile{staff-margin.ly}
327
328 Breathing signs, also used for phrasing, do normally not influence
329 global spacing -- only if space gets tight, notes are shifted to make
330 room for the breathing sign. Breathing signs break beams running
331 through their voice. In the following example, the notes in the first
332 two measures all have the same distance from each other:
333
334 @mudelafile{breathing-sign.ly}
335
336 Hara kiri staffs kill themselves if they are empty.  This example really
337 contains two staffs, but the second contains only spaces, and is
338 therefore removed. 
339
340 @mudelafile{hara-kiri-short.ly}
341
342
343 Fonts are  available in a default set of sizes: 11, 13, 16, 20, 23 and
344 26pt staffheight.  Sizes of the text fonts and symbol fonts are made
345 to match the staff dimensions.    
346
347 @mudelafile[nofly]{size11.ly}
348
349 @mudelafile[nofly]{size13.ly}
350
351 @mudelafile[nofly]{size16.ly}
352
353 @mudelafile[nofly]{size20.ly}
354
355 @mudelafile[nofly]{size23.ly}
356
357 @mudelafile[nofly]{size26.ly}
358
359
360 @section Clefs and Time Signatures
361
362 The transparent clef should not occupy any space and with style
363 @code{fullSizeChanges}, the changing clef should be typeset in full
364 size. For octaviated clefs, the ``8'' should appear closely above or
365 below the clef respectively.  The ``8'' is processed in a convoluted
366 way, so this is fragile as well.
367
368 @mudelafile{clefs.ly}
369
370
371 Key signatures appear on key  changes. They may also
372 appear without barlines.  The restoration accidentals are not printed at
373 the start of the line. If @code{createKeyOnClefChange} is set, they're
374 also created on a clef change.
375
376 @mudelafile{keys.ly}
377
378 @ignore
379 @c the input file is too long and does not test for specific bugs
380
381 By default, time signatures are written with two numbers. With style
382 ``C'', 4/4 and 2/2 are written with their corresponding symbols and
383 with style ``old'', 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and
384 9/8 are typeset with symbols, all other signatures retain the default
385 layout. The style ``1'', gives single number signatures for all
386 signatures. 
387 %
388 \mu delafile{time.ly}
389 @end ignore
390
391
392
393 @section Hacks and Features
394
395 As a last resort, the placement of items can be adjusted manually, by
396 setting the @code{extra-offset} of an output object.
397
398 @mudelafile{generic-output-property.ly}
399
400 @bye
401