]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/refman.itely
* fixed typo
[lilypond.git] / Documentation / user / refman.itely
1 @c Note: -*-texinfo-*-
2 @c
3 @c A menu is needed before every deeper *section nesting of @node's; run
4 @c     M-x texinfo-all-menus-update
5 @c to automagically fill in these menus before saving changes
6 @c
7 @c FIXME: singular vs. plural:  Beams/Beam
8
9
10 @node Notation manual
11 @chapter Notation manual
12
13 @html
14 <!--- @@WEB-TITLE@@=Reference Manual --->
15 @end html
16
17
18 @menu
19 * Note entry::                  
20 * Easier music entry::          
21 * Staff notation::              
22 * Polyphony::                   
23 * Beaming::                     
24 * Accidentals::                 
25 * Expressive marks::            
26 * Articulations::               
27 * Fingering instructions::      
28 * Repeats::                     
29 * Rhythmic music::              
30 * Piano music::                 
31 * Vocal music::                 
32 * Tablatures::                  
33 * Chord names::                 
34 * Writing parts::               
35 * Ancient notation ::           
36 * Contemporary notation::       
37 * Tuning output::               
38 * Global layout::               
39 * Sound::                       
40 @end menu
41
42 @c FIXME: Note entry vs Music entry at top level menu is confusing.
43
44 @node Note entry
45 @section Note entry
46 @cindex Note entry
47
48
49
50 @menu
51 * Notes::                       
52 * Pitches::                     
53 * Chromatic alterations::       
54 * Chords::                      
55 * Rests::                       
56 * Skips::                       
57 * Durations::                   
58 * Ties::                        
59 * Automatic note splitting ::   
60 * Tuplets::                     
61 * Easy Notation note heads ::   
62 @end menu
63
64
65 @node Notes
66 @subsection Notes
67
68
69 A note is printed by specifying its pitch and then its duration.
70 @footnote{Notes constitute the most basic elements of LilyPond input,
71 but they do not form valid input on their own without a @code{\score}
72 block.  However, for the sake of brevity and simplicity we will
73 generally omit @code{\score} blocks and @code{\paper} declarations in
74 this manual.}
75
76 @lilypond[fragment,verbatim]
77   cis'4 d'8 e'16 c'16
78 @end lilypond
79
80
81 @node Pitches
82 @subsection Pitches
83
84 @cindex Pitch names
85 @cindex Note specification
86 @cindex pitches
87 @cindex entering notes
88
89 The most common syntax for pitch entry is used in @code{\chords} and
90 @code{\notes} mode.  In Note and Chord mode, pitches may be designated
91 by names.  The notes are specified by the letters @code{a} through
92 @code{g}, while the octave is formed with notes ranging from @code{c}
93 to @code{b}.  The pitch @code{c} is an octave below middle C and the
94 letters span the octave above that C.
95
96 @lilypond[fragment,verbatim]
97 \clef bass
98   a,4 b, c d e f g a b c' d' e' \clef treble f' g' a' b' c''
99 @end lilypond
100
101 @cindex note names, Dutch
102
103 A sharp is formed by adding @code{-is} to the end of a pitch
104 name and a flat is formed by adding @code{-es}.  Double sharps and
105 double flats are obtained by adding @code{-isis} or @code{-eses}.
106
107 These default names are the Dutch note names.  In Dutch, @code{aes} is
108 contracted to @code{as} in Dutch, but both forms are
109 accepted. Similarly, both @code{es} and @code{ees} are accepted.
110
111 There are predefined sets of note names for various other languages.
112 To use them,  include the language specific init file.  For
113 example: @code{\include "english.ly"}.  The available language files
114 and the note names they define are:
115
116 @anchor{note name}
117 @anchor{note names}
118 @example 
119                         Note Names               sharp       flat
120 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
121 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
122 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
123 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
124 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
125 italiano.ly    do  re  mi  fa  sol la  sib si  -d          -b
126 catalan.ly     do  re  mi  fa  sol la  sib si  -d/-s       -b 
127 espanol.ly     do  re  mi  fa  sol la  sib si  -s          -b 
128
129 @end example 
130
131 @cindex @code{'}
132 @cindex @code{,}
133
134
135
136 The optional octave specification takes the form of a series of
137 single quote (`@code{'}') characters or a series of comma
138 (`@code{,}') characters.  Each @code{'} raises the pitch by one
139 octave; each @code{,} lowers the pitch by an octave.
140
141 @lilypond[fragment,verbatim,center]
142   c' c'' es' g' as' gisis' ais'  
143 @end lilypond
144
145
146 The verbose syntax for pitch specification is
147
148 @cindex @code{\pitch}
149 @example
150   \pitch @var{scmpitch}
151 @end example
152
153 where @var{scmpitch} is a Scheme object of the @code{Pitch} type.
154
155
156 @seealso
157
158 @internalsref{NoteEvent}, @internalsref{NoteHead}
159
160 @node Chromatic alterations
161 @subsection Chromatic alterations
162
163 Normally accidentals are printed automatically, but you may also
164 print them manually.  A reminder accidental
165 @cindex reminder accidental
166 @cindex @code{?}
167 can be forced by adding an exclamation mark @code{!}
168 after the pitch.  A cautionary accidental
169 @cindex cautionary accidental
170 @cindex parenthesized accidental
171 (an accidental within parentheses) can be obtained by adding the
172 question mark `@code{?}' after the pitch.
173
174 @lilypond[fragment,verbatim]
175   cis' cis' cis'! cis'?
176 @end lilypond
177
178
179 The automatic production of accidentals can be tuned in many
180 ways. For more information, refer to @ref{Accidentals}.
181
182 @node Chords
183 @subsection Chords
184
185 A chord is formed by a enclosing a set of pitches in @code{<<} and
186 @code{>>}.
187
188 TODO: accidental overides?
189
190 @node  Rests
191 @subsection Rests
192 @cindex Rests
193
194
195
196
197 Rests are entered like notes, with the note name @code{r}.
198
199 @lilypond[singleline,verbatim]
200 r1 r2 r4 r8
201 @end lilypond
202
203 Whole bar rests, centered in middle of the bar, are specified using
204 @code{R} (capital R); see @ref{Multi measure rests}.  See also
205 @seeinternals{Rest}.
206
207 For some music, you may wish to explicitly specify the rest's vertical
208 position.  This can be achieved by entering a note with the @code{\rest}
209 keyword appended. Rest collision testing will leave these rests alone.
210
211 @lilypond[singleline,verbatim]
212 a'4\rest d'4\rest
213 @end lilypond
214
215 @seealso
216
217 @internalsref{RestEvent}, @internalsref{Rest}
218
219
220 @c FIXME: naming.
221 @node Skips
222 @subsection Skips
223 @cindex Skip
224 @cindex Invisible rest
225 @cindex Space note
226
227 An invisible rest (also called a `skip') can be entered like a note
228 with note name `@code{s}' or with @code{\skip @var{duration}}:
229
230 @lilypond[singleline,verbatim]
231 a2 s4 a4 \skip 1 a4 
232 @end lilypond
233
234  The @code{s} syntax is only available in Note mode and Chord
235 mode.  In other situations, you should use the @code{\skip} command,
236 which will work outside of those two modes:
237
238 @lilypond[singleline,verbatim]
239 \score {
240   \context Staff <
241     { \time 4/8 \skip 2 \time 4/4 } 
242     \notes\relative c'' { a2 a1 }
243   >
244 }
245 @end lilypond
246
247 The skip command is merely an empty musical placeholder.  It does not
248 produce any output, not even transparent output.
249
250 @seealso
251
252 @internalsref{SkipEvent}
253
254
255
256 @node Durations
257 @subsection Durations
258
259
260 @cindex duration
261 @cindex @code{\duration}
262
263
264 In Note, Chord, and Lyrics mode, durations are designated by numbers
265 and dots: durations are entered as their reciprocal values.  For example,
266 a quarter note is entered using a @code{4} (since it is a 1/4 note), while
267 a half note is entered using a @code{2} (since it is a 1/2 note).  For notes
268 longer than a whole you must use variables.
269
270 @c FIXME: what is an identifier?  I do not think it's been introduced yet.
271 @c and if it has, I obviously skipped that part.     - Graham
272
273 @example 
274 c'\breve  
275 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64 
276 r\longa r\breve  
277 r1 r2 r4 r8 r16 r32 r64 r64 
278 @end example 
279
280 @lilypond[noindent]
281 \score {
282   \notes \relative c'' {
283     a\breve  \autoBeamOff
284     a1 a2 a4 a8 a16 a32 a64 a64 
285     r\longa r\breve  
286     r1 r2 r4 r8 r16 r32 r64 r64 
287   }
288   \paper {
289     \translator {
290       \StaffContext
291         \remove "Clef_engraver"
292         \remove "Staff_symbol_engraver"
293         \remove "Time_signature_engraver"
294         \consists "Pitch_squash_engraver"
295     }
296   }
297 }
298 @end lilypond
299
300
301 If the duration is omitted then it is set to the previously entered
302 duration. Default for the first note is a quarter note.  The duration
303 can be followed by dots (`@code{.}') in order to obtain dotted note
304 lengths:
305 @cindex @code{.}
306
307 @lilypond[fragment,verbatim,center]
308   a' b' c''8 b' a'4 a'4. b'4.. c'8.
309 @end lilypond
310 @cindex @code{r}
311 @cindex @code{s}
312
313 You can alter the length of duration by a fraction @var{N/M}
314 appending `@code{*}@var{N/M}' (or `@code{*}@var{N}' if @var{M=1}). This
315 will not affect the appearance of the notes or rests produced.
316
317 @lilypond[fragment,verbatim]
318   a'2*2 b'4*2 a'8*4 a'4*3/2 gis'4*3/2 a'4*3/2 a'4
319 @end lilypond
320
321 Durations can also be produced through GUILE extension mechanism. 
322 @lilypond[verbatim,fragment]
323  c'\duration #(ly:make-duration 2 1)
324 @end lilypond
325
326
327 @refbugs
328
329 Dot placement for chords is not perfect.  In some cases, dots overlap:
330 @lilypond[]
331  <<f, c'' d e f>>4.
332 @end lilypond
333
334
335 @node Ties
336 @subsection Ties
337
338 @cindex Tie
339 @cindex ties
340 @cindex @code{~}
341
342 A tie connects two adjacent note heads of the same pitch.  The tie in
343 effect extends the length of a note.  Ties should not be confused with
344 slurs, which indicate articulation, or phrasing slurs, which indicate
345 musical phrasing.  A tie is entered using the tilde symbol `@code{~}'.
346
347 @lilypond[fragment,verbatim,center]
348   e' ~ e' <<c' e' g'>> ~ <<c' e' g'>>
349 @end lilypond
350
351 When a tie is applied to a chord, all note heads whose pitches match
352 are connected.  When no note heads match, no ties will be created.
353
354 In its meaning a tie is just a way of extending a note duration, similar
355 to the augmentation dot: the following example are two ways of notating
356 exactly the same concept.
357 @c
358 @lilypond[fragment, singleline,quote]
359 \time 3/4 c'2. c'2 ~ c'4
360 @end lilypond
361 If you need to tie notes over bars, it may be easier to use automatic
362 note splitting (See @ref{Automatic note splitting}).
363
364
365 @seealso 
366
367 @internalsref{TieEvent}, @internalsref{NewTieEvent},
368 @internalsref{Tie}, @ref{Automatic note splitting}.
369
370 If you want less
371 ties created for a chord, see @inputfileref{input/test,tie-sparse.ly}.
372
373 @refbugs
374
375 Tieing only a subset of the note heads of a pair of chords is not
376 supported in a simple way.  It can be achieved by moving the
377 tie-engraver into the @internalsref{Thread} context and turning on and
378 off ties per @internalsref{Thread}.
379
380 Switching staves when a tie is active, will produce a horizontal tie
381 on the first note.
382
383 Formatting of ties is a difficult subject. The results are often not
384 optimal results.
385
386
387
388 @node Automatic note splitting 
389 @subsection Automatic note splitting
390 @c FIXME: This subsection does not belong in @ref{Note entry}.
391
392 Long notes can be converted automatically to tied notes.  This is done
393 by replacing the @internalsref{Note_heads_engraver} by the
394 @internalsref{Completion_heads_engraver}.
395
396 @example
397   \paper @{ \translator @{
398       \ThreadContext
399       \remove "Note_heads_engraver"
400       \consists "Completion_heads_engraver"
401   @} @}
402 @end example
403
404 For example,
405 @example
406   \time 2/4
407   c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 
408 @end example
409
410 @lilypond[noindent]
411 \score{
412   \notes\relative c'{
413   \time 2/4
414   c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 
415   }
416   \paper { \translator {
417       \ThreadContext
418       \remove "Note_heads_engraver"
419       \consists "Completion_heads_engraver"
420   } }
421   }
422 @end lilypond
423
424 This engraver splits all running notes at the bar line, and inserts
425 ties.  One of its uses is to debug complex scores: if the measures are
426 not entirely filled, then the ties exactly show how much each measure
427 is off.
428
429 @refbugs
430
431 Not all durations (especially those containing tuplets) can be
432 represented exactly; the engraver will not insert tuplets. 
433
434 @node Tuplets
435 @subsection Tuplets
436
437 @cindex tuplets
438 @cindex triplets
439 @cindex @code{\times}
440
441 Tuplets are made out of a music expression by multiplying all durations
442 with a fraction.
443
444 @cindex @code{\times}
445 @example
446   \times @var{fraction} @var{musicexpr}
447 @end example
448
449 The duration of @var{musicexpr} will be multiplied by the fraction. 
450 In the sheet music, the fraction's denominator will be printed over
451 the notes, optionally with a bracket.  The most common tuplet is the
452 triplet in which 3 notes have the length of 2, so the notes are 2/3
453 of their written length:
454
455 @lilypond[fragment,verbatim,center]
456   g'4 \times 2/3 {c'4 c' c'} d'4 d'4
457 @end lilypond
458
459 The property @code{tupletSpannerDuration} specifies how long each bracket
460 should last.  With this, you can make lots of tuplets while typing
461 @code{\times} only once, saving lots of typing.
462
463 @lilypond[fragment,  relative, singleline, verbatim]
464 \property Voice.tupletSpannerDuration = #(ly:make-moment 1 4)
465 \times 2/3 { c'8 c c c c c }
466 @end lilypond
467
468 The format of the number is determined by the property
469 @code{tupletNumberFormatFunction}.  The default prints only the
470 denominator, but if it is set to the Scheme function
471 @code{fraction-tuplet-formatter}, @var{num}:@var{den} will be printed
472 instead.
473
474
475 @cindex @code{tupletNumberFormatFunction}
476 @cindex tuplet formatting 
477
478 @seealso
479
480 @seeinternals{TupletBracket}, @seeinternals{TimeScaledMusic}.
481
482 @refbugs
483
484 Nested tuplets are not formatted automatically.  In this case, outer
485 tuplet brackets should be moved manually.
486
487 @node Easy Notation note heads 
488 @subsection Easy Notation note heads
489
490 @cindex easy notation
491 @cindex Hal Leonard
492
493 The `easyplay' note head includes a note name inside the head.  It is
494 used in music aimed at beginners.
495
496 @lilypond[singleline,verbatim,26pt]
497 \score {
498   \notes { c'2 e'4 f' | g'1 }
499   \paper { \translator { \EasyNotation } } 
500 }
501 @end lilypond
502
503 The @code{EasyNotation} variable overrides a @internalsref{Score}
504 context.  You probably will want to print it with magnification or a
505 large font size to make it more readable.  To print with
506 magnification, you must create a DVI file (with @file{ly2dvi}) and
507 then enlarge it with something like @file{dvips -x 2000 file.dvi}.
508 See @file{man dvips} for details.  To print with a larger font, see
509 @ref{Font Size}.
510
511
512 @cindex Xdvi
513 @cindex ghostscript
514
515 If you view the result with Xdvi, then staff lines will show through
516 the letters.  Printing the PostScript file obtained with ly2dvi does
517 produce the correct result.
518
519
520 @node Easier music entry
521 @section Easier music entry
522 @cindex Music entry
523 @menu
524 * Relative octaves::            
525 * Bar check::                   
526 * Skipping corrected music::    
527 @end menu
528
529 When entering music it is easy to introduce errors. This section deals
530 with tricks and features that help entering music, and find and
531 correct mistakes.  It is also possible to use external programs, for
532 example GUI interfaces, or MIDI transcription programs, to enter or
533 edit music. Refer to the website for more information.
534
535
536
537 @node Relative octaves
538 @subsection Relative octaves
539 @cindex Relative
540 @cindex relative octave specification
541
542 Octaves are specified by adding @code{'} and @code{,} to pitch names.
543 When you copy existing music, it is easy to accidentally put a pitch
544 in the wrong octave and hard to find such an error. The relative
545 octave mode prevents these errors
546
547 @cindex @code{\relative}
548 @example
549   \relative @var{startpitch} @var{musicexpr}
550 @end example
551
552 The octave of notes that appear in @var{musicexpr} are calculated as
553 follows: If no octave changing marks are used, the basic interval
554 between this and the last note is always taken to be a fourth or less
555 (This distance is determined without regarding alterations; a
556 @code{fisis} following a @code{ceses} will be put above the
557 @code{ceses})
558
559 The octave changing marks @code{'} and @code{,} can be added to raise or
560 lower the pitch by an extra octave.  Upon entering relative mode, an
561 absolute starting pitch must be specified that will act as the
562 predecessor of the first note of @var{musicexpr}.
563
564 Entering music that changes octave frequently  is easy in relative mode.
565 @lilypond[fragment,singleline,verbatim,center]
566   \relative c'' {
567     b c d c b c bes a 
568   }
569 @end lilypond
570
571 And octave changing marks are used for intervals greater than a fourth.
572 @lilypond[fragment,verbatim,center]
573   \relative c'' {
574     c g c f, c' a, e'' }
575 @end lilypond
576
577 If the preceding item is a chord, the first note of the chord is used
578 to determine the first note of the next chord. However, other notes
579 within the second chord are determined by looking at the immediately
580 preceding note.
581
582 @lilypond[fragment,verbatim,center]
583   \relative c' {
584     c <<c e g>> 
585     <<c' e g>>
586     <<c, e' g>>
587   }
588 @end lilypond 
589 @cindex @code{\notes}
590
591 The pitch after the @code{\relative} contains a note name.  To parse
592 the pitch as a note name, you have to be in note mode, so there must
593 be a surrounding @code{\notes} keyword (which is not
594 shown here).
595
596 The relative conversion will not affect @code{\transpose},
597 @code{\chords} or @code{\relative} sections in its argument.  If you
598 want to use relative within transposed music, you must place an
599 additional @code{\relative} inside the @code{\transpose}.
600
601
602 @node Bar check
603 @subsection Bar check
604 @cindex Bar check
605
606 @cindex bar check
607 @cindex @code{barCheckSynchronize}
608 @cindex @code{|}
609
610
611 Whenever a bar check is encountered during interpretation, a warning
612 message is issued if it does not fall at a measure boundary.  This can
613 help find errors in the input.  Depending on the value of
614 @code{barCheckSynchronize}, the beginning of the measure will be
615 relocated. A bar check is entered using the bar symbol, `@code{|}'.
616
617 @example
618   \time 3/4 c2 e4 | g2.
619 @end example
620
621
622
623 @cindex skipTypesetting
624
625 Failed bar checks are caused by entering incorrect
626 durations. Incorrect durations often completely garble up the score,
627 especially if it is polyphonic, so you should start correcting the
628 score by scanning for failed bar checks and incorrect durations.  To
629 speed up this process, you can use @code{skipTypesetting}, described
630 in the next section.
631
632 @node Skipping corrected music
633 @subsection Skipping corrected music
634
635 The property @code{Score.skipTypesetting} can be used to switch on and
636 off typesetting completely during the interpretation phase. When
637 typesetting is switched off, the music is processed much more quickly.
638 This can be used to skip over the parts of a score that have already
639 been checked for errors.
640
641 @lilypond[fragment,singleline,verbatim]
642 \relative c'' { c8 d
643 \property Score.skipTypesetting = ##t
644   e f g a g c, f e d
645 \property Score.skipTypesetting = ##f
646 c d b bes a g c2 } 
647 @end lilypond
648
649
650
651
652 @node Staff notation
653 @section Staff notation
654
655 This section describes with music notation that occurs on staff level,
656 such as keys, clefs and time signatures.
657
658 @cindex Staff notation
659
660 @menu
661 * Staff symbol::                
662 * Key signature::               
663 * Clef::                        
664 * Ottava brackets::             
665 * Time signature::              
666 * Unmetered music::             
667 * Bar lines::                   
668 @end menu
669
670 @node Staff symbol
671 @subsection Staff symbol
672
673 @cindex adjusting staff symbol
674 @cindex StaffSymbol, using \property
675 @cindex staff lines, setting number of
676
677 Notes, dynamic signs, etc. are grouped
678 with a set of horizontal lines, into a staff (plural `staves'). In our
679 system, these lines are drawn using a separate graphical object called
680 staff symbol.  
681
682 This object is created whenever a @internalsref{Staff} context is
683 created.  The appearance of the staff symbol cannot be changed by
684 using @code{\override} or @code{\set}.  At the moment that
685 @code{\property Staff} is interpreted, a @internalsref{Staff} context
686 is made, and the @internalsref{StaffSymbol} is created before any
687 @code{\override} is effective. Properties can be changed in a
688 @code{\translator} definition, or by using @code{\outputproperty}.
689
690 @refbugs
691
692 If a staff is ended halfway a piece, the staff symbol may not end
693 exactly on the barline.
694
695
696 @node Key signature
697 @subsection Key signature
698 @cindex Key
699
700 @cindex @code{\key}
701
702 The key signature indicates the scale in which a piece is played. It
703 is denoted by a set of alterations (flats or sharps) at the start of
704 the staff.
705
706 @syntax
707
708 Setting or changing the key signature is done with the @code{\key}
709 command.
710 @example
711   @code{\key} @var{pitch} @var{type}
712 @end example
713
714 @cindex @code{\minor}
715 @cindex @code{\major}
716 @cindex @code{\minor}
717 @cindex @code{\ionian}
718 @cindex @code{\locrian}
719 @cindex @code{\aeolian}
720 @cindex @code{\mixolydian}
721 @cindex @code{\lydian}
722 @cindex @code{\phrygian}
723 @cindex @code{\dorian}
724
725 Here, @var{type} should be @code{\major} or @code{\minor} to get
726 @var{pitch}-major or @var{pitch}-minor, respectively.
727 The standard mode names @code{\ionian},
728 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
729 @code{\phrygian}, and @code{\dorian} are also defined.
730
731 This command sets the context property
732 @internalsref{Staff}.@code{keySignature}.  Non-standard key signatures
733 can be specified by setting this property directly.
734
735 @refbugs
736
737 The ordering of a key restoration (alterations that change back to
738 natural) is wrong when combined with a repeat barline.
739
740 @seealso
741
742 @internalsref{KeyChangeEvent}, @internalsref{KeySignature}.
743
744 @cindex @code{keySignature}
745
746
747 @node Clef
748 @subsection Clef
749 @cindex @code{\clef}
750
751 The clef indicates which lines of the staff correspond to which
752 pitches.
753
754 @syntax
755
756 The clef can be set or changed with the @code{\clef} command:
757 @lilypond[fragment,verbatim]
758   \key f\major  c''2 \clef alto g'2
759 @end lilypond
760
761 Supported clef-names include 
762 @c Moved standard clefs to the top /MB
763 @table @code
764 @item treble, violin, G, G2
765 G clef on 2nd line
766 @item alto, C
767  C clef on 3rd line
768 @item tenor
769  C clef on 4th line
770 @item bass, F
771  F clef on 4th line
772 @item french
773  G clef on 1st line, so-called French violin clef
774 @item soprano
775  C clef on 1st line
776 @item mezzosoprano
777  C clef on 2nd line
778 @item baritone
779  C clef on 5th line
780 @item varbaritone
781  F clef on 3rd line
782 @item subbass
783  F clef on 5th line
784 @item percussion
785  percussion clef
786 @end table
787
788 By adding @code{_8} or @code{^8} to the clef name, the clef is
789 transposed one octave down or up, respectively.  @var{clefname} must
790 be enclosed in quotes when it contains underscores or digits. For
791 example,
792 @example
793         \clef "G_8"
794 @end example
795
796 This command is equivalent to setting @code{clefGlyph},
797 @code{clefPosition} (which controls the Y position of the clef),
798 @code{centralCPosition} and @code{clefOctavation}. A clef is printed
799 when any of these properties are changed.
800
801 @seealso
802
803 The object for this symbol is @internalsref{Clef}.
804
805
806
807 @node Ottava brackets
808 @subsection Ottava brackets
809
810 ``Ottava'' brackets introduce an extra transposition of an octave for
811 the staff. They are created by invoking the function
812 @code{set-octavation}
813
814 @cindex ottava
815 @cindex 15ma
816 @cindex octavation
817
818 @lilypond[verbatim,fragment]
819 \relative c''' {
820   a2 b
821   #(set-octavation 1)
822   a b 
823   #(set-octavation 0)
824   a b }
825 @end lilypond
826
827 Internally the @code{set-octavation} sets @code{ottavation} (eg. to
828 @code{"8va"}) and @code{centralCPosition} properties.
829
830 @seealso
831
832 @internalsref{OttavaBracket}
833
834 @refbugs
835
836 @code{set-octavation} will get confused when clef changes happen
837 during an octavation bracket.
838
839 @node Time signature
840 @subsection Time signature
841 @cindex Time signature
842 @cindex meter
843 @cindex @code{\time}
844
845 Time signature indicates the metrum of a piece: a regular pattern of
846 strong and weak beats. It is denoted by a fraction at the start of the
847 staff.
848
849 @syntax
850
851 The time signature is set or changed by the @code{\time}
852 command.
853 @lilypond[fragment,verbatim]
854  \time 2/4 c'2 \time 3/4 c'2. 
855 @end lilypond
856
857 The actual symbol that is printed can be customized with the
858 @code{style} property. Setting it to @code{#'()} uses fraction style
859 for 4/4 and 2/2 time.  There are many more options for its layout.
860 See @inputfileref{input/test,time.ly} for more examples.
861
862
863 This command sets the property @code{timeSignatureFraction},
864 @code{beatLength} and @code{measureLength} in the @code{Timing}
865 context, which is normally aliased to @internalsref{Score}.  The
866 property @code{timeSignatureFraction} determines where bar lines
867 should be inserted, and how automatic beams should be generated.
868 Changing the value of @code{timeSignatureFraction} also causes the
869 symbol to be printed.
870
871 More options are available through the Scheme function
872 @code{set-time-signature}. In combination with the
873 @internalsref{Measure_grouping_engraver}, it will create
874 @internalsref{MeasureGrouping} signs. Such signs ease reading
875 rhythmically complex modern music.  In the following example, the 9/8
876 measure is subdivided in 2, 2, 2 and 3. This is passed to
877 @code{set-time-signature} as the third argument @code{(2 2 2 3)}.
878
879 @lilypond[verbatim]
880 \score { \notes \relative c'' {
881    #(set-time-signature 9 8 '(2 2 2 3))
882    g8-[ g-] d-[ d-] g-[ g-] a8-[-( bes g-]-) | 
883    #(set-time-signature 5 8 '(3 2))
884    a4. g4
885    }
886    \paper {
887        raggedright = ##t
888        \translator { \StaffContext
889          \consists "Measure_grouping_engraver"
890    }}}
891 @end lilypond 
892
893 @seealso
894
895 @internalsref{TimeSignature}, @internalsref{Timing_engraver}.
896
897
898 @refbugs
899
900 Automatic beaming does not use measure grouping specified with
901 @code{set-time-signature}.
902
903
904 @subsection Partial
905 @cindex Partial
906 @cindex anacrusis
907 @cindex upbeat
908 @cindex partial measure
909 @cindex measure, partial
910 @cindex shorten measures
911 @cindex @code{\partial}
912
913 Partial measures, for example in upbeats, are entered using the
914 @code{\partial} command:
915 @lilypond[fragment,verbatim]
916 \partial 16*5  c'16 c4 f16 a'2. ~ a'8. a'16 | g'1
917 @end lilypond
918
919 The syntax for this command is 
920 @example
921   \partial @var{duration} 
922 @end example
923 This is  internally translated into
924 @example
925   \property Timing.measurePosition = -@var{length of duration}
926 @end example
927 @cindex @code{|}
928 The property @code{measurePosition} contains a rational number
929 indicating how much of the measure has passed at this point.
930
931 @node Unmetered music
932 @subsection Unmetered music
933
934 Bar lines and bar numbers are calculated automatically. For unmetered
935 music (e.g. cadenzas), this is not desirable.  By setting
936 @code{Score.timing} to false, this automatic timing can be switched
937 off.
938
939 @node Bar lines
940 @subsection Bar lines
941 @cindex Bar lines
942
943 @cindex @code{\bar}
944 @cindex measure lines
945 @cindex repeat bars
946
947
948 Bar lines delimit measures, but are also used to indicate
949 repeats. Line breaks may only happen on barlines.
950
951 @syntax
952
953 Bar lines are inserted automatically.  Special types
954 of barlines can be forced with the @code{\bar} command:
955 @lilypond[relative=1,fragment,verbatim]
956    c4 \bar "|:" c4
957 @end lilypond
958
959 The following bar types are available
960 @lilypond[fragment,  relative, singleline, verbatim]
961 c4
962 \bar "|" c
963 \bar "" c
964 \bar "|:" c
965 \bar "||" c
966 \bar ":|" c
967 \bar ".|" c
968 \bar ".|." c
969 \bar "|." 
970 @end lilypond
971
972 In scores with many staves, the barlines are automatically placed at
973 top level, and they are connected between different staves of a
974 @internalsref{StaffGroup}:
975 @lilypond[fragment, verbatim]
976 < \context StaffGroup <
977   \context Staff = up { e'4 d'
978      \bar "||"
979      f' e' }
980   \context Staff = down { \clef bass c4 g e g } >
981 \context Staff = pedal { \clef bass c2 c2 } >
982 @end lilypond
983
984
985 The command @code{\bar @var{bartype}} is a short cut for
986 doing  @code{\property Score.whichBar = @var{bartype}}
987 Whenever @code{whichBar} is set to a string, a bar line of that type is
988 created.  @code{whichBar} is usually set automatically: at the start of
989 a measure it is set to @code{defaultBarType}. The contents of
990 @code{repeatCommands} is used to override default measure bars.
991
992 @code{whichBar} can also be set directly, using @code{\property} or
993 @code{\bar  }.  These settings take precedence over the automatic
994 @code{whichBar} settings. 
995
996 @cindex whichBar
997 @cindex repeatCommands
998 @cindex defaultBarType
999
1000 You are encouraged to use @code{\repeat} for repetitions.  See
1001 @ref{Repeats}.
1002
1003
1004
1005 @seealso
1006
1007 @ref{Repeats}.
1008
1009
1010 The bar line objects that are created at @internalsref{Staff} level
1011 are called @internalsref{BarLine}, the bar lines that span staffs are
1012 @internalsref{SpanBar}s.
1013
1014
1015 @node Polyphony
1016 @section Polyphony
1017 @cindex polyphony
1018
1019 The easiest way to enter fragments with more than one voice on a staff
1020 is to split chords using the separator @code{\\}.  You can use it for
1021 small, short-lived voices or for single chords:
1022
1023 @lilypond[verbatim,fragment]
1024 \context Voice = VA \relative c'' {
1025  c4 < { f d e  } \\ { b c2 } > c4 < g' \\ b, \\  f' \\ d' >
1026 }
1027 @end lilypond
1028
1029 The separator causes @internalsref{Voice} contexts to be instantiated,
1030 bearing the names @code{"1"}, @code{"2"}, etc. In each of these
1031 contexts, vertical direction of slurs, stems, etc. are set
1032 appropriately.
1033
1034 This can also be done by instantiating @internalsref{Voice} contexts
1035 by hand, and using @code{\voiceOne}, up to @code{\voiceFour} to assign
1036 a stem directions and horizontal shift for each part.
1037 @c
1038
1039 @lilypond[singleline, verbatim]
1040 \relative c''
1041 \context Staff < \context Voice = VA { \voiceOne cis2 b  }
1042   \context Voice = VB { \voiceThree b4 ais ~ ais4 gis4 } 
1043   \context Voice = VC { \voiceTwo fis4~  fis4 f ~ f  } >
1044 @end lilypond
1045
1046 Normally, note heads with a different number of dots are not merged, but
1047 when  the object property @code{merge-differently-dotted} is set in
1048 the @internalsref{NoteCollision} object, they are:
1049 @lilypond[verbatim,fragment,singleline]
1050 \relative c' \context Voice < {
1051      g8 g8 
1052      \property Staff.NoteCollision \override
1053         #'merge-differently-dotted = ##t
1054      g8 g8
1055   } \\ { g8.-[ f16-] g8.-[ f16-] } 
1056   >
1057 @end lilypond
1058
1059 Similarly, you can merge half note heads with eighth notes, by setting
1060 @code{merge-differently-headed}:
1061 @lilypond[fragment, relative=2,verbatim]
1062 \context Voice < {
1063     c8 c4.
1064     \property Staff.NoteCollision
1065       \override #'merge-differently-headed = ##t
1066     c8 c4. } \\ { c2 c2 } >
1067 @end lilypond
1068
1069 LilyPond also vertically shifts rests that are opposite of a stem. 
1070
1071 @lilypond[singleline,fragment,verbatim]
1072 \context Voice < c''4 \\  r4 >
1073 @end lilypond
1074
1075 @seealso
1076
1077 The objects responsible for resolving collisions are
1078 @internalsref{NoteCollision} and @internalsref{RestCollision}.  See
1079 also example files @inputfileref{input/regression,collision-dots.ly},
1080 @inputfileref{input/regression,collision-head-chords.ly},
1081 @inputfileref{input/regression,collision-heads.ly},
1082 @inputfileref{input/regression,collision-mesh.ly}, and
1083 @inputfileref{input/regression,collisions.ly}.
1084
1085
1086 @refbugs
1087
1088 Resolving collisions is a intricate subject, and only a few situations
1089 are handled. When LilyPond cannot cope, the @code{force-hshift}
1090 property of the @internalsref{NoteColumn} object and pitched rests can
1091 be used to override typesetting decisions.
1092
1093 @node Beaming
1094 @section Beaming
1095
1096 Beams are used to group short notes into chunks that are aligned with
1097 the metrum. They are inserted automatically in most cases.
1098
1099 @lilypond[fragment,verbatim, relative=2]
1100 \time 2/4 c8 c c c \time 6/8 c c c c8. c16  c8
1101 @end lilypond
1102
1103 When these automatic decisions are not good enough, beaming can be
1104 entered explicitly. It is also possible to define  beaming patterns
1105 that differ from the defaults.
1106
1107 @seealso
1108
1109 @internalsref{Beam}. 
1110
1111
1112 @cindex Automatic beams
1113 @subsection Manual beams
1114 @cindex beams, manual
1115 @cindex @code{]}
1116 @cindex @code{[}
1117
1118 In some cases it may be necessary to override the automatic beaming
1119 algorithm.  For example, the auto beamer will not beam over rests or
1120 bar lines, If you want that, specify the begin and end point manually
1121 using @code{[} and @code{]}.
1122
1123 @lilypond[fragment,relative,verbatim]
1124   \context Staff {
1125     r4 r8-[ g' a r8-] r8 g-[ | a-] r8
1126   }
1127 @end lilypond
1128
1129 @cindex @code{stemLeftBeamCount}
1130
1131 Normally, beaming patterns within a beam are determined automatically.
1132 When this mechanism fouls up, the properties
1133 @code{Voice.stemLeftBeamCount} and @code{Voice.stemRightBeamCount} can
1134 be used to control the beam subdivision on a stem.  If either property
1135 is set, its value will be used only once, and then it is erased.
1136
1137 @lilypond[fragment,relative,verbatim]
1138   \context Staff {
1139     f8-[ r16 f g a-]
1140     f8-[ r16 \property Voice.stemLeftBeamCount = #1 f g a-]
1141   }
1142 @end lilypond
1143 @cindex @code{stemRightBeamCount}
1144
1145
1146 The property @code{subdivideBeams} can be set in order to subdivide
1147 all 16th or shorter beams at beat positions.  This accomplishes the
1148 same effect as twiddling with @code{stemLeftBeamCount} and
1149 @code{stemRightBeamCount}, but it take less typing.
1150
1151
1152 @lilypond[relative=1,verbatim,noindent]
1153         c16-[ c c c c c c c-]
1154         \property Voice.subdivideBeams = ##t
1155         c16-[ c c c c c c c-]
1156         c32-[ c c c c c c c c c c c c c c c-]
1157         \property Score.beatLength = #(ly:make-moment 1 8)
1158         c32-[ c c c c c c c c c c c c c c c-]
1159 @end lilypond
1160 @cindex subdivideBeams
1161
1162 Kneed beams are inserted automatically, when a large gap is detected
1163 between the note heads.  This behavior can be tuned through the object
1164 property @code{auto-knee-gap}.
1165
1166 @cindex beams, kneed
1167 @cindex kneed beams
1168 @cindex auto-knee-gap
1169
1170
1171
1172 @refbugs
1173
1174 @cindex hara kiri
1175
1176 Automatically kneed beams cannot be used together with Hara Kiri
1177 staves.
1178
1179
1180 @menu
1181 * Setting automatic beam behavior ::  
1182 @end menu
1183
1184 @ignore
1185 @no de Beam typography
1186 @sub section Beam typography
1187
1188 One of the strong points of LilyPond is how beams are formatted. Beams
1189 are quantized, meaning that the left and right endpoints beams start
1190 exactly on staff lines. Without quantization, small wedges of white
1191 space appear between the beam and staff line, and this looks untidy.
1192
1193 Beams are also slope-damped: melodies that go up or down should also
1194 have beams that go up or down, but the slope of the beams should be
1195 less than the slope of the notes themselves.
1196
1197 Some beams should be horizontal. These are so-called concave beams. 
1198
1199 [TODO: some pictures.]
1200 @end ignore
1201
1202
1203 @node Setting automatic beam behavior 
1204 @subsection Setting automatic beam behavior 
1205
1206 @cindex @code{autoBeamSettings}
1207 @cindex @code{(end * * * *)}
1208 @cindex @code{(begin * * * *)}
1209 @cindex automatic beams, tuning
1210 @cindex tuning automatic beaming
1211
1212 [TODO: use \applycontext]
1213
1214 In normal time signatures, automatic beams can start on any note but can
1215 only end in a few positions within the measure: beams can end on a beat,
1216 or at durations specified by the properties in
1217 @code{Voice.autoBeamSettings}. The defaults for @code{autoBeamSettings}
1218 are defined in @file{scm/auto-beam.scm}.
1219
1220 The value of @code{autoBeamSettings} is changed using
1221 @code{\override} and unset using @code{\revert}:
1222 @example
1223 \property Voice.autoBeamSettings \override #'(@var{BE} @var{P} @var{Q} @var{N} @var{M}) = @var{dur}
1224 \property Voice.autoBeamSettings \revert #'(@var{BE} @var{P} @var{Q} @var{N} @var{M})
1225 @end example
1226 Here, @var{BE} is the symbol @code{begin} or @code{end}. It determines
1227 whether the rule applies to begin or end-points.  The quantity
1228 @var{P}/@var{Q} refers to the length of the beamed notes (and `@code{*
1229 *}' designates notes of any length), @var{N}/@var{M} refers to a time
1230 signature (wildcards, `@code{* *}' may be entered to designate all time
1231 signatures).
1232
1233 For example, if automatic beams should end on every quarter note, use
1234 the following:
1235 @example
1236 \property Voice.autoBeamSettings \override
1237     #'(end * * * *) = #(ly:make-moment 1 4)
1238 @end example
1239 Since the duration of a quarter note is 1/4 of a whole note, it is
1240 entered as @code{(ly:make-moment 1 4)}.
1241
1242 The same syntax can be used to specify beam starting points. In this
1243 example, automatic beams can only end on a dotted quarter note. 
1244 @example
1245 \property Voice.autoBeamSettings \override
1246     #'(end * * * *) = #(ly:make-moment 3 8)
1247 @end example
1248 In 4/4 time signature, this means that automatic beams could end only on
1249 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
1250 3/8 has passed within the measure).
1251
1252 Rules can also be restricted to specific time signatures. A rule that
1253 should only be applied in @var{N}/@var{M} time signature is formed by
1254 replacing the second asterisks by @var{N} and @var{M}. For example, a
1255 rule for 6/8 time exclusively looks like
1256 @example
1257 \property Voice.autoBeamSettings \override
1258     #'(begin * * 6 8) =  ... 
1259 @end example
1260
1261 If a rule should be to applied only to certain types of beams, use the
1262 first pair of asterisks. Beams are classified according to the
1263 shortest note they contain. For a beam ending rule that only applies
1264 to beams with 32nd notes (and no shorter notes), use @code{(end 1 32 *
1265 *)}.
1266
1267 If a score ends while an automatic beam has not been ended and is still
1268 accepting notes, this last beam will not be typeset at all.
1269
1270 @cindex automatic beam generation
1271 @cindex autobeam
1272 @cindex @code{Voice.autoBeaming}
1273 @cindex lyrics
1274
1275 For melodies that have lyrics, you may want to switch off 
1276 automatic beaming. This is done by setting @code{Voice.autoBeaming} to
1277 @code{#f}. 
1278
1279
1280 @refbugs
1281
1282 It is not possible to specify beaming parameters for beams with mixed
1283 durations, that differ from the beaming parameters of all separate
1284 durations, i.e., you will have to specify manual beams to get:
1285
1286 @lilypond[singleline,fragment,relative,noverbatim,quote]
1287   \property Voice.autoBeamSettings
1288   \override #'(end * * * *) = #(ly:make-moment 3 8)
1289   \time 12/8 c'8 c c c16 c c c c c c-[ c c c-] c8 c c4
1290 @end lilypond
1291 It is not possible to specify beaming parameters that act differently in
1292 different parts of a measure. This means that it is not possible to use
1293 automatic beaming in irregular meters such as @code{5/8}.
1294
1295 @node Accidentals
1296 @section Accidentals
1297 @cindex Accidentals
1298
1299 This section describes how to change the way that LilyPond automatically
1300 inserts accidentals before the running notes.
1301
1302
1303 @menu
1304 * Using the predefined accidental variables::  
1305 * Customized accidental rules::  
1306 @end menu
1307
1308 @node Using the predefined accidental variables
1309 @subsection Using the predefined accidental variables
1310
1311 The constructs for describing the accidental typesetting rules are
1312 quite hairy, so non-experts should stick to the variables
1313 defined in @file{ly/property-init.ly}.
1314 @cindex @file{property-init.ly}
1315
1316 The variables set properties in the ``Current'' context (see
1317 @ref{Context properties}). This means that the variables should
1318 normally be added right after the creation of the context in which the
1319 accidental typesetting described by the variable is to take
1320 effect. For example, if you want to use piano-accidentals in a piano
1321 staff then issue @code{\pianoAccidentals} first thing after the
1322 creation of the piano staff:
1323 @example
1324 \score @{
1325     \notes \relative c'' <
1326         \context Staff = sa @{ cis4 d e2 @}
1327         \context GrandStaff <
1328             \pianoAccidentals
1329             \context Staff = sb @{ cis4 d e2 @}
1330             \context Staff = sc @{ es2 c @}
1331         >
1332         \context Staff = sd @{ es2 c @}
1333     >
1334 @}
1335 @end example
1336 @lilypond[singleline]
1337 \score {
1338     \notes \relative c'' <
1339         \context Staff = sa { cis4 d e2 }
1340         \context GrandStaff <
1341             \pianoAccidentals
1342             \context Staff = sb { cis4 d e2 }
1343             \context Staff = sc { es2 c }
1344         >
1345         \context Staff = sd { es2 c }
1346     >
1347     \paper {
1348         \translator {
1349             \StaffContext
1350             minimumVerticalExtent = #'(-4.0 . 4.0)
1351         }
1352     }
1353 }
1354 @end lilypond
1355
1356 The variables are:
1357 @table @code
1358 @item \defaultAccidentals
1359       @cindex @code{\defaultAccidentals}
1360       This is the default typesetting behaviour. It should correspond
1361       to 18th century common practice: Accidentals are
1362       remembered to the end of the measure in which they occur and
1363       only on their own octave.
1364
1365 @item \voiceAccidentals
1366       @cindex @code{\voiceAccidentals}
1367 @c
1368       The normal behaviour is to
1369 remember the accidentals on Staff-level.  This variable, however,
1370 typesets accidentals individually for each voice.  Apart from that the
1371 rule is similar to @code{\defaultAccidentals}.
1372
1373       This leads to some weird and often unwanted results
1374       because accidentals from one voice do not get cancelled in other
1375       voices:
1376 @lilypond[singleline,relative,fragment,verbatim,quote]
1377     \context Staff <
1378         \voiceAccidentals
1379         <
1380          { es g } \\
1381          { c, e }
1382      > >
1383 @end lilypond
1384       Hence you should only use @code{\voiceAccidentals} if the voices
1385 are to be read solely by individual musicians. If the staff is to be
1386 used by one musician (e.g., a conductor) then you use
1387 @code{\modernVoiceAccidentals} or @code{\modernVoiceCautionaries}
1388 instead.
1389
1390 @item \modernAccidentals
1391       @cindex @code{\modernAccidentals}
1392       This rule  corresponds to the common practice in the 20th
1393       century.
1394       The rule is  more complex than @code{\defaultAccidentals}.
1395       You get all the same accidentals, but temporary
1396       accidentals also get cancelled in other octaves. Further more,
1397       in the same octave, they also get cancelled in the following measure:
1398 @lilypond[singleline,fragment,verbatim]
1399       \modernAccidentals
1400       cis' c'' cis'2 | c'' c'
1401 @end lilypond
1402
1403 @item \modernCautionaries
1404       @cindex @code{\modernCautionaries}
1405      This rule is similar to @code{\modernAccidentals}, but the
1406      ``extra'' accidentals (the ones not typeset by
1407      @code{\defaultAccidentals}) are typeset as cautionary accidentals
1408      (i.e. in reduced size):
1409 @lilypond[singleline,fragment,verbatim]
1410       \modernCautionaries
1411       cis' c'' cis'2 | c'' c'
1412 @end lilypond
1413
1414       @cindex @code{\modernVoiceAccidentals}
1415 @item \modernVoiceAccidentals
1416 is used for multivoice accidentals to be read both by musicians
1417 playing one voice and musicians playing all voices.  Accidentals are
1418 typeset for each voice, but they @emph{are} cancelled across voices in
1419 the same @internalsref{Staff}.
1420
1421       @cindex @code{\modernVoiceCautionaries}
1422 @item \modernVoiceCautionaries
1423 is the same as @code{\modernVoiceAccidentals}, but with the extra
1424 accidentals (the ones not typeset by @code{\voiceAccidentals}) typeset
1425 as cautionaries.  Even though all accidentals typeset by
1426 @code{\defaultAccidentals} @emph{are} typeset by this variable then
1427 some of them are typeset as cautionaries.
1428
1429 @item \pianoAccidentals
1430       @cindex @code{\pianoAccidentals}
1431       20th century practice for piano notation. Very similar to
1432       @code{\modernAccidentals} but accidentals also get cancelled
1433       across the staves in the same @internalsref{GrandStaff} or
1434       @internalsref{PianoStaff}.
1435
1436 @item \pianoCautionaries
1437       @cindex @code{\pianoCautionaries}
1438       As @code{\pianoAccidentals} but with the extra accidentals
1439       typeset as cautionaries.
1440
1441 @item \noResetKey
1442       @cindex @code{\noResetKey}
1443       Same as @code{\defaultAccidentals} but with accidentals lasting
1444       ``forever'' and not only until the next measure:
1445 @lilypond[singleline,fragment,verbatim,relative]
1446       \noResetKey
1447       c1 cis cis c
1448 @end lilypond
1449
1450 @item \forgetAccidentals
1451       @cindex @code{\forgetAccidentals}
1452       This is sort of the opposite of @code{\noResetKey}: Accidentals
1453       are not remembered at all - and hence all accidentals are
1454       typeset relative to the key signature, regardless of what was
1455       before in the music:
1456 @lilypond[singleline,fragment,verbatim,relative]
1457       \forgetAccidentals
1458       \key d\major c4 c cis cis d d dis dis
1459 @end lilypond
1460 @end table
1461
1462 @node Customized accidental rules
1463 @subsection  Customized accidental rules
1464
1465 This section must be considered gurus-only, and hence it must be
1466 sufficient with a short description of the system and a reference to
1467 the internal documentation.
1468
1469 The algorithm tries several different rules, and uses the rule
1470 that gives the highest number of accidentals.  Each rule consists of
1471 @table @var
1472 @item context:
1473       In which context is the rule applied. For example, if
1474 @var{context} is @internalsref{Score} then all staves share
1475 accidentals, and if @var{context} is @internalsref{Staff} then all
1476 voices in the same staff share accidentals, but staves do not.
1477 @item octavation:
1478       Whether the accidental changes all octaves or only the current
1479       octave.
1480 @item lazyness:
1481       Over how many barlines the accidental lasts.
1482       If @var{lazyness} is @code{-1} then the accidental is forget
1483       immediately, and if @var{lazyness} is @code{#t} then the accidental
1484       lasts forever.
1485
1486 [TODO: should use  +infinity for this case?]
1487
1488 @end table
1489
1490 @seealso
1491
1492 @internalsref{Accidental_engraver}, @internalsref{Accidental},
1493 @internalsref{AccidentalPlacement}.
1494
1495
1496 @refbugs
1497
1498 Currently the simultaneous notes are considered to be entered in
1499 sequential mode. This means that in a chord the accidentals are
1500 typeset as if the notes in the chord happened one at a time - in the
1501 order in which they appear in the input file.
1502
1503 This is only a problem when there are simultaneous notes whose
1504 accidentals depend on each other.  The problem only occurs when using
1505 non-default accidentals. In the default scheme, accidentals only
1506 depend on other accidentals with the same pitch on the same staff, so
1507 no conflicts possible.
1508
1509 This example shows two examples of the same music giving different
1510 accidentals depending on the order in which the notes occur in the
1511 input file:
1512
1513 @lilypond[singleline,fragment,verbatim]
1514 \property Staff.autoAccidentals = #'( Staff (any-octave . 0) )
1515 cis'4 <<c'' c'>> r2 | cis'4 <<c' c''>> r2
1516 | <<cis' c''>> r | <<c'' cis'>> r | 
1517 @end lilypond
1518
1519 This problem can be solved by manually inserting @code{!} and @code{?}
1520 for the problematic notes.
1521
1522 @node Expressive marks
1523 @section Expressive marks
1524
1525 @menu
1526 * Slurs ::                      
1527 * Phrasing slurs::              
1528 * Breath marks::                
1529 * Metronome marks::             
1530 * Text spanners::               
1531 * Analysis brackets::           
1532 @end menu
1533
1534 @node Slurs 
1535 @subsection Slurs
1536 @cindex Slurs
1537
1538 A slur indicates that notes are to be played bound or @emph{legato}.
1539
1540 @syntax
1541
1542 They are entered using parentheses:
1543 @lilypond[fragment,verbatim,center]
1544   f'-( g'-)-( a'-) a'8-[ b'-(-] a'4 g'2 f'4-)
1545   <<c' e'>>2-( <<b d'>>2-)
1546 @end lilypond
1547
1548
1549 @c TODO: should explain that ^( and _( set directions
1550 @c should set attachments with ^ and _ ?  
1551
1552 Slurs avoid crossing stems, and are generally attached to note heads.
1553 However, in some situations with beams, slurs may be attached to stem
1554 ends.  If you want to override this layout you can do this through the
1555 object property @code{attachment} of @internalsref{Slur} in
1556 @internalsref{Voice} context.  Its value is a pair of symbols, specifying
1557 the attachment type of the left and right end points.
1558
1559 @lilypond[fragment,relative,verbatim]
1560   \slurUp
1561   \property Voice.Stem \set #'length = #5.5
1562   g'8-(g g4-)
1563   \property Voice.Slur \set #'attachment = #'(stem . stem)
1564   g8-( g g4-)
1565 @end lilypond
1566
1567 If a slur would strike through a stem or beam, the slur will be moved
1568 away upward or downward. If this happens, attaching the slur to the
1569 stems might look better:
1570
1571 @lilypond[fragment,relative,verbatim]
1572   \stemUp \slurUp
1573   d32-( d'4 d8..-)
1574   \property Voice.Slur \set #'attachment = #'(stem . stem)
1575   d,32-( d'4 d8..-)
1576 @end lilypond
1577
1578 @seealso
1579
1580 @seeinternals{Slur}, @internalsref{SlurEvent}.
1581
1582
1583 @refbugs
1584
1585 Producing nice slurs is a difficult problem, and LilyPond currently
1586 uses a simple, empiric method to produce slurs. In some cases, the
1587 results of this method are ugly.
1588
1589
1590 @cindex Adjusting slurs
1591
1592 @node Phrasing slurs
1593 @subsection Phrasing slurs
1594
1595 @cindex phrasing slurs
1596 @cindex phrasing marks
1597
1598 A phrasing slur (or phrasing mark) connects chords and is used to
1599 indicate a musical sentence. It is started using @code{\(} and @code{\)}
1600 respectively.
1601
1602 @lilypond[fragment,verbatim,center,relative]
1603   \time 6/4 c'-\(  d-( e-) f-( e-)  d-\) 
1604 @end lilypond
1605
1606 Typographically, the phrasing slur behaves almost exactly like a
1607 normal slur.  However, they are treated as different objects.  A
1608 @code{\slurUp} will have no effect on a phrasing slur; instead, you
1609 should use @code{\phrasingSlurUp}, @code{\phrasingSlurDown}, and
1610 @code{\phrasingSlurBoth}.
1611
1612 The commands @code{\slurUp}, @code{\slurDown}, and @code{\slurBoth}
1613 will only affect normal slurs and not phrasing slurs.
1614
1615 @seealso
1616
1617 See also @internalsref{PhrasingSlur},
1618 @internalsref{PhrasingSlurEvent}.
1619
1620 @refbugs
1621
1622 Phrasing slurs have the same limitations in their formatting as normal
1623 slurs.
1624
1625 @node Breath marks
1626 @subsection Breath marks
1627
1628 Breath marks are entered using @code{\breathe}.
1629
1630
1631 @lilypond[fragment,relative]
1632 c'4 \breathe d4
1633 @end lilypond
1634
1635 The glyph of the breath mark can be tweaked by overriding the
1636 @code{text} property of the @code{BreathingSign} grob with the name of
1637 any glyph of @ref{The Feta font}.  For example,
1638 @lilypond[fragment,verbatim,relative]
1639 c'4
1640 \property Voice.BreathingSign \override #'text = #"scripts-rvarcomma"
1641 \breathe
1642 d4
1643 @end lilypond
1644
1645 @seealso 
1646
1647 @internalsref{BreathingSign}, @internalsref{BreathingSignEvent},
1648 @inputfileref{input/regression,breathing-sign.ly}.
1649
1650
1651 @node Metronome marks
1652 @subsection Metronome marks
1653
1654 @cindex Tempo
1655 @cindex beats per minute
1656 @cindex metronome marking
1657
1658 Metronome settings can be entered as follows:
1659 @example 
1660   \tempo @var{duration} = @var{perminute} 
1661 @end example
1662
1663 In the MIDI output, they are interpreted as a tempo change, and in the
1664 paper output, a metronome marking is printed
1665 @cindex @code{\tempo}
1666 @lilypond[fragment,verbatim]
1667   \tempo 8.=120 c''1
1668 @end lilypond
1669
1670 @seealso
1671
1672 @internalsref{TempoEvent}
1673   
1674
1675
1676 @node Text spanners
1677 @subsection Text spanners
1678 @cindex Text spanners
1679
1680 Some performance indications, e.g. @i{rallentando} or @i{accelerando},
1681 are written as texts, and extended over many measures with dotted
1682 lines.  You can create such texts using text spanners: attach
1683 @code{\startTextSpan} and @code{\stopTextSpan} to the
1684 start and ending note of the spanner. 
1685
1686 The string to be printed, as well as the style, is set through object
1687 properties.
1688
1689 @lilypond[fragment,relative,verbatim]
1690  \relative c' {  c1 
1691   \property Voice.TextSpanner \set #'direction = #-1
1692   \property Voice.TextSpanner \set #'edge-text = #'("rall " . "")
1693   c2-\startTextSpan b c-\stopTextSpan a }
1694 @end lilypond
1695
1696
1697 @seealso
1698
1699 @internalsref{TextSpanEvent},
1700 @internalsref{TextSpanner}, @inputfileref{input/regression,text-spanner.ly}.
1701
1702
1703 @node Analysis brackets
1704 @subsection Analysis brackets
1705 @cindex brackets
1706 @cindex phrasing brackets
1707 @cindex musicological analysis
1708 @cindex note grouping bracket
1709
1710 Brackets are used in musical analysis to indicate structure in musical
1711 pieces. LilyPond supports a simple form of nested horizontal brackets.
1712 To use this, add the @internalsref{Horizontal_bracket_engraver} to
1713 @internalsref{Staff} context.  A bracket is started with
1714 @code{\startGroup} and closed with @code{\stopGroup}. 
1715
1716 @lilypond[singleline,verbatim]
1717 \score { \notes \relative c'' {  
1718         c4-\startGroup-\startGroup
1719         c4-\stopGroup
1720         c4-\startGroup
1721         c4-\stopGroup-\stopGroup
1722   }
1723   \paper { \translator {
1724             \StaffContext \consists "Horizontal_bracket_engraver"
1725         }}}
1726 @end lilypond
1727
1728 @seealso
1729
1730 @internalsref{HorizontalBracket}, @internalsref{NoteGroupingEvent},
1731 @inputfileref{input/regression,note-group-bracket.ly}. 
1732
1733 @refbugs
1734
1735 Bracket endings should be angled/slanted. (TODO)
1736  
1737
1738
1739
1740
1741 @node Articulations
1742 @section Articulations
1743 @cindex Articulations
1744
1745 @cindex articulations
1746 @cindex scripts
1747 @cindex ornaments
1748
1749 A variety of symbols can appear above and below notes to indicate
1750 different characteristics of the performance. They are added to a note
1751 by adding a dash and  the character signifying the
1752 articulation. They are demonstrated here.
1753
1754 @lilypondfile[notexidoc]{script-abbreviations.ly}
1755
1756 The script is automatically placed, but if you need to force
1757 directions, you can use @code{_} to force them down, or @code{^} to
1758 put them up:
1759 @lilypond[fragment, verbatim]
1760   c''4^^ c''4_^
1761 @end lilypond
1762
1763
1764
1765
1766 Other symbols can be added using the syntax
1767 @var{note}@code{-\}@var{name}. Again, they can be forced up or down
1768 using @code{^} and @code{_}.
1769
1770 @cindex accent
1771 @cindex marcato
1772 @cindex staccatissimo
1773 @cindex fermata
1774 @cindex stopped
1775 @cindex staccato
1776 @cindex portato
1777 @cindex tenuto
1778 @cindex upbow
1779 @cindex downbow
1780 @cindex foot marks
1781 @cindex organ pedal marks
1782 @cindex turn
1783 @cindex open
1784 @cindex flageolet
1785 @cindex reverseturn
1786 @cindex trill
1787 @cindex prall
1788 @cindex mordent
1789 @cindex prallprall
1790 @cindex prallmordent
1791 @cindex prall, up
1792 @cindex prall, down
1793 @cindex mordent
1794 @cindex thumb marking
1795 @cindex segno
1796 @cindex coda
1797 @cindex varcoda
1798
1799 @lilypondfile[notexidoc]{script-chart.ly}
1800
1801 @seealso
1802
1803 @internalsref{ScriptEvent}, @internalsref{Script}.
1804
1805 @refbugs
1806
1807 All of these note ornaments appear in the printed output but have no
1808 effect on the MIDI rendering of the music.
1809
1810
1811 @node Fingering instructions
1812 @section Fingering instructions
1813
1814 @cindex fingering
1815
1816 Fingering instructions can be entered using
1817 @example
1818   @var{note}-@var{digit}
1819 @end example
1820 For finger changes, use markup texts:
1821 @c
1822 @lilypond[verbatim, singleline, fragment]
1823       c'4-1 c'4-2 c'4-3 c'4-4
1824       c'^\markup { \fontsize #-3 \number "2-3" }
1825 @end lilypond
1826
1827 @cindex finger change
1828 @cindex scripts
1829 @cindex superscript
1830 @cindex subscript
1831
1832 @lilypond[verbatim,singleline,fragment,relative=1]
1833         << c-1  e-2 g-3 b-5 >> 4
1834         \property Voice.fingerHorizontalDirection = #LEFT
1835         << c-1  es-3 g-5 >> 4
1836         \property Voice.fingerHorizontalDirection = #RIGHT
1837         << c-1  e-2 g-3 b-5 >>4
1838         \property Voice.fingerHorizontalDirection = #LEFT
1839         << c_1  e-2 g-3 b^5 >>4
1840 @end lilypond
1841         
1842 @seealso
1843
1844 @internalsref{FingerEvent} and @internalsref{Fingering}.
1845
1846
1847 @menu
1848 * Text scripts::                
1849 * Grace notes::                 
1850 * Glissando ::                  
1851 * Dynamics::                    
1852 @end menu
1853
1854 @node Text scripts
1855 @subsection Text scripts
1856 @cindex Text scripts
1857
1858 It is possible to place arbitrary strings of text or markup text (see
1859 @ref{Text markup}) above or below notes by using a string:
1860 @code{c^"text"}.  By default, these indications do not influence the
1861 note spacing, but by using the command @code{\fatText}, the widths
1862 will be taken into account.
1863 @c
1864 @lilypond[fragment,singleline,verbatim] \relative c' {
1865 c4^"longtext" \fatText c4_"longlongtext" c4 }
1866 @end lilypond
1867
1868 It is possible to use @TeX{} commands in the strings, but this should be
1869 avoided because it makes it impossible for LilyPond to compute the
1870 exact length of the string, which may lead to collisions.  Also, @TeX{}
1871 commands will not work with direct PostScript output.
1872
1873
1874 @seealso
1875
1876 @internalsref{TextScriptEvent}, @internalsref{TextScript},
1877 @ref{Text markup}.
1878
1879
1880
1881 @node Grace notes
1882 @subsection Grace notes
1883
1884
1885
1886 @cindex @code{\grace}
1887 @cindex ornaments
1888 @cindex grace notes
1889
1890 Grace notes are ornaments that are written out
1891
1892 @lilypond[relative=2,verbatim,fragment] c4 \grace c16 c4 \grace {
1893 [c16 d16] } c4
1894 @end lilypond
1895
1896 In normal notation, grace notes take up no logical
1897 time in a measure. Such an idea is practical for normal notation, but
1898 is not strict enough to put it into a program. The model that LilyPond
1899 uses for grace notes internally is that all timing is done in two
1900 steps:
1901
1902 Every point in musical time consists of two rational numbers: one
1903 denotes the logical time, one denotes the grace timing. The above
1904 example is shown here with timing tuples.
1905
1906 @lilypond[]
1907 \score { \notes \relative c''{ 
1908   c4^"(0,0)"  \grace c16_" "_"(1/4,-1/16)"  c4^"(1/4,0)"  \grace {
1909   c16_"(2/4,-1/8)"-[  d16^"(2/4,-1/16)" ] } c4_" "_"(2/4,0)"
1910   }
1911 \paper {  linewidth = 8.\cm }
1912 }
1913 @end lilypond
1914
1915
1916 The placement of these grace notes is synchronized between different
1917 staves.
1918
1919 @lilypond[relative=2,verbatim,fragment] 
1920 < \context Staff = SA { e4 \grace { c16-[ d e f-] } e4 }
1921   \context Staff = SB { c'4 \grace { g8 b } c4 } >
1922 @end lilypond
1923
1924
1925 Unbeamed eighth notes and shorter by default have a slash through the
1926 stem. This can be controlled with object property @code{stroke-style} of
1927 @internalsref{Stem}. For proper  matching of override and reverts of
1928 such properties, it is necessary to use a Scheme function.
1929
1930 The following fragment overrides the default formatting Grace style stems.
1931 @example
1932   #(add-to-grace-init "Voice" 'Stem  'stroke-style '())
1933 @end example
1934
1935 The @code{\override} is carefully matched with a @code{\revert}.
1936
1937 @cindex slash
1938 @cindex grace slash
1939
1940 @lilypond[fragment,verbatim]
1941 \relative c'' \context Voice {
1942   \grace c8 c4 \grace { c16-[ c16-] } c4
1943   \grace { 
1944     \property Voice.Stem \override #'stroke-style = #'() 
1945     c16 
1946     \property Voice.Stem \revert #'stroke-style
1947   } c4
1948 }
1949 @end lilypond
1950
1951 If you want to end a note with a grace note, then the standard trick
1952 is to put the grace notes before a phantom ``space note'', e.g.
1953 @lilypond[fragment,verbatim, relative=2]
1954 \context Voice {
1955     < { d1^\trill ( }
1956      { s2 \grace { c16-[ d-] } } >
1957    )c4
1958 }
1959 @end lilypond
1960
1961 A @code{\grace} section has some default values, and LilyPond will
1962 use those default values unless you specify otherwise inside the
1963 @code{\grace} section.  For example, if you specify \slurUp
1964 @emph{before} your @code{\grace} section, a slur which starts inside
1965 the @code{\grace} will not be forced up, even if the slur ends outside
1966 of the @code{\grace}.  Note the difference between the first and
1967 second bars in this example:
1968
1969 @lilypond[fragment,verbatim]
1970 \relative c'' \context Voice {
1971     \slurUp
1972     \grace {
1973         a4-( }
1974     ) a4 a4-( a2-)
1975     \slurBoth
1976
1977     \grace {
1978         \slurUp
1979         a4-( }
1980     ) a4 a4-( a2-)
1981     \slurBoth
1982 }
1983 @end lilypond
1984
1985
1986 @seealso
1987
1988 @internalsref{GraceMusic}.
1989
1990 @refbugs
1991
1992 Grace notes cannot be used in the smallest size (@file{paper11.ly}).
1993
1994 Grace note synchronization can also lead to surprises. Staff notation,
1995 such as key signatures, barlines, etc. are also synchronized. Take
1996 care when you mix staves with grace notes and staves without.
1997
1998 @lilypond[relative=2,verbatim,fragment]
1999 < \context Staff = SA { e4 \bar "|:" \grace c16 d4 }
2000   \context Staff = SB { c4 \bar "|:"  d4 } >
2001 @end lilypond
2002
2003 Grace sections should only be used within sequential music
2004 expressions.  Nesting, juxtaposing, or ending sequential music with a
2005 grace section is not supported, and might produce crashes or other
2006 errors.
2007
2008 Overriding settings for grace music using @code{add-to-grace-init}
2009 cannot be done in a modular way.
2010
2011
2012 @node Glissando 
2013 @subsection Glissando
2014 @cindex Glissando 
2015
2016 @cindex @code{\glissando}
2017
2018 A glissando is a smooth change in pitch. It is denoted by a line or a
2019 wavy line between two notes.
2020
2021 @syntax
2022
2023 A glissando line can be requested by attaching a @code{\glissando} to
2024 a note:
2025
2026 @lilypond[fragment,relative,verbatim]
2027   c'-\glissando c'
2028 @end lilypond
2029
2030 @seealso
2031
2032 @internalsref{Glissando}, @internalsref{GlissandoEvent}.
2033
2034
2035 @refbugs
2036
2037 Printing of an additional text (such as @emph{gliss.}) must be done
2038 manually.
2039
2040
2041 @node Dynamics
2042 @subsection Dynamics
2043 @cindex Dynamics
2044
2045
2046
2047 @cindex @code{\ppp}
2048 @cindex @code{\pp}
2049 @cindex @code{\p}
2050 @cindex @code{\mp}
2051 @cindex @code{\mf}
2052 @cindex @code{\f}
2053 @cindex @code{\ff}
2054 @cindex @code{\fff}
2055 @cindex @code{\ffff}
2056 @cindex @code{\fp}
2057 @cindex @code{\sf}
2058 @cindex @code{\sff}
2059 @cindex @code{\sp}
2060 @cindex @code{\spp}
2061 @cindex @code{\sfz}
2062 @cindex @code{\rfz}
2063
2064
2065 Absolute dynamic marks are specified using an variable after a
2066 note: @code{c4-\ff}.  The available dynamic marks are: @code{\ppp},
2067 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2068 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
2069 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}.
2070
2071 @lilypond[verbatim,singleline,fragment,relative]
2072   c'-\ppp c-\pp c -\p c-\mp c-\mf c-\f c-\ff c-\fff
2073   c2-\sf c-\rfz
2074 @end lilypond
2075
2076 @cindex @code{\cr}
2077 @cindex @code{\rc}
2078 @cindex @code{\decr}
2079 @cindex @code{\rced}
2080 @cindex @code{\<}
2081 @cindex @code{\>}
2082 @cindex @code{\"!}
2083
2084
2085
2086 A crescendo mark is started with @code{\cr} and terminated with
2087 @code{\endcr}, and decrescendi similarly with @code{\decr} and
2088 @code{\enddecr}.  There are also shorthands for these marks.  A
2089 crescendo can be started with @code{\<} and a decrescendo can be
2090 started with @code{\>}.  Either one can be terminated with @code{\!}.
2091 Because these marks are bound to notes, if you must use spacer notes
2092 if multiple marks during one note are needed.
2093
2094 @lilypond[fragment,verbatim,center,quote]
2095   c''-\< c''-\!   d''-\decr e''-\rced 
2096   < f''1 { s4 s4-\< s4-\! \>  s4-\! } >
2097 @end lilypond
2098 This may give rise to very short hairpins. Use @code{minimum-length}
2099 in @internalsref{Voice}.@internalsref{HairPin} to lengthen them, for
2100 example:
2101
2102 @example
2103  \property Staff.Hairpin \override #'minimum-length = #5
2104 @end example
2105
2106 You can also use a text saying @emph{cresc.} instead of hairpins. Here
2107 is an example how to do it:
2108
2109 @lilypond[fragment,relative=2,verbatim]
2110   c4 \cresc c4 \endcresc c4
2111 @end lilypond
2112
2113
2114 @cindex crescendo
2115 @cindex decrescendo
2116
2117 You can also supply your own texts:
2118 @lilypond[fragment,relative,verbatim]
2119   \context Voice {
2120     \property Voice.crescendoText = "cresc. poco"
2121     \property Voice.crescendoSpanner = #'dashed-line
2122     a'2-\mf-\< a a a-\!
2123   }
2124 @end lilypond
2125
2126 @cindex diminuendo
2127
2128 @seealso
2129
2130 @internalsref{CrescendoEvent}, @internalsref{DecrescendoEvent},
2131 @internalsref{AbsoluteDynamicEvent}.
2132
2133 Dynamics are objects of @internalsref{DynamicText} and
2134 @internalsref{Hairpin}. Vertical positioning of these symbols is
2135 handled by the @internalsref{DynamicLineSpanner} object.
2136
2137 If you want to adjust padding or vertical direction of the dynamics,
2138 you must set properties for the @internalsref{DynamicLineSpanner}
2139 object. Predefined variables to set the vertical direction are
2140 @code{\dynamicUp} and  @code{\dynamicDown}.
2141
2142 @cindex direction, of dynamics
2143 @cindex @code{\dynamicDown}
2144 @cindex @code{\dynamicUp}
2145
2146
2147 @node Repeats
2148 @section Repeats
2149
2150
2151 @cindex repeats
2152 @cindex @code{\repeat}
2153
2154
2155 Repetition is a central concept in music, and multiple notations exist
2156 for repetitions. In LilyPond, most of these notations can be captured
2157 in a uniform syntax. One of the advantages is, all these repetitions
2158 can be rendered in MIDI accurately.
2159
2160 The following types of repetition are supported:
2161
2162 @table @code
2163 @item unfold
2164 Repeated music is fully written (played) out.  Useful for MIDI
2165 output, and entering repetitive music.
2166
2167 @item volta
2168 This is the normal notation: Repeats are not written out, but
2169 alternative endings (voltas) are printed, left to right.
2170
2171 @ignore
2172 @item fold
2173 Alternative endings are written stacked. This has limited use but may be
2174 used to typeset two lines of lyrics in songs with repeats, see
2175 @inputfileref{input,star-spangled-banner.ly}.
2176 @end ignore
2177
2178 @item tremolo
2179 Make tremolo beams.
2180
2181 @item percent
2182 Make beat or measure repeats. These look like percent signs.
2183
2184 @end table  
2185
2186 @menu
2187 * Repeat syntax::               
2188 * Repeats and MIDI::            
2189 * Manual repeat commands::      
2190 * Tremolo repeats::             
2191 * Tremolo subdivisions::        
2192 * Measure repeats::             
2193 @end menu
2194
2195 @node Repeat syntax
2196 @subsection Repeat syntax
2197
2198 @syntax
2199
2200 LilyPond has one syntactic construct for specifying different types of
2201 repeats.  The syntax is
2202
2203 @example
2204   \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2205 @end example
2206
2207 If you have alternative endings, you may add
2208 @cindex @code{\alternative}
2209 @example
2210  \alternative @code{@{} @var{alternative1}
2211             @var{alternative2}
2212             @var{alternative3} @dots{} @code{@}}
2213 @end example
2214 where each @var{alternative} is a music expression.  If you do not
2215 give enough alternatives for all of the repeats, then the first
2216 alternative is assumed to be played more than once.
2217
2218 Normal notation repeats are used like this:
2219 @lilypond[fragment,verbatim]
2220   c'1
2221   \repeat volta 2 { c'4 d' e' f' }
2222   \repeat volta 2 { f' e' d' c' }
2223 @end lilypond
2224
2225 With alternative endings:
2226 @lilypond[fragment,verbatim]
2227   c'1
2228   \repeat volta 2 {c'4 d' e' f'} 
2229   \alternative { {d'2 d'} {f' f} }
2230 @end lilypond
2231
2232
2233 @lilypond[fragment,verbatim]
2234 \context Staff {
2235   \relative c' {
2236     \partial 4
2237     \repeat volta 4 { e | c2 d2 | e2 f2 | }
2238     \alternative { { g4 g g } { a | a a a a | b2. } }
2239   }
2240 }
2241 @end lilypond
2242
2243 @refbugs
2244
2245  If you do a nested repeat like
2246
2247 @example 
2248 \repeat @dots{}
2249 \repeat @dots{}
2250 \alternative 
2251 @end example 
2252
2253 @noindent
2254 then it is ambiguous to which @code{\repeat} the @code{\alternative}
2255 belongs. This ambiguity is resolved by always having the
2256 @code{\alternative} belong to the inner @code{\repeat}.  For clarity,
2257 it is advisable to use braces in such situations.
2258 @cindex ambiguity
2259
2260 @node Repeats and MIDI
2261 @subsection Repeats and MIDI
2262
2263 @cindex expanding repeats
2264
2265 For instructions on how to unfold repeats for MIDI output, see the
2266 example file @inputfileref{input/test,unfold-all-repeats.ly}.
2267
2268
2269 @refbugs
2270
2271 Timing information is not remembered at the start of an alternative,
2272 so you have to reset timing information after a repeat, e.g. using a
2273 bar-check (See @ref{Bar check}), setting @code{Score.measurePosition}
2274 or entering @code{\partial}.  Similarly, slurs or ties are also not
2275 repeated.
2276
2277
2278 @node Manual repeat commands
2279 @subsection Manual repeat commands
2280
2281 @cindex @code{repeatCommands}
2282
2283 The property @code{repeatCommands} can be used to control the layout of
2284 repeats. Its value is a Scheme list of repeat commands, where each repeat
2285 command can be
2286
2287 @table @code
2288 @item 'start-repeat
2289  Print a |: bar line
2290 @item 'end-repeat
2291  Print a :| bar line
2292 @item (volta . @var{text})
2293  Print a volta bracket saying @var{text}. The text can be specified as
2294 a text string or as a markup text, see @ref{Text markup}. Do not
2295 forget to change the font, as the default number font does not contain
2296 alphabetic characters.
2297 @item (volta . #f) 
2298  Stop a running volta bracket
2299 @end table
2300
2301 @lilypond[verbatim, fragment]
2302  c''4
2303     \property Score.repeatCommands = #'((volta "93") end-repeat)
2304  c''4 c''4
2305     \property Score.repeatCommands = #'((volta #f))
2306  c''4 c''4
2307 @end lilypond
2308
2309
2310 @seealso
2311
2312 @internalsref{VoltaBracket}, @internalsref{RepeatedMusic},
2313 @internalsref{VoltaRepeatedMusic},
2314 @internalsref{UnfoldedRepeatedMusic}
2315 @internalsref{FoldedRepeatedMusic}.
2316
2317 @node Tremolo repeats
2318 @subsection Tremolo repeats
2319 @cindex tremolo beams
2320
2321 To place tremolo marks between notes, use @code{\repeat} with tremolo
2322 style.  
2323 @lilypond[verbatim,center,singleline]
2324 \score { 
2325   \context Voice \notes\relative c' {
2326     \repeat "tremolo" 8 { c16 d16 }
2327     \repeat "tremolo" 4 { c16 d16 }    
2328     \repeat "tremolo" 2 { c16 d16 }
2329     \repeat "tremolo" 4 c16
2330   }
2331 }
2332 @end lilypond
2333
2334 @seealso
2335
2336 Tremolo beams are @internalsref{Beam} objects. Single stem tremolos are
2337 @internalsref{StemTremolo}.  @internalsref{TremoloEvent}.
2338
2339
2340 @refbugs
2341
2342 The single stem tremolo @emph{must} be entered without @code{@{} and
2343 @code{@}}.
2344
2345 @node Tremolo subdivisions
2346 @subsection Tremolo subdivisions
2347 @cindex tremolo marks
2348 @cindex @code{tremoloFlags}
2349
2350 Tremolo marks can be printed on a single note by adding
2351 `@code{:}[@var{length}]' after the note.  The length must be at least 8.
2352 A @var{length} value of 8 gives one line across the note stem.  If the
2353 length is omitted, then then the last value (stored in
2354 @code{Voice.tremoloFlags}) is used.
2355
2356 @lilypond[verbatim,fragment,center]
2357   c'2:8 c':32 | c': c': |
2358 @end lilypond
2359
2360 [TODO : stok is te kort bij 32en]
2361
2362 @refbugs
2363
2364 Tremolos in this style do not carry over into the MIDI output.
2365
2366
2367 @node Measure repeats
2368 @subsection Measure repeats
2369
2370 @cindex percent repeats
2371 @cindex measure repeats
2372
2373 In the @code{percent} style, a note pattern can be repeated. It is
2374 printed once, and then the pattern is replaced with a special sign.
2375 Patterns of a one and two measures are replaced by percent-like signs,
2376 patterns that divide the measure length are replaced by slashes.
2377
2378 @lilypond[verbatim,singleline]
2379  \context Voice { \repeat  "percent" 4  { c'4 }
2380     \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
2381 }
2382 @end lilypond   
2383
2384 @seealso
2385
2386 @internalsref{RepeatSlash}, @internalsref{PercentRepeat},
2387 @internalsref{PercentRepeatedMusic}, and
2388 @internalsref{DoublePercentRepeat}.
2389
2390
2391 @refbugs
2392
2393 Single measure and double measure percent-repeats cannot be nested.
2394
2395 @node Rhythmic music
2396 @section Rhythmic music
2397
2398 Sometimes you might want to show only the rhythm of a melody.  This
2399 can be done with the rhythmic staff. All pitches of notes on such a
2400 staff are squashed, and the staff itself has a single line:
2401
2402 @lilypond[fragment,relative,verbatim]
2403   \context RhythmicStaff {
2404       \time 4/4
2405       c4 e8 f  g2 | r4 g r2 | g1:32 | r1 |
2406   }
2407 @end lilypond
2408
2409 @menu
2410 * Percussion staves::           
2411 * Percussion midi output::      
2412 @end menu
2413
2414 @node Percussion staves
2415 @subsection Percussion staves
2416 @cindex percussion
2417 @cindex drums
2418
2419 To typeset more than one piece of percussion to be played by the same
2420 musician one typically uses a multiline staff where each staff
2421 position refers to a specific piece of percussion.
2422
2423 @syntax
2424
2425 Percussion staves are typeset with help of a set of Scheme
2426 functions. The system is based on the general MIDI drum-pitches.
2427 Include @file{ly/drumpitch-init.ly} to use drum pitches. This file
2428 defines the pitches from the Scheme variable @code{drum-pitch-names},
2429 the definition of which can be read in @file{scm/drums.scm}.  Each
2430 piece of percussion has a full name and an abbreviated name, and both
2431 the full name or the abbreviation may be used in input files.
2432
2433 To typeset the music on a staff apply the function @code{drums->paper}
2434 to the percussion music. This function takes a list of percussion
2435 instrument names, notehead scripts and staff positions (that is:
2436 pitches relative to the C-clef) and transforms the input
2437 music by moving the pitch, changing the notehead and (optionally)
2438 adding a script:
2439 @c
2440 @lilypond[singleline,verbatim,quote]
2441 \include "drumpitch-init.ly"
2442 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2443 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2444 \score {
2445     \apply #(drums->paper 'drums) \context Staff <
2446         \clef percussion
2447         \context Voice = up { \voiceOne \up }
2448         \context Voice = down { \voiceTwo \down }
2449     >
2450 }
2451
2452 @end lilypond
2453 In the above example the music was transformed using the list @code{'drums}.
2454 Currently the following lists are defined in @file{scm/drums.scm}:
2455 @table @code
2456 @item 'drums
2457 To typeset a typical drum kit on a five-line staff.
2458
2459 @lilypond[noindent]
2460 \include "drumpitch-init.ly"
2461 nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
2462     bd sn ss tomh tommh tomml toml tomfh tomfl }
2463 mus = \notes  { cymc cyms cymr hh hhc hho hhho hhp cb hc
2464     bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
2465 \score {
2466     <
2467         \apply #(drums->paper 'drums) \context Staff <
2468             \clef percussion
2469             \mus
2470         >
2471         \context Lyrics \nam 
2472     >
2473     \paper {
2474         linewidth = 100.0\mm
2475         \translator {
2476             \StaffContext
2477             \remove Bar_engraver
2478             \remove Time_signature_engraver
2479             minimumVerticalExtent = #'(-4.0 . 5.0)
2480         }
2481         \translator {
2482             \VoiceContext
2483             \remove Stem_engraver
2484         }
2485    }   
2486 }
2487 @end lilypond
2488
2489 The drum scheme supports six different toms.  When there fewer toms, simply
2490 select the toms that produce the desired result, i.e., to get toms on
2491 the three middle lines you use @code{tommh}, @code{tomml} and
2492 @code{tomfh}.
2493
2494 Because general MIDI does not contain rimshots the sidestick is used
2495 for this purpose instead.
2496 @item 'timbales
2497 To typeset timbales on a two line staff.
2498
2499 @lilypond[singleline]
2500 \include "drumpitch-init.ly"
2501 nam = \lyrics { timh ssh timl ssl cb }
2502 mus = \notes  { timh ssh timl ssl cb s16 }
2503 \score {
2504     <
2505         \apply #(drums->paper 'timbales) \context Staff <
2506             \clef percussion
2507             \mus
2508         >
2509         \context Lyrics \nam 
2510     >
2511     \paper {
2512         \translator {
2513             \StaffContext
2514             \remove Bar_engraver
2515             \remove Time_signature_engraver
2516             StaffSymbol \override #'line-count = #2
2517             StaffSymbol \override #'staff-space = #2
2518             minimumVerticalExtent = #'(-3.0 . 4.0)
2519         }
2520         \translator {
2521             \VoiceContext
2522             \remove Stem_engraver
2523         }
2524
2525     }   
2526 }
2527 @end lilypond
2528 @item 'congas
2529 To typeset congas on a two line staff.
2530
2531 @lilypond[singleline]
2532 \include "drumpitch-init.ly"
2533 nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
2534 mus = \notes  { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
2535 \score {
2536     <
2537         \apply #(drums->paper 'congas) \context Staff <
2538             \clef percussion
2539             \mus
2540         >
2541         \context Lyrics \nam 
2542     >
2543     \paper {
2544         \translator {
2545             \StaffContext
2546             \remove Bar_engraver
2547             \remove Time_signature_engraver
2548             StaffSymbol \override #'line-count = #2
2549             StaffSymbol \override #'staff-space = #2
2550             minimumVerticalExtent = #'(-3.0 . 4.0)
2551         }
2552         \translator {
2553             \VoiceContext
2554             \remove Stem_engraver
2555         }
2556     }   
2557 }
2558 @end lilypond
2559 @item 'bongos
2560 To typeset bongos on a two line staff.
2561
2562 @lilypond[singleline]
2563 \include "drumpitch-init.ly"
2564 nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
2565 mus = \notes  { boh boho bohm ssh bol bolo bolm ssl s16 }
2566 \score {
2567     <
2568         \apply #(drums->paper 'bongos) \context Staff <
2569             \clef percussion
2570             \mus
2571         >
2572         \context Lyrics \nam 
2573     >
2574     \paper {
2575         \translator {
2576             \StaffContext
2577             \remove Bar_engraver
2578             \remove Time_signature_engraver
2579             StaffSymbol \override #'line-count = #2
2580             StaffSymbol \override #'staff-space = #2
2581             minimumVerticalExtent = #'(-3.0 . 4.0)
2582         }
2583         \translator {
2584             \VoiceContext
2585             \remove Stem_engraver
2586         }
2587     }   
2588 }
2589 @end lilypond
2590 @item 'percussion
2591 To typeset all kinds of simple percussion on one line staves.
2592 @lilypond[singleline]
2593 \include "drumpitch-init.ly"
2594 nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
2595 mus = \notes  { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
2596 \score {
2597     <
2598         \apply #(drums->paper 'percussion) \context Staff <
2599             \clef percussion
2600             \mus
2601         >
2602         \context Lyrics \nam 
2603     >
2604     \paper {
2605         \translator {
2606             \StaffContext
2607             \remove Bar_engraver
2608             \remove Time_signature_engraver
2609             StaffSymbol \override #'line-count = #1
2610             minimumVerticalExtent = #'(-2.0 . 3.0)
2611         }
2612         \translator {
2613             \VoiceContext
2614             \remove Stem_engraver
2615         }
2616     }   
2617 }
2618 @end lilypond
2619 @end table
2620
2621 If you do not like any of the predefined lists you can define your own
2622 list at the top of your file:
2623
2624 @lilypond[singleline, verbatim]
2625 #(define mydrums `(
2626         (bassdrum     default   #f        ,(ly:make-pitch -1 2 0))
2627         (snare        default   #f        ,(ly:make-pitch 0 1 0))
2628         (hihat        cross     #f        ,(ly:make-pitch 0 5 0))
2629         (pedalhihat   xcircle   "stopped" ,(ly:make-pitch 0 5 0))
2630         (lowtom       diamond   #f        ,(ly:make-pitch -1 6 0))
2631 ))
2632 \include "drumpitch-init.ly"
2633 up = \notes { hh8 hh hh hh hhp4 hhp }
2634 down = \notes { bd4 sn bd toml8 toml }
2635 \score {    
2636     \apply #(drums->paper 'mydrums) \context Staff <
2637         \clef percussion
2638         \context Voice = up { \voiceOne \up }
2639         \context Voice = down { \voiceTwo \down }
2640     >
2641 }
2642 @end lilypond
2643
2644 To use a modified existing list, one can prepend modifications to the
2645 the existing list:
2646
2647 @example
2648 #(define mydrums (append `(
2649    (bassdrum default #f ,(ly:make-pitch -1 2 0))
2650    (lowtom   diamond #f ,(ly:make-pitch -1 6 0))
2651 ) drums ))
2652 @end example
2653
2654 The file @file{drumpitch-init.ly} replaces the normal pitch names, so
2655 you have to reinclude @file{nederlands.ly} after the
2656 drum-pattern-definitions to enter normal notes.
2657 @c
2658 @lilypond[singleline,verbatim]
2659 \include "drumpitch-init.ly"
2660 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2661 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2662 \include "nederlands.ly"
2663 bass = \notes \transpose c c,, { a4. e8 r e g e }
2664 \score {
2665     <
2666         \apply #(drums->paper 'drums) \context Staff = drums <
2667             \clef percussion
2668             \context Voice = up { \voiceOne \up }
2669             \context Voice = down { \voiceTwo \down }
2670         >
2671         \context Staff = bass { \clef "F_8" \bass }
2672     >
2673 }
2674 @end lilypond
2675
2676 @node Percussion midi output
2677 @subsection Percussion midi output
2678
2679 In order to produce correct midi output you need to produce two score
2680 blocks---one for the paper and one for the midi output.  To use the
2681 percussion channel you set the property @code{instrument} to
2682 @code{'drums}. Because the drum-pitches themself are similar to the
2683 general midi pitches all you have to do is to insert the voices with
2684 none of the scheme functions to get the correct midi output:
2685
2686 @example
2687 \score @{    
2688     \apply #(drums->paper 'mydrums) \context Staff <
2689         \clef percussion
2690         @{ \up @}  \\
2691         @{ \down @}
2692     >
2693     \paper@{@}
2694 @}
2695 \score @{    
2696     \context Staff <
2697         \property Staff.instrument = #'drums
2698         \up \down
2699     >
2700     \midi@{@}
2701 @}
2702 @end example
2703
2704 @refbugs
2705
2706 This scheme is to be considered a temporary implementation.
2707
2708
2709 @node Piano music
2710 @section Piano music
2711
2712 Piano staves are two normal staves coupled with a brace.  The staves
2713 are largely independent, but sometimes voices can cross between the
2714 two staves.  The same notation is also used for harps and other key
2715 instruments.  The @internalsref{PianoStaff} is especially built to
2716 handle this cross-staffing behavior.  In this section we discuss the
2717 @internalsref{PianoStaff} and some other pianistic peculiarities.
2718
2719
2720 @menu
2721 * Automatic staff changes::     
2722 * Manual staff switches::       
2723 * Pedals::                      
2724 * Arpeggio::                    
2725 * Staff switch lines::          
2726 @end menu 
2727
2728 @refbugs
2729
2730 There is no support for putting chords across staves.  You can get
2731 this result by increasing the length of the stem in the lower stave so
2732 it reaches the stem in the upper stave, or vice versa. An example is
2733 included with the distribution as @inputfileref{input/test,stem-cross-staff.ly}.
2734
2735 Dynamics are not centered, but kludges do exist. See
2736 @inputfileref{input/templates,piano-dynamics.ly}.
2737
2738 @cindex cross staff stem
2739 @cindex stem, cross staff
2740
2741
2742 @c fixme: should have hyperlinks as well.
2743
2744
2745
2746
2747
2748 @node Automatic staff changes
2749 @subsection Automatic staff changes
2750 @cindex Automatic staff changes
2751
2752 Voices can switch automatically between the top and the bottom
2753 staff. The syntax for this is
2754 @example
2755   \autochange Staff \context Voice @{ @dots{}@var{music}@dots{} @}
2756 @end example        
2757 The autochanger switches on basis of pitch (central C is the turning
2758 point), and it looks ahead skipping over rests to switch rests in
2759 advance. Here is a practical example:
2760         
2761 @lilypond[verbatim,singleline,quote]
2762 \score { \notes \context PianoStaff <
2763   \context Staff = "up" {
2764     \autochange Staff \context Voice = VA < \relative c' {
2765        g4 a  b c d r4 a g } > }
2766   \context Staff = "down" {
2767        \clef bass
2768        s1*2
2769 } > }
2770 @end lilypond
2771 Spacer rests are used to prevent the bottom staff from
2772 terminating too soon.
2773
2774
2775 @refbugs
2776
2777 The staff switches often do not end up in optimal places. For high
2778 quality output staff switches should be specified manually.
2779
2780  
2781
2782 @node Manual staff switches
2783 @subsection Manual staff switches
2784
2785 @cindex manual staff switches
2786 @cindex staff switch, manual
2787
2788 Voices can be switched between staves manually, using the following command:
2789 @example
2790   \translator Staff = @var{staffname} @var{music}
2791 @end example
2792 The string @var{staffname} is the name of the staff. It switches the
2793 current voice from its current staff to the Staff called
2794 @var{staffname}. Typically @var{staffname} is @code{"up"} or
2795 @code{"down"}.
2796
2797
2798 @node Pedals
2799 @subsection Pedals
2800 @cindex Pedals
2801
2802 Pianos have pedals that alter the way sound are produced. Generally, a
2803 piano has three pedals, sustain, una corda, and sostenuto.
2804
2805 @syntax
2806
2807 Piano pedal instruction can be expressed by attaching
2808 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
2809 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
2810 note or chord.
2811
2812 The symbols that are printed can be modified by setting
2813 @code{pedal@var{X}Strings}, where @var{X} is one of the pedal types:
2814 Sustain, Sostenuto or UnaCorda.  Refer to the generated documentation
2815 of @internalsref{SustainPedal} for more information.
2816
2817 Pedals can also be indicated by a sequence of brackets, by setting the 
2818 @code{pedal-type} property of @internalsref{SustainPedal} objects: 
2819
2820 @lilypond[fragment,verbatim]
2821 \property Staff.SustainPedal \override #'pedal-type = #'bracket
2822  c''4-\sustainDown d''4 e''4
2823  a'4-\sustainUp-\sustainDown
2824  f'4 g'4 a'4-\sustainUp
2825 @end lilypond
2826
2827 A third style of pedal notation is a mixture of text and brackets,
2828 obtained by setting @code{pedal-type} to @code{mixed}:
2829
2830 @lilypond[fragment,verbatim]
2831 \property Staff.SustainPedal \override #'pedal-type = #'mixed
2832 c''4-\sustainDown d''4 e''4
2833 c'4-\sustainUp-\sustainDown
2834  f'4 g'4 a'4-\sustainUp
2835 @end lilypond
2836
2837 The default `*Ped' style for sustain and damper pedals corresponds to
2838 @code{\pedal-type = #'text}. However, @code{mixed} is the default style
2839 for a sostenuto pedal:
2840
2841 @lilypond[fragment,verbatim]
2842 c''4-\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4-\sostenutoUp
2843 @end lilypond
2844
2845 For fine-tuning of the appearance of a pedal bracket, the properties
2846 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
2847 @code{PianoPedalBracket} objects (see the detailed documentation of
2848 @internalsref{PianoPedalBracket}) can be modified.  For example, the bracket
2849 may be extended to the end of the note head.
2850
2851 @lilypond[fragment,verbatim]
2852 \property Staff.PianoPedalBracket \override
2853    #'shorten-pair = #'(0 . -1.0)
2854 c''4-\sostenutoDown d''4 e''4 c'4
2855 f'4 g'4 a'4-\sostenutoUp
2856 @end lilypond
2857
2858 @node Arpeggio
2859 @subsection Arpeggio
2860 @cindex Arpeggio
2861
2862 @cindex broken arpeggio
2863 @cindex @code{\arpeggio}
2864
2865 You can specify an arpeggio sign on a chord by attaching an
2866 @code{\arpeggio} to a chord.
2867
2868
2869 @lilypond[fragment,relative,verbatim]
2870   <<c e g c>>-\arpeggio
2871 @end lilypond
2872
2873 When an arpeggio crosses staves in piano music, you attach an arpeggio
2874 to the chords in both staves, and set
2875 @internalsref{PianoStaff}.@code{connectArpeggios}.
2876
2877 @lilypond[fragment,relative,verbatim]
2878   \context PianoStaff <
2879     \property PianoStaff.connectArpeggios = ##t
2880     \context Voice = one  { <<c' e g c>>-\arpeggio }
2881     \context Voice = other { \clef bass  <<c,, e g>>-\arpeggio }
2882   >
2883 @end lilypond
2884
2885 This command creates @internalsref{Arpeggio} objects.  Cross staff
2886 arpeggios are @internalsref{PianoStaff}.@internalsref{Arpeggio}.
2887
2888 The direction of the arpeggio is sometimes denoted by adding an
2889 arrowhead to the wiggly line.  This can be typeset by setting
2890 @code{arpeggio-direction}.
2891
2892 @lilypond[fragment,relative,verbatim]
2893   \context Voice {
2894      \property Voice.Arpeggio \set #'arpeggio-direction = #1
2895      <<c e g c>>-\arpeggio
2896      \property Voice.Arpeggio \set #'arpeggio-direction = #-1
2897      <<c e g c>>-\arpeggio
2898   }
2899 @end lilypond
2900
2901 A square bracket on the left indicates that the player should not
2902 arpeggiate the chord. To draw these brackets, set the
2903 @code{molecule-callback} property of @code{Arpeggio} or
2904 @code{PianoStaff.Arpeggio} objects to @code{\arpeggioBracket}, and use
2905 @code{\arpeggio} statements within the chords as before.
2906
2907 @lilypond[fragment,relative,verbatim]
2908     \property PianoStaff.Arpeggio \override
2909         #'molecule-callback = \arpeggioBracket
2910        <<c' e g c>>-\arpeggio
2911 @end lilypond
2912
2913
2914 @refbugs
2915
2916 It is not possible to mix connected arpeggios and unconnected
2917 arpeggios in one @internalsref{PianoStaff} at the same time.
2918
2919 @node  Staff switch lines
2920 @subsection Staff switch lines
2921
2922
2923 @cindex follow voice
2924 @cindex staff switching
2925 @cindex cross staff
2926
2927 @cindex @code{followVoice}
2928
2929 Whenever a voice switches to another staff a line connecting the notes
2930 can be printed automatically. This is enabled if the property
2931 @code{PianoStaff.followVoice} is set to true:
2932
2933 @lilypond[fragment,relative,verbatim]
2934   \context PianoStaff <
2935     \property PianoStaff.followVoice = ##t
2936     \context Staff \context Voice {
2937       c1
2938       \translator Staff=two
2939       b2 a
2940     }
2941     \context Staff=two { \clef bass \skip 1*2 }
2942   >  
2943 @end lilypond
2944
2945 The associated object is @internalsref{VoiceFollower}.
2946
2947
2948 @node Vocal music
2949 @section Vocal music
2950
2951 For a discussion of how to put lyrics into a score, see section
2952 @code{Printing lyrics} in the tutorial.
2953
2954 @cindex context variables
2955 @cindex setting context variables
2956 An interpretation context has variables that tune its behavior.  These
2957 variables are also called @emph{properties}.  The @code{autoBeaming}
2958 variable in a @code{Staff} controls whether 8th and shorter notes are
2959 beamed automatically. Setting the variable to @code{##f}, which is the
2960 boolean value @var{false}, turns it off.
2961
2962
2963 This will create an extender, which is a line
2964 that extends over the entire duration of the lyric.  This line will
2965 run all the way to the start of the next lyric, so you may want to
2966 shorten it by using a blank lyric (using @code{_}).
2967
2968 @cindex lyric mode
2969 @cindex @code{\lyrics}
2970
2971  To get them printed, you must do two
2972 things: indicate that lyrics   are entered with @code{\lyrics}, and
2973 indicate that this type of music must be interpreted as texts (and not
2974 notes). This is done with @code{\context Lyrics}. 
2975
2976 You can enter lyrics in a special input mode of LilyPond. This mode is
2977 called Lyrics mode, and it is introduced by the keyword
2978 @code{\lyrics}.  In this mode you can enter lyrics, with punctuation
2979 and accents without any hassle.  Syllables are entered like notes, but
2980 with pitches replaced by text.  For example,
2981 @example
2982   Twin- kle twin- kle
2983 @end example
2984
2985
2986
2987
2988 You can use ordinary hyphens at the end of a syllable, i.e.
2989 @example
2990         soft- ware
2991 @end example
2992 but then the hyphen will be attached to the end of the first syllable.
2993  
2994 If you want them centered between syllables you can use the special
2995 `@code{-}@code{-}' lyric as a separate word between syllables.  The
2996 hyphen will have variable length depending on the space between
2997 the syllables and it will be centered between the syllables.
2998
2999
3000
3001
3002 Normally the notes that you enter are transformed into note heads.
3003 Note heads alone make no sense. They need surrounding information: a
3004 key signature, a clef, staff lines, etc.  They need @emph{context}.
3005 In LilyPond, these symbols are created by objects called
3006 `interpretation contexts'.  Interpretation contexts exist for
3007 generating notation (`notation context') and for generating sound
3008 (`performance context').  These objects only exist while LilyPond is
3009 executing.  For lyrics, the command
3010 @example
3011   \context Lyrics
3012 @end example
3013 must be used to interpret a set of syllables as lyrics.
3014
3015
3016
3017 @cindex context
3018 @cindex interpretation context
3019 @cindex notation context
3020
3021
3022
3023 The melody and the lyrics can be combined with the @code{\addlyrics}:
3024 @example
3025 \addlyrics
3026   \notes \relative c' @dots{}
3027   \context Lyrics \lyrics @dots{} 
3028 @end example
3029
3030 [TODO: Move lyrics section from tutorial to here?]
3031
3032 See also the sections on @ref{Slurs} and @ref{Breath marks}.
3033
3034 [TODO: Move slurs / breath marks section to here?]
3035
3036 [TODO: Write subsection upon usage of ChoirStaff.]
3037
3038 @menu
3039 * More stanzas::                
3040 * Ambitus::                     
3041 @end menu
3042
3043
3044 @node More stanzas
3045 @subsection More stanzas
3046
3047
3048 @cindex phrasing
3049
3050 If you have multiple stanzas printed underneath each other, the vertical
3051 groups of syllables should be aligned around punctuation.  LilyPond can
3052 do this if you tell it which lyric lines belong to which melody.
3053 We show how you can do this by showing how you could print a frivolous
3054 fragment of a fictional Sesame Street duet. 
3055
3056 @lilypond[singleline,verbatim]
3057 \score {
3058 \addlyrics
3059   \notes \relative c'' \context Voice = duet { \time 3/4
3060      g2 e4 a2 f4 g2.  }
3061   \lyrics \context Lyrics <
3062   \context LyricsVoice = "duet-1" {
3063     \property LyricsVoice . stanza = "Bert"
3064     Hi, my name is bert.    }
3065   \context LyricsVoice = "duet-2" {
3066     \property LyricsVoice . stanza = "Ernie" 
3067     Ooooo, ch\'e -- ri, je t'aime. }
3068   >
3069 }
3070 @end lilypond
3071
3072 To this end, give the Voice context an identity, and set the
3073 LyricsVoice to a name starting with that identity followed by a dash.
3074 In the following example, the Voice identity is @code{duet},
3075 @example
3076 \context Voice = duet @{
3077      \time 3/4
3078      g2 e4 a2 f4 g2.  @}
3079 @end example
3080 and the
3081 identities of the LyricsVoices are @code{duet-1} and @code{duet-2}.
3082 @example
3083   \context LyricsVoice = "duet-1" @{
3084     Hi, my name is bert. @}
3085   \context LyricsVoice = "duet-2" @{
3086     Ooooo, ch\'e -- ri, je t'aime. @}
3087 @end example
3088 The convention for naming @code{LyricsVoice} and @code{Voice} must
3089 also be used to get melismata on rests correct.
3090
3091
3092 We add the names of the singers.  This can be done by setting
3093 @code{LyricsVoice.Stanza} (for the first system) and
3094 @code{LyricsVoice.stz} for the following systems.   You must
3095 surround dots with spaces in @code{\lyrics} mode.
3096
3097 @example
3098     \property LyricsVoice . stanza = "Bert"
3099     @dots{}
3100     \property LyricsVoice . stanza = "Ernie" 
3101 @end example
3102
3103
3104
3105
3106 For entering quotes in Lyrics mode, use the following
3107 @example
3108 "\"God\"" is "`King'"
3109 @end example
3110
3111 You can use empty syllables, e.g. @code{_4} or @code{" "4} to enter
3112 lyrics. This can confuse the LilyPond -- for example, this might put
3113 (empty) lyrics under rests. To remedy this, use @code{\skip}.
3114
3115
3116
3117 @refbugs
3118
3119 @cindex ambiguity
3120
3121 Input for lyrics introduces a syntactical ambiguity:
3122  
3123 @example 
3124 foo = bar 
3125 @end example 
3126
3127 @noindent
3128 is interpreted as assigning a string identifier @code{\foo} such that
3129 it contains @code{"bar"}.  However, it could also be interpreted as
3130 making or a music identifier @code{\foo} containing the syllable
3131 `bar'.  The force the latter interpretation, use
3132 @example
3133   foo = \lyrics bar
3134 @end example
3135
3136
3137 @node Ambitus
3138 @subsection Ambitus
3139 @cindex ambitus
3140
3141 The term @emph{ambitus} denotes a range of pitches for a given voice in
3142 a part of music.  It also may denote the pitch range that a musical
3143 instrument is capable of playing.  Most musical instruments have their
3144 ambitus standardized (or at least there is agreement upon the minimal
3145 ambitus of a particular type of instrument), such that a composer or
3146 arranger of a piece of music can easily meet the ambitus constraints of
3147 the targeted instrument.  However, the ambitus of the human voice
3148 depends on individual physiological state, including education and
3149 training of the voice.  Therefore, a singer potentially has to check for
3150 each piece of music if the ambitus of that piece meets his individual
3151 capabilities.  This is why the ambitus of a piece may be of particular
3152 value to vocal performers.
3153
3154 The ambitus is typically notated on a per-voice basis at the very
3155 beginning of a piece, e.g. nearby the initial clef or time signature of
3156 each staff.  The range is graphically specified by two noteheads, that
3157 represent the minimum and maximum pitch.  Some publishers use a textual
3158 notation: they put the range in words in front of the corresponding
3159 staff.  Lilypond currently only supports the graphical ambitus notation.
3160
3161 To apply, add the @internalsref{Ambitus_engraver} to the
3162 @internalsref{Voice} context, i.e.
3163
3164 @example
3165   \paper @{ \translator @{
3166       \VoiceContext
3167       \consists Ambitus_engraver
3168     @} @}
3169 @end example
3170
3171 For example,
3172
3173 @lilypond[singleline]
3174 upper = \notes \relative c {
3175   \clef "treble"
3176   \key c \minor
3177   as'' c e2 bes f cis d4 e f2 g
3178 }
3179 lower = \notes \relative c {
3180   \clef "treble"
3181   \key e \major
3182   e'4 b g a c es fis a cis b a g f e d2
3183 }
3184 \score {
3185   \context ChoirStaff {
3186     <
3187       \context Staff = one { \upper }
3188       \context Staff = three { \lower }
3189     >
3190   }
3191   \paper {
3192     \translator {
3193       \VoiceContext
3194       \consists Ambitus_engraver
3195     }
3196   }
3197 }
3198 @end lilypond
3199
3200
3201 @seealso
3202
3203 @internalsref{Ambitus}, @inputfileref{input/regression,ambitus.ly}.
3204
3205 @node Tablatures
3206 @section Tablatures
3207
3208 Tablature notation is used for notating music for plucked string
3209 instruments.  It notates pitches not by using note heads, but by
3210 indicating on which string and fret a note must be played.  LilyPond
3211 offers limited support for tablature.
3212
3213 @menu
3214 * Tablatures basic::            
3215 * Non-guitar tablatures::       
3216 @end menu
3217
3218 @node Tablatures basic
3219 @subsection Tablatures basic
3220 @cindex Tablatures basic
3221
3222 The string number associated to a note is given as a backslash
3223 followed by a number, e.g. @code{c4\3} for a C quarter on the third
3224 string. By default, string 1 is the highest one, and the tuning
3225 defaults to the standard guitar tuning (with 6 strings).  The notes
3226 are printed as tablature, by using @internalsref{TabStaff} and
3227 @internalsref{TabVoice} contexts.
3228
3229 @lilypond[fragment,verbatim]
3230 \notes \context TabStaff  {
3231  a,4\5 c'\2 a\3 e'\1
3232  e\4 c'\2 a\3 e'\1
3233 }
3234 @end lilypond
3235
3236 If you do not specify a string number then one is selected
3237 automatically: the first string that does not give a fret number less
3238 than @code{minimumFret} is selected. The default value for
3239 @code{minimumFret} is 0.
3240
3241
3242 @example
3243 e8 fis gis a b cis' dis' e'
3244 \property TabStaff.minimumFret = #8
3245 e8 fis gis a b cis' dis' e'
3246 @end example
3247 @lilypond[noindent]
3248 frag = \notes {
3249     \key e \major
3250     e8 fis gis a b cis' dis' e'
3251     \property TabStaff.minimumFret = #8
3252     e8 fis gis a b cis' dis' e'
3253 }
3254 \score {
3255   \context StaffGroup <
3256     \context Staff { \clef "G_8" \frag }
3257     \context TabStaff { \frag }
3258   >
3259 }
3260 @end lilypond
3261
3262 @seealso
3263
3264 @internalsref{TabStaff}, @internalsref{TabVoice}, and
3265 @internalsref{StringNumberEvent}.
3266
3267 @refbugs
3268
3269 Chords are not handled in a special way, and hence the automatic
3270 string selector may easily select the same string to two notes in a
3271 chord.
3272
3273
3274 @node Non-guitar tablatures
3275 @subsection Non-guitar tablatures
3276 @cindex Non-guitar tablatures
3277
3278 You can change the number of strings, by setting the number of lines
3279 in the @internalsref{TabStaff} (the @code{line-count} property of
3280 @internalsref{TabStaff} can only be changed using
3281 @code{\outputproperty}, for more information, see @ref{Tuning objects}.
3282
3283 You can change the tuning of the strings. A string tuning is given as
3284 a Scheme list with one integer number for each string, the number
3285 being the pitch (measured in semitones relative to central C) of an
3286 open string.  The numbers specified for @code{stringTuning} are the
3287 numbers of semitones to subtract or add, starting the specified pitch
3288 by default middle C, in string order: thus the notes are e, a, d, and
3289 g.
3290
3291 @lilypond[fragment,verbatim]
3292   \context TabStaff <
3293
3294     \outputproperty #(make-type-checker 'staff-symbol-interface)
3295                     #'line-count = #4
3296     \property TabStaff.stringTunings =  #'(-5 -10 -15 -20)
3297     
3298     \notes {
3299       a,4 c' a e' e c' a e'
3300     }
3301   > 
3302 @end lilypond
3303
3304 It is possible to change the Scheme function to format the tablature
3305 note text. The default is @code{fret-number-tablature-format}, which
3306 uses the fret number. For instruments that do not use this notation,
3307 you can create a special tablature formatting function. This function
3308 takes three argument: the string number, the string tuning and the
3309 note pitch.
3310
3311 @refbugs
3312
3313 As tablature is a recent feature, most of the guitar special effects
3314 such as bend are not yet supported.
3315
3316
3317 @node Chord names
3318 @section Chord names
3319 @cindex Chords
3320
3321 LilyPond has support for both entering and printing named chords.
3322 These chords are internally represented as a set of pitches. Therefore
3323 they can be entered by name and printed as notes, entered as notes and
3324 printed as chord names, or (the most common case) entered them by
3325 name, and print them as name. The following fragment shows these
3326 options:
3327
3328 @lilypond[verbatim,singleline]
3329 twoWays = \notes \transpose c c' {
3330   \chords {
3331     c1 f:sus4 bes/f
3332   }
3333   <<c e g>>
3334   <<f bes c'>>
3335   <<f bes d'>>
3336   }
3337
3338 \score {
3339    < \context ChordNames \twoWays
3340      \context Voice \twoWays > }
3341 @end lilypond
3342
3343 This example also shows that the chord printing routines do not try to
3344 be intelligent. The chord @code{f bes d}, is not interpreted as an
3345 inversion.
3346
3347
3348 @menu
3349 * Chords mode::                 
3350 * Printing chord names::        
3351 @end menu
3352
3353
3354 @node Chords mode
3355 @subsection Chords mode
3356 @cindex Chords mode
3357
3358 Chord mode is a mode where you can input sets of pitches using common
3359 names.  It is introduced by the keyword @code{\chords}.
3360 In chords mode,  a  chord is entered by the root, which is entered
3361 like a common pitch, for example,
3362 @lilypond[fragment,verbatim,quote, relative=1]
3363 \chords { es4.  d8 c2 }
3364 @end lilypond
3365 @cindex chord entry
3366 @cindex chord mode
3367
3368 Other chords may be entered by suffixing a colon, and introducing a
3369 modifier, and optionally, a number, for example
3370 @c
3371 @lilypond[fragment,verbatim,quote]
3372 \chords { e1:m e1:7 e1:m7  }
3373 @end lilypond
3374 The first number following the root is taken to be the `type' of the
3375 chord, thirds are added to the root until it reaches the specified
3376 number, for example.
3377 @lilypond[fragment,verbatim]
3378  \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
3379 @end lilypond
3380
3381 @cindex root of chord
3382 @cindex additions, in chords
3383 @cindex removals, in  chords
3384
3385 More complex chords may also be constructed  adding separate steps
3386 to a chord. Additions are added after the  number following
3387 the colon, and are separated by dots. For example
3388 @c
3389 @lilypond[verbatim,fragment,quote]
3390   \chords { c:5.6 c:3.7.8 c:3.6.13 }
3391 @end lilypond
3392 Chord steps can be  altered by suffixing a @code{-} or @code{+} sign
3393 to the number, for example:
3394 @lilypond[verbatim,fragment,quote]
3395   \chords { c:7+ c:5+.3-  c:3-.5-.7- }
3396 @end lilypond
3397 Removals are specified similarly, and are introduced by a caret.  They
3398 must come after the additions.
3399 @lilypond[verbatim,fragment]
3400   \chords { c^3 c:7^5 c:9^3.5 }
3401 @end lilypond
3402
3403 Modifiers can be used to change pitches. The following modifiers are
3404 supported
3405 @table @code
3406 @item m
3407   is the minor chord. This modifier lowers the 3rd and (if present) the 7th step.
3408 @item dim
3409   is the   diminished chord. This modifier lowers the 3rd, 5th and (if present)
3410   the 7th step 
3411 @item aug
3412   is the augmented chord. This modifier raises the 5th step.
3413 @item maj
3414   is the major 7th chord. This modifier raises the 7th step if present.  
3415 @item sus
3416   is the suspended 4th or 2nd. This modifier removes the 3rd
3417 step. Append either @code{2} or @code{4} to add the 2nd or 4th step to
3418 the chord.
3419 @end table
3420 Modifiers can be mixed with additions. 
3421 @lilypond[verbatim,fragment]
3422   \chords { c:sus4 c:7sus4 c:dim7 c:m6 } 
3423 @end lilypond
3424
3425 @cindex modifiers, in chords. 
3426 @cindex @code{aug}
3427 @cindex @code{dim}
3428 @cindex @code{maj}
3429 @cindex @code{sus}
3430 @cindex @code{m}
3431
3432 Since the unaltered 11 does sound well when combined with the
3433 unaltered 3, the 11 is removed in this case, unless it is added
3434 explicitly). For example,
3435 @lilypond[fragment,verbatim]
3436   \chords { c:13 c:13.11 c:m13 }
3437 @end lilypond 
3438
3439 @cindex @code{/}
3440
3441 An inversion (putting one pitch of the chord on the bottom), as well
3442 as bass notes, can be specified by appending
3443 @code{/}@var{pitch} to the chord. 
3444 @lilypond[fragment,verbatim,center]
3445    \chords { c1 c/g c/f }
3446 @end lilypond 
3447 @cindex @code{/+}
3448 If you do not want to remove the bass note from the chord, but rather
3449 add the note, then you can use @code{/+}@var{pitch}.
3450
3451 @lilypond[fragment,verbatim,center]
3452    \chords { c1 c/+g c/+f }
3453 @end lilypond 
3454
3455 Chords is a mode similar to @code{\lyrics}, @code{\notes} etc.  Most
3456 of the commands continue to work, for example, @code{r} and
3457 @code{\skip} can be used to insert rests and spaces, and
3458 @code{\property} may be used to change various settings.
3459
3460
3461
3462 @refbugs
3463
3464 Each step can only be present in a chord once.  The following
3465 simply produces the augmented chord, since @code{5+} is interpreted
3466 last.
3467 @cindex clusters
3468 @lilypond[verbatim,fragment]
3469   \chords { c:5.5-.5+ }
3470 @end lilypond
3471
3472 In chord mode, dashes and carets are used to indicate chord additions
3473 and subtractions, so articulation scripts cannot be entered.
3474
3475
3476 @node Printing chord names
3477 @subsection Printing chord names
3478
3479 @cindex printing chord names
3480 @cindex chord names
3481 @cindex chords
3482
3483 For displaying printed chord names, use the @internalsref{ChordNames}
3484 context.  The chords may be entered either using the notation
3485 described above, or directly using @code{<<} and @code{>>}.
3486
3487 @lilypond[verbatim,singleline]
3488 scheme = \notes {
3489   \chords {a1 b c} <<d' f' g'>>  <<e' g' b'>>
3490 }
3491 \score {
3492   \notes<
3493     \context ChordNames \scheme
3494     \context Staff \scheme
3495   >
3496 }
3497 @end lilypond
3498
3499 You can make the chord changes stand out by setting
3500 @internalsref{ChordNames}.@code{chordChanges} to true.  This will only
3501 display chord names when there is a change in the chords scheme and at
3502 the start of a new line.
3503
3504 @lilypond[verbatim]
3505 scheme = \chords {
3506   c1:m c:m \break c:m c:m d
3507 }
3508 \score {
3509   \notes <
3510     \context ChordNames {
3511         \property ChordNames.chordChanges = ##t
3512         \scheme }
3513     \context Staff \transpose c c' \scheme
3514   >
3515 \paper{linewidth= 9.\cm}
3516 }
3517 @end lilypond
3518
3519 The default chord name layout is a system for Jazz music, proposed by
3520 Klaus Ignatzek (See @ref{Literature}).
3521
3522 The Ignatzek chord name formatting can be tuned in a number of ways
3523 through the following properties:
3524 @table @code
3525
3526 @cindex chordNameExceptions
3527 @item chordNameExceptions
3528 This is a list that contains the chords that have special formatting.
3529 For an example, see
3530 @inputfileref{input/regression,chord-name-exceptions.ly}.
3531 @cindex exceptions, chord names.
3532
3533
3534 @cindex majorSevenSymbol
3535 @item majorSevenSymbol
3536 This property contains the markup object used for the 7th step, when
3537 it is major. Predefined options are @code{whiteTriangleMarkup} and
3538 @code{blackTriangleMarkup}.  See
3539 @inputfileref{input/regression,chord-name-major7.ly} for an example.
3540
3541 @cindex chordNameSeparator
3542 @item chordNameSeparator
3543 Different parts of a chord name are normally separated by a
3544 slash. By setting @code{chordNameSeparator}, you can specify other
3545 separators, e.g.
3546 @lilypond[fragment,verbatim]
3547 \context ChordNames \chords {
3548       c:7sus4
3549       \property ChordNames.chordNameSeparator
3550         = \markup { "|" }
3551       c:7sus4 }
3552 @end lilypond
3553
3554 @cindex chordRootNamer
3555 @item chordRootNamer
3556 The root of a chord is usually printed as a letter with an optional
3557 alteration. The transformation from pitch to letter is done by this
3558 function.  Special note names (for example, the German ``H'' for a
3559 B-chord) can be produced by storing a new function in this property.
3560
3561 @cindex chordNoteNamer
3562 @item chordNoteNamer
3563 The default is to print single notes (as for instance the bass note)
3564 using the @code{chordRootNamer}. However, by setting this function to a non-null
3565 value you can specify a different function. I.e. you could use letters
3566 in lower case for the base note.
3567
3568 @end table
3569
3570 @seealso
3571
3572 @inputfileref{input/regression,chord-name-major7.ly},
3573 @inputfileref{input/regression,chord-name-exceptions.ly},
3574 @inputfileref{input/test,chord-names-german.ly},
3575 @file{scm/chords-ignatzek.scm}, @file{scm/chord-entry.scm}
3576
3577
3578 @refbugs
3579
3580 Chord names are determined solely from the list of pitches. Chord
3581 inversions are not identified, and neither are added bass notes. This
3582 may result in strange chord names when chords are entered with the
3583 @code{<< .. >>} syntax.
3584
3585
3586
3587
3588 @node Writing parts
3589 @section Writing parts
3590
3591 Orchestral music involves some special notation, both in the full
3592 score and the individual parts. This section explains how to tackle
3593 some common problems in orchestral music.
3594
3595
3596
3597 @menu
3598 * Rehearsal marks::             
3599 * Bar numbers::                 
3600 * Instrument names::            
3601 * Transpose::                   
3602 * Multi measure rests::         
3603 * Automatic part combining::    
3604 * Frenched scores::             
3605 * Sound output for transposing instruments::  
3606 @end menu
3607
3608
3609 @node Rehearsal marks
3610 @subsection Rehearsal marks
3611 @cindex Rehearsal marks
3612 @cindex mark
3613 @cindex @code{\mark}
3614
3615 To print a  rehearsal mark, use the @code{\mark} command. 
3616 @lilypond[fragment,verbatim]
3617 \relative c'' {
3618   c1 \mark "A"
3619   c1 \mark "B"
3620   c1 \mark "12"
3621   c1 \mark "13"
3622   c1
3623 }
3624 @end lilypond
3625
3626 The mark is incremented automatically if you use @code{\mark
3627 \default}. The value to use is stored in the property
3628 @code{rehearsalMark} is used and automatically incremented.
3629
3630 The @code{\mark} command can also be used to put signs like coda,
3631 segno and fermatas on a barline. Use @code{\markup} to
3632 to access the appropriate symbol.
3633
3634 @lilypond[fragment,verbatim,relative=1]
3635   c1 \mark \markup { \musicglyph #"scripts-ufermata" }
3636   c1
3637 @end lilypond
3638
3639 In this case, during line breaks,
3640 marks must also be printed at the end of the line, and not at the
3641 beginning. Use the following to force that behavior
3642 @example
3643 \property Score.RehearsalMark \override
3644   #'break-visibility = #begin-of-line-invisible
3645 @end example
3646
3647 See @inputfileref{input/test,boxed-molecule.ly}.  for putting boxes
3648 around the marks.
3649
3650 @cindex fermatas
3651 @cindex coda
3652 @cindex segno
3653 @cindex barlines, putting symbols on 
3654
3655 @seealso
3656
3657 @internalsref{MarkEvent}, @internalsref{RehearsalMark}, 
3658 @inputfileref{input/test,boxed-molecule.ly}.
3659
3660
3661 @node Bar numbers
3662 @subsection Bar numbers
3663
3664
3665 @cindex bar numbers
3666 @cindex measure numbers
3667 @cindex currentBarNumber
3668
3669 Bar numbers are printed by default at the start of the line.  The
3670 number itself is stored in the 
3671 @code{currentBarNumber} property,
3672 which is normally updated automatically for every measure.
3673
3674 Bar numbers can be typeset at regular intervals instead of at the
3675 beginning of each line. This is illustrated in the following example,
3676 whose source is available as
3677 @inputfileref{input/test,bar-number-every-fifth.ly}
3678
3679 @lilypondfile[notexidoc]{bar-number-every-fifth.ly}
3680
3681 The start of that numbering can also be reset, as demonstrated in
3682 @inputfileref{input/test,bar-number-every-5-reset.ly}.
3683
3684 @lilypondfile[notexidoc]{bar-number-every-5-reset.ly}
3685
3686
3687 @seealso
3688
3689 @internalsref{BarNumber}.
3690 @inputfileref{input/test,bar-number-every-5-reset.ly}.
3691 @inputfileref{input/test,bar-number-every-fifth.ly}
3692
3693 @refbugs
3694
3695 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
3696 there is one at the top. To solve this, You have to twiddle with the
3697 @internalsref{padding} property of @internalsref{BarNumber} if your
3698 score starts with a @internalsref{StaffGroup}.
3699
3700 @node Instrument names
3701 @subsection Instrument names
3702
3703 In an orchestral score, instrument names are printed left of the
3704 staffs.
3705
3706 This can be achieved by setting @internalsref{Staff}.@code{instrument}
3707 and @internalsref{Staff}.@code{instr}. This will print a string before
3708 the start of the staff. For the first start, @code{instrument} is
3709 used, for the next ones @code{instr} is used.
3710
3711 @lilypond[verbatim,singleline]
3712   \property Staff.instrument = "ploink " { c''4 }  
3713 @end lilypond
3714
3715 You can also use markup texts to construct more complicated instrument
3716 names.
3717
3718 @lilypond[fragment,verbatim,singleline]
3719   \notes \context Staff = treble {
3720     \property Staff.instrument = \markup {
3721         \column << "Clarinetti"
3722           { "in B"
3723             \smaller \musicglyph #"accidentals--1"
3724           }
3725           >>
3726      }
3727      { c''1 }
3728   }
3729 @end lilypond
3730
3731
3732 @seealso
3733
3734 @internalsref{InstrumentName}
3735
3736 @refbugs
3737
3738 When you put a name on a grand staff or piano staff the width of the
3739 brace is not taken into account. You must add extra spaces to the end of
3740 the name to avoid a collision.
3741
3742 @node Transpose
3743 @subsection Transpose
3744 @cindex Transpose
3745 @cindex transposition of pitches
3746 @cindex @code{\transpose}
3747
3748 A music expression can be transposed with @code{\transpose}.  The syntax
3749 is
3750 @example
3751   \transpose @var{from} @var{to} @var{musicexpr}
3752 @end example
3753
3754 This means that @var{musicexpr} is transposed by the interval
3755 between @var{from} and @var{to}.
3756
3757 @code{\transpose} distinguishes between enharmonic pitches: both
3758 @code{\transpose c cis} or @code{\transpose c des} will transpose up
3759 half a tone.  The first version will print sharps and the second
3760 version will print flats.
3761
3762 @lilypond[singleline, verbatim]
3763 mus =\notes { \key d \major cis d fis g }
3764 \score { \notes \context Staff {
3765   \clef "F" \mus
3766   \clef "G"
3767   \transpose c g' \mus
3768   \transpose c f' \mus
3769 }}
3770 @end lilypond
3771
3772 @seealso
3773
3774 @internalsref{TransposedMusic}, @internalsref{UntransposableMusic}. 
3775
3776 @refbugs
3777
3778 If you want to use both @code{\transpose} and @code{\relative}, then
3779 you must put @code{\transpose} outside of @code{\relative}, since
3780 @code{\relative} will have no effect music that appears inside a
3781 @code{\transpose}.
3782
3783
3784
3785
3786 @node  Multi measure rests
3787 @subsection Multi measure rests
3788 @cindex Multi measure rests
3789
3790 @cindex @code{R}
3791
3792 Multi measure rests are entered using `@code{R}'. It is specifically
3793 meant for full bar rests and for entering parts: the rest can expand to
3794 fill a score with rests, or it can be printed as a single multimeasure
3795 rest. This expansion is controlled by the property
3796 @code{Score.skipBars}. If this is set to true, Lily will not expand
3797 empty measures, and the appropriate number is added automatically.
3798
3799 @lilypond[fragment,verbatim]
3800  \time 4/4 r1 | R1 | R1*2
3801  \property Score.skipBars = ##t R1*17  R1*4
3802 @end lilypond
3803
3804 The @code{1} in @code{R1} is similar to the duration notation used for
3805 notes. Hence, for time signatures other than 4/4, you must enter other
3806 durations.  This can be done with augmentation dots or fractions:
3807
3808 @lilypond[fragment,verbatim]
3809  \property Score.skipBars = ##t
3810  \time 3/4
3811   R2. | R2.*2
3812  \time 13/8
3813  R1*13/8
3814  R1*13/8*12
3815 @end lilypond
3816
3817 A @code{R} spanning a single measure is printed as a whole rest
3818 centered in the measure (or a breve when the measure lasts longer than
3819 two whole notes), regardless of the time signature.
3820
3821  
3822
3823 @cindex text on multi-measure rest
3824 @cindex script on multi-measure rest
3825 @cindex fermata on multi-measure rest
3826
3827 Texts can be added to multi-measure rests by using the
3828 @var{note}-@code{markup} syntax.  In this case, the number is
3829 replaced. If you need both texts and the number, you must add the
3830 number by hand. A variable (@code{\fermataMarkup}) is provided for
3831 adding fermatas.
3832
3833
3834 @lilypond[verbatim,fragment]
3835   \time 3/4
3836   R2._\markup { "Ad lib" }
3837   R2.^\fermataMarkup
3838 @end lilypond
3839
3840
3841 @cindex whole rests for a full measure 
3842
3843 @seealso
3844
3845 @internalsref{MultiMeasureRestEvent},
3846 @internalsref{MultiMeasureTextEvent},
3847 @internalsref{MultiMeasureRestMusicGroup},
3848 @internalsref{MultiMeasureRest}.
3849
3850 The graphical object @internalsref{MultiMeasureRestNumber} is for the
3851 default number, and @internalsref{MultiMeasureRestText} for user
3852 specified texts.
3853
3854 @refbugs
3855
3856 It is not possible to use fingerings (e.g. @code{R1-4}) to put numbers
3857 over multi-measure rests.
3858
3859 @cindex condensing rests
3860
3861 There is no way to automatically condense multiple rests into a single
3862 multimeasure rest. Multi measure rests do not take part in rest
3863 collisions.
3864
3865 Be careful when entering multimeasure rests followed by whole notes,
3866 @example
3867  R1*4 cis cis 
3868 @end example
3869 will enter two notes lasting four measures each. When @code{skipBars}
3870 is set, then the result will look OK6, but the bar numbering will be
3871 off.
3872
3873 @node Automatic part combining
3874 @subsection Automatic part combining
3875 @cindex automatic part combining
3876 @cindex part combiner
3877
3878
3879 Automatic part combining is used to merge two parts of music onto a
3880 staff.  It is aimed at typesetting orchestral scores.  When the two
3881 parts are identical for a period of time, only one is shown.  In
3882 places where the two parts differ, they are typeset as separate
3883 voices, and stem directions are set automatically.  Also, solo and
3884 @emph{a due} parts are identified and can be marked.
3885
3886 @syntax
3887
3888 The syntax for part combining is
3889
3890 @example
3891   \partcombine @var{context} @var{musicexpr1} @var{musicexpr2}
3892 @end example
3893 where the pieces of music @var{musicexpr1} and @var{musicexpr2} will be
3894 combined into one context of type @var{context}.  The music expressions
3895 must be interpreted by contexts whose names should start with @code{one}
3896 and @code{two}.
3897
3898 The following example demonstrates the basic functionality of the part
3899 combiner: putting parts on one staff, and setting stem directions and
3900 polyphony.
3901
3902 @lilypond[verbatim,singleline,fragment]
3903   \context Staff <
3904     \context Voice=one \partcombine Voice
3905       \context Thread=one \relative c'' {
3906         g a-( b-) r
3907       }
3908       \context Thread=two \relative c'' {
3909         g r4 r f
3910       }
3911   >
3912 @end lilypond
3913
3914 The first @code{g} appears only once, although it was
3915 specified twice (once in each part).  Stem, slur and tie directions are
3916 set automatically, depending whether there is a solo or unisono. The
3917 first part (with context called @code{one}) always gets up stems, and
3918 `solo', while the second (called @code{two}) always gets down stems and
3919 `Solo II'.
3920
3921 If you just want the merging parts, and not the textual markings, you
3922 may set the property @var{soloADue} to false.
3923
3924 @lilypond[verbatim,singleline,fragment]
3925   \context Staff <
3926     \property Staff.soloADue = ##f
3927     \context Voice=one \partcombine Voice
3928       \context Thread=one \relative c'' {
3929         b4 a c g
3930       }
3931       \context Thread=two \relative c'' {
3932         d,2 a4 g'
3933       }
3934   >
3935 @end lilypond
3936
3937 @seealso
3938
3939 @internalsref{PartCombineMusic},
3940 @internalsref{Thread_devnull_engraver},
3941 @internalsref{Voice_devnull_engraver} and @internalsref{A2_engraver}.
3942
3943 @refbugs
3944
3945 The syntax for naming contexts in inconsistent with the syntax for
3946 combining stanzas.
3947
3948 In @code{soloADue} mode, when the two voices play the same notes on and
3949 off, the part combiner may typeset @code{a2} more than once in a
3950 measure.
3951
3952 @lilypond[fragment,singleline]
3953   \context Staff <
3954     \context Voice=one \partcombine Voice
3955       \context Thread=one \relative c'' {
3956         c b c b c a c a
3957       }
3958       \context Thread=two \relative c'' {
3959         b b b b f a f a
3960       }
3961   >
3962 @end lilypond
3963
3964 The part combiner is slated to be rewritten [TODO: explain why] .
3965
3966 @cindex @code{Thread_devnull_engraver}
3967 @cindex @code{Voice_engraver}
3968 @cindex @code{A2_engraver}
3969
3970 @node Frenched scores
3971 @subsection Frenched scores
3972
3973 In orchestral scores, staff lines that only have rests are usually removed.
3974 This saves some space. This style is called `French Score'. 
3975
3976 @syntax
3977
3978 This is supported through the @code{FrenchStaff}. This staff is
3979 removed when it turns out empty (or containing multimeasure rests)
3980 after the line-breaking process.
3981
3982
3983 For @internalsref{Lyrics}, @internalsref{LyricsVoice},
3984 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
3985 switched on by default. For normal staffs, it is available as a
3986 specialized @internalsref{Staff} context, with the name variable
3987 @code{\FrenchStaffContext}.  Observe how the second staff in this
3988 example disappears in the second line.
3989
3990 @lilypond[verbatim]
3991 \score  {
3992   \notes \relative c' <
3993     \context Staff = SA { e4 f g a \break c1 }
3994     \context Staff = SB { c4 d e f \break R1 }
3995   >
3996   \paper {
3997     linewidth = 6.\cm 
3998     \translator { \FrenchStaffContext }
3999   }
4000 }
4001 @end lilypond
4002
4003
4004 @node Sound output for transposing instruments
4005 @subsection Sound output for transposing instruments
4006
4007 When you want to make a MIDI file from a score containing transposed
4008 and untransposed instruments, you have to instruct LilyPond the pitch
4009 offset (in semitones) for the transposed instruments. This is done
4010 using the @code{transposing} property. It does not affect printed
4011 output.
4012
4013 @cindex @code{transposing}
4014
4015 @example
4016         \property Staff.instrument = #"Cl. in B-flat"
4017         \property Staff.transposing = #-2
4018 @end example
4019
4020
4021 @node Ancient notation 
4022 @section Ancient notation
4023
4024 @cindex Vaticana, Editio
4025 @cindex Medicaea, Editio
4026 @cindex hufnagel
4027 @cindex Petrucci
4028 @cindex mensural
4029
4030 [TODO: write introduction on ancient notation]
4031
4032 @menu
4033 * Ancient note heads::          
4034 * Ancient clefs ::              
4035 * Custodes::                    
4036 * Divisiones::                  
4037 * Ligatures::                   
4038 * Figured bass::                
4039 @end menu
4040
4041
4042 @node Ancient note heads
4043 @subsection Ancient note heads
4044
4045 To get a longa note head, you have to use mensural note heads. This
4046 is accomplished by setting the @code{style} property of the
4047 NoteHead object to @code{mensural}. There is also a note head style
4048 @code{baroque} which gives mensural note heads for @code{\longa} and
4049 @code{\breve} but standard note heads for shorter notes.
4050
4051 @lilypond[fragment,singleline,verbatim]
4052  \property Voice.NoteHead \set #'style = #'mensural
4053  a'\longa
4054 @end lilypond
4055
4056 @node Ancient clefs 
4057 @subsection Ancient clefs
4058
4059 LilyPond supports a variety of clefs, many of them ancient.
4060
4061 For modern clefs, see section @ref{Clef}.  For the percussion clef, see
4062 section @ref{Percussion staves}.  For the @code{TAB} clef, see section
4063 @ref{Tablatures}.
4064
4065 The following table shows all ancient clefs that are supported via the
4066 @code{\clef} command.  Some of the clefs use the same glyph, but
4067 differ only with respect to the line they are printed on.  In such
4068 cases, a trailing number in the name is used to enumerate these clefs.
4069 Still, you can manually force a clef glyph to be typeset on an
4070 arbitrary line, as described in section @ref{Clef}.  The note printed
4071 to the right side of each clef in the example column denotes the
4072 @code{c'} with respect to that clef.
4073
4074 @c --- This should go somewhere else: ---
4075 @c @item modern style G clef (glyph: @code{clefs-G})
4076 @c
4077 @c Supported clefs:
4078 @c @code{treble}, @code{violin}, @code{G}, @code{G2}, @code{french}
4079 @c
4080 @c @lilypond[26pt]{\property Staff.TimeSignature \set #'transparent = ##t \clef "G" c'}
4081 @c
4082 @c @item modern style F clef (glyph: @code{clefs-F})
4083 @c
4084 @c Supported clefs:
4085 @c @code{varbaritone}, @code{bass}, @code{F}, @code{subbass}
4086 @c
4087 @c @lilypond{\property Staff.TimeSignature \set #'transparent = ##t \clef "F" c'}
4088 @c
4089 @c @item modern style C clef (glyph: @code{clefs-C})
4090 @c
4091 @c Supported clefs:
4092 @c @code{soprano}, @code{mezzosoprano}, @code{alto}, @code{C},
4093 @c @code{tenor}, @code{baritone}
4094 @c
4095 @c @lilypond{\property Staff.TimeSignature \set #'transparent = ##t \clef "C" c'}
4096
4097 @multitable @columnfractions  .3 .3 .3 .1
4098
4099 @item
4100 @b{Glyph Name} @tab
4101 @b{Description} @tab
4102 @b{Supported Clefs} @tab
4103 @b{Example}
4104
4105 @item
4106 @code{clefs-neo_mensural_c} @tab
4107 modern style mensural C clef @tab
4108 @code{neo_mensural_c1}, @code{neo_mensural_c2},
4109 @code{neo_mensural_c3}, @code{neo_mensural_c4} @tab
4110 @lilypond[relative 0, notime]
4111 \property Staff.TimeSignature \set #'transparent = ##t
4112 \clef "neo_mensural_c2" c
4113 @end lilypond
4114
4115 @item
4116 @code{clefs-petrucci_c1}
4117 @code{clefs-petrucci_c2}
4118 @code{clefs-petrucci_c3}
4119 @code{clefs-petrucci_c4}
4120 @code{clefs-petrucci_c5}
4121
4122 @tab
4123 petrucci style mensural C clefs, for use  on different  stafflines
4124 (the examples shows the 2nd staffline C clef).
4125
4126 @tab
4127 @code{petrucci_c1}
4128 @code{petrucci_c2}
4129 @code{petrucci_c3}
4130 @code{petrucci_c4}
4131 @code{petrucci_c5}
4132
4133 @tab
4134 @lilypond[relative 0, notime]
4135 \property Staff.TimeSignature \set #'transparent = ##t
4136 \clef "petrucci_c2" c
4137 @end lilypond
4138
4139 @item
4140 @code{clefs-petrucci_f} @tab
4141 petrucci style mensural F clef @tab
4142 @code{petrucci_f} @tab
4143 @lilypond[relative 0, notime]
4144 \property Staff.TimeSignature \set #'transparent = ##t
4145 \clef "petrucci_f" c
4146 @end lilypond
4147
4148 @item
4149 @code{clefs-petrucci_g} @tab
4150 petrucci style mensural G clef @tab
4151 @code{petrucci_g} @tab
4152 @lilypond[relative 0, notime]
4153 \property Staff.TimeSignature \set #'transparent = ##t
4154 \clef "petrucci_g" c
4155 @end lilypond
4156
4157 @item
4158 @code{clefs-mensural_c'} @tab
4159 historic style mensural C clef @tab
4160 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
4161 @code{mensural_c4} @tab
4162 @lilypond[relative 0, notime]
4163 \property Staff.TimeSignature \set #'transparent = ##t
4164 \clef "mensural_c2" c
4165 @end lilypond
4166
4167 @item
4168 @code{clefs-mensural_f} @tab
4169 historic style mensural F clef @tab
4170 @code{mensural_f} @tab
4171 @lilypond[relative 0, notime]
4172 \property Staff.TimeSignature \set #'transparent = ##t
4173 \clef "mensural_f" c
4174 @end lilypond
4175
4176 @item
4177 @code{clefs-mensural_g} @tab
4178 historic style mensural G clef @tab
4179 @code{mensural_g} @tab
4180 @lilypond[relative 0, notime]
4181 \property Staff.TimeSignature \set #'transparent = ##t
4182 \clef "mensural_g" c
4183 @end lilypond
4184
4185 @item
4186 @code{clefs-vaticana_do} @tab
4187 Editio Vaticana style do clef @tab
4188 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
4189 @lilypond[relative 0, notime]
4190 \context Staff
4191 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4192 \property Staff.TimeSignature \set #'transparent = ##t
4193 \clef "vaticana_do2" c
4194 @end lilypond
4195
4196 @item
4197 @code{clefs-vaticana_fa} @tab
4198 Editio Vaticana style fa clef @tab
4199 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
4200 @lilypond[relative 0, notime]
4201 \context Staff
4202 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4203 \property Staff.TimeSignature \set #'transparent = ##t
4204 \clef "vaticana_fa2" c
4205 @end lilypond
4206
4207 @item
4208 @code{clefs-medicaea_do} @tab
4209 Editio Medicaea style do clef @tab
4210 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
4211 @lilypond[relative 0, notime]
4212 \context Staff
4213 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4214 \property Staff.TimeSignature \set #'transparent = ##t
4215 \clef "medicaea_do2" c
4216 @end lilypond
4217
4218 @item
4219 @code{clefs-medicaea_fa} @tab
4220 Editio Medicaea style fa clef @tab
4221 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
4222 @lilypond[relative 0, notime]
4223 \context Staff
4224 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4225 \property Staff.TimeSignature \set #'transparent = ##t
4226 \clef "medicaea_fa2" c
4227 @end lilypond
4228
4229 @item
4230 @code{clefs-hufnagel_do} @tab
4231 historic style hufnagel do clef @tab
4232 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
4233 @lilypond[relative 0, notime]
4234 \context Staff
4235 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4236 \property Staff.TimeSignature \set #'transparent = ##t
4237 \clef "hufnagel_do2" c
4238 @end lilypond
4239
4240 @item
4241 @code{clefs-hufnagel_fa} @tab
4242 historic style hufnagel fa clef @tab
4243 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
4244 @lilypond[relative 0, notime]
4245 \context Staff
4246 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4247 \property Staff.TimeSignature \set #'transparent = ##t
4248 \clef "hufnagel_fa2" c
4249 @end lilypond
4250
4251 @item
4252 @code{clefs-hufnagel_do_fa} @tab
4253 historic style hufnagel combined do/fa clef @tab
4254 @code{hufnagel_do_fa} @tab
4255 @lilypond[relative 0, notime]
4256 \property Staff.TimeSignature \set #'transparent = ##t
4257 \clef "hufnagel_do_fa" c
4258 @end lilypond
4259
4260 @end multitable
4261
4262 @c --- This should go somewhere else: ---
4263 @c @item modern style percussion clef (glyph: @code{clefs-percussion})
4264 @c
4265 @c Supported clefs:
4266 @c @code{percussion}
4267 @c
4268 @c @lilypond{\property Staff.TimeSignature \set #'transparent = ##t \clef "percussion" c'}
4269 @c
4270 @c @item modern style tab clef (glyph: @code{clefs-tab})
4271 @c
4272 @c Supported clefs:
4273 @c @code{tab}
4274 @c
4275 @c @lilypond{\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #6 \property Staff.TimeSignature \set #'transparent = ##t \clef "tab" c'}
4276
4277 @emph{Modern style} means ``as is typeset in contemporary editions of
4278 transcribed mensural music''.
4279
4280 @emph{Petrucci style} means ``inspired by printings published by the
4281 famous engraver Petrucci (1466-1539)''.
4282
4283 @emph{Historic style} means ``as was typeset or written in historic
4284 editions (other than those of Petrucci)''.
4285
4286 @emph{Editio XXX style} means ``as is/was printed in Editio XXX''.
4287
4288 Petrucci used C clefs with differently balanced left-side vertical
4289 beams, depending on which staffline it is printed.
4290
4291
4292 @node Custodes
4293 @subsection Custodes
4294
4295 @cindex custos
4296 @cindex custodes
4297
4298 A @emph{custos} (plural: @emph{custodes}; latin word for `guard') is a
4299 symbol that appears at the end of a staff.  It anticipates the pitch
4300 of the first note(s) of the following line and thus helps the player
4301 or singer to manage line breaks during performance, thus enhancing
4302 readability of a score.
4303
4304 Custodes were frequently used in music notation until the 17th
4305 century.  Nowadays, they have survived only in a few particular forms
4306 of musical notation such as contemporary editions of Gregorian chant
4307 like the @emph{editio vaticana}.  There are different custos glyphs
4308 used in different flavours of notational style.
4309
4310 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
4311 @internalsref{Staff} context when declaring the @code{\paper} block,
4312 as shown in the following example.
4313
4314 @example
4315 \paper @{
4316   \translator @{
4317      \StaffContext
4318      \consists Custos_engraver
4319      Custos \override #'style = #'mensural
4320   @}
4321 @}
4322 @end example
4323
4324 The result looks like this:
4325
4326 @lilypond
4327 \score {
4328     \notes {
4329         a'1
4330         \property Staff.Custos \set #'style = #'mensural
4331         \break
4332         g'
4333     }
4334     \paper {
4335         \translator {
4336             \StaffContext
4337             \consists Custos_engraver
4338         }
4339         linewidth = 4.0\cm
4340     }
4341 }
4342 @end lilypond
4343
4344 The custos glyph is selected by the @code{style} property. The styles
4345 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
4346 @code{mensural}.  They are demonstrated in the following fragment:
4347
4348 @lilypond
4349 \score {
4350     \notes {
4351         \fatText
4352         s
4353         ^\markup {
4354             \column <<
4355                 "vaticana" 
4356                 { " " \musicglyph #"custodes-vaticana-u0" }
4357             >>
4358             \column <<
4359                 "medicaea"
4360                 { " " \musicglyph #"custodes-medicaea-u0" }
4361             >>
4362             \column <<
4363                 "hufnagel"
4364                 { " " \musicglyph #"custodes-hufnagel-u0" }
4365             >>
4366             \column <<
4367                 "mensural"
4368                 { " " \musicglyph #"custodes-mensural-u0" }
4369             >>
4370         }
4371     }
4372     \paper {
4373         raggedright = ##t 
4374         interscoreline = 1
4375         \translator {
4376             \ScoreContext
4377             \remove "Bar_number_engraver"
4378         }
4379         \translator{
4380             \StaffContext
4381             \remove "Clef_engraver"
4382             \remove "Key_engraver"
4383             \remove "Time_signature_engraver"
4384             \remove "Staff_symbol_engraver"
4385             minimumVerticalExtent = ##f
4386         }
4387     }
4388 }
4389 @end lilypond
4390
4391 If the boolean property @code{adjust-if-on-staffline} is set to
4392 @code{#t} (which it is by default), lily typesets slightly different
4393 variants of the custos glyph, depending on whether the custos, is
4394 typeset on or between stafflines.   The glyph will
4395 optically fit well into the staff, with the appendage on the right of
4396 the custos always ending at the same vertical position between two
4397 stafflines regardless of the pitch.  If you set
4398 @code{adjust-if-on-staffline} to @code{#f}, then
4399 a compromise between both forms is  used.
4400
4401 Just like stems can be attached to noteheads in two directions
4402 @emph{up} and @emph{down}, each custos glyph is available with its
4403 appendage pointing either up or down.  If the pitch of a custos is
4404 above a selectable position, the appendage will point downwards; if
4405 the pitch is below this position, the appendage will point upwards.
4406 Use property @code{neutral-position} to select this position.  By
4407 default, it is set to @code{0}, such that the neutral position is the
4408 center of the staff.  Use property @code{neutral-direction} to control
4409 what happens if a custos is typeset on the neutral position itself.
4410 By default, this property is set to @code{-1}, such that the appendage
4411 will point downwards.  If set to @code{1}, the appendage will point
4412 upwards.  Other values such as @code{0} are reserved for future
4413 extensions and should not be used.
4414
4415 @seealso
4416
4417
4418 @internalsref{Custos}, @inputfileref{input/test,custos-style.ly} and
4419 @inputfileref{input/regression,custos.ly}.
4420
4421
4422 @node Divisiones
4423 @subsection Divisiones
4424
4425 @cindex divisio
4426 @cindex divisiones
4427 @cindex finalis
4428
4429 A @emph{divisio} (plural: @emph{divisiones}; latin word for
4430 `division') is a staff context symbol that is used to structure
4431 Gregorian music into phrases and sections.  The musical meaning of
4432 @emph{divisio minima}, @emph{divisio maior} and @emph{divisio maxima}
4433 can be characterized as short, medium and long pause, somewhat like
4434 @ref{Breath marks}.  The @emph{finalis} sign not only marks the end of
4435 a chant, but is also frequently used within a single
4436 antiphonal/responsorial chant to mark the end of each section.
4437
4438 @syntax
4439
4440 To use divisiones, include the file @code{gregorian-init.ly}.  It
4441 contains definitions that you can apply by just inserting
4442 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
4443 and @code{\finalis} at proper places in the input.  Some editions use
4444 @emph{virgula} or @emph{caesura} instead of divisio minima.
4445 Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and
4446 @code{\caesura}.
4447
4448
4449 @lilypondfile[notexidoc]{divisiones.ly}
4450
4451 @seealso
4452
4453 @internalsref{BreathingSign}, @internalsref{BreathingSignEvent},
4454 @inputfileref{input/test,divisiones.ly}, @ref{Breath marks}.
4455
4456 @node Ligatures
4457 @subsection Ligatures
4458
4459 @cindex Ligatures
4460
4461 @c TODO: Should double check if I recalled things correctly when I wrote
4462 @c down the following paragraph by heart.
4463
4464 In musical terminology, a ligature is a coherent graphical symbol that
4465 represents at least two different notes.  Ligatures originally appeared
4466 in the manuscripts of Gregorian chant notation roughly since the 9th
4467 century as an allusion to the accent symbols of greek lyric poetry to
4468 denote ascending or descending sequences of notes.  Both, the shape and
4469 the exact meaning of ligatures changed tremendously during the following
4470 centuries: In early notation, ligatures where used for monophonic tunes
4471 (Gregorian chant) and very soon denoted also the way of performance in
4472 the sense of articulation.  With upcoming multiphony, the need for a
4473 metric system arised, since multiple voices of a piece have to be
4474 synchronized some way.  New notation systems were invented that used
4475 the manifold shapes of ligatures to now denote rhythmical patterns
4476 (e.g. black mensural notation, mannered notation, ars nova).  With the
4477 invention of the metric system of the white mensural notation, the need
4478 for ligatures to denote such patterns disappeared.  Nevertheless,
4479 ligatures were still in use in the mensural system for a couple of
4480 decades until they finally disappeared during the late 16th / early 17th
4481 century.  Still, ligatures have survived in contemporary editions of
4482 Gregorian chant such as the Editio Vaticana from 1905/08.
4483
4484 @syntax
4485
4486 Syntactically, ligatures are simply enclosed by @code{\[} and
4487 @code{\]}.  Some ligature styles (such as Editio Vaticana) may need
4488 additional input syntax specific for this particular type of ligature.
4489 By default, the @internalsref{LigatureBracket} engraver just puts a
4490 square bracket above the ligature.
4491
4492 @lilypond[singleline,verbatim]
4493 \score {
4494     \notes \transpose c c' {
4495         \[ g c a f d' \]
4496         a g f
4497         \[ e f a g \]
4498     }
4499 }
4500 @end lilypond
4501
4502 To select a specific style of ligatures, a proper ligature engraver
4503 has to be added to the @internalsref{Voice} context, as explained in
4504 the following subsections.  Currently, only white mensural ligatures
4505 are supported with certain limitations.  Support for Editio Vaticana
4506 will be added in the future.
4507
4508 @menu
4509 * White mensural ligatures::    
4510 * Gregorian square neumes ligatures::  
4511 @end menu
4512
4513 @node White mensural ligatures
4514 @subsubsection White mensural ligatures
4515
4516 @cindex Mensural ligatures
4517 @cindex White mensural ligatures
4518
4519 There is limited support for white mensural ligatures.  The
4520 implementation is still experimental; it currently may output strange
4521 warnings or even crash in some cases or produce weird results on more
4522 complex ligatures.  To engrave white mensural ligatures, in the paper
4523 block the @internalsref{Mensural_ligature_engraver} has to be put into
4524 the @internalsref{Voice} context, and remove the
4525 @internalsref{Ligature_bracket_engraver}:
4526
4527 @example
4528     \paper @{
4529         \translator @{
4530             \VoiceContext
4531             \remove Ligature_bracket_engraver
4532             \consists Mensural_ligature_engraver
4533         @}
4534     @}
4535 @end example
4536
4537 There is no additional input language to describe the shape of a
4538 white mensural ligature.  The shape is rather determined solely from
4539 the pitch and duration of the enclosed notes.  While this approach may
4540 take a new user a while to get accustomed, it has the great advantage
4541 that the full musical information of the ligature is known internally.
4542 This is not only required for correct MIDI output, but also allows for
4543 automatic transcription of the ligatures.
4544
4545 Example:
4546
4547 @example
4548         \property Score.timing = ##f
4549         \property Score.defaultBarType = "empty"
4550         \property Voice.NoteHead \set #'style = #'neo_mensural
4551         \property Staff.TimeSignature \set #'style = #'neo_mensural
4552         \clef "petrucci_g"
4553         \[ g\longa c\breve a\breve f\breve d'\longa \]
4554         s4
4555         \[ e1 f1 a\breve g\longa \]
4556 @end example
4557 @lilypond[singleline]
4558 \score {
4559     \notes \transpose c c' {
4560         \property Score.timing = ##f
4561         \property Score.defaultBarType = "empty"
4562         \property Voice.NoteHead \set #'style = #'neo_mensural
4563         \property Staff.TimeSignature \set #'style = #'neo_mensural
4564         \clef "petrucci_g"
4565         \[ g\longa c\breve a\breve f\breve d'\longa \]
4566         s4
4567         \[ e1 f1 a\breve g\longa \]
4568     }
4569     \paper {
4570         \translator {
4571             \VoiceContext
4572             \remove Ligature_bracket_engraver
4573             \consists Mensural_ligature_engraver
4574         }
4575     }
4576 }
4577 @end lilypond
4578
4579 Without replacing @internalsref{Ligature_bracket_engraver} with
4580 @internalsref{Mensural_ligature_engraver}, the same music transcribes
4581 to the following:
4582
4583 @lilypond[singleline]
4584 \score {
4585     \notes \transpose c c' {
4586         \property Score.timing = ##f
4587         \property Score.defaultBarType = "empty"
4588         \property Voice.NoteHead \set #'style = #'neo_mensural
4589         \property Staff.TimeSignature \set #'style = #'neo_mensural
4590         \clef "petrucci_g"
4591         \[ g\longa c\breve a\breve f\breve d'\longa \]
4592         s4
4593         \[ e1 f1 a\breve g\longa \]
4594     }
4595 }
4596 @end lilypond
4597
4598 @node Gregorian square neumes ligatures
4599 @subsubsection Gregorian square neumes ligatures
4600
4601 @cindex Square neumes ligatures
4602 @cindex Gregorian square neumes ligatures
4603
4604 Gregorian square neumes notation (following the style of the Editio
4605 Vaticana) is under heavy development, but not yet really usable for
4606 production purposes.  Core ligatures can already be typeset, but
4607 essentials issues for serious typesetting are still under development,
4608 such as (among others) horizontal alignment of multiple ligatures,
4609 lyrics alignment and proper accidentals handling.  Still, this section
4610 gives a sneak preview of what Gregorian chant may look like once it
4611 will work.
4612
4613 The following table contains the extended neumes table of the 2nd
4614 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
4615 1983 by the monks of Solesmes.
4616
4617 @multitable @columnfractions .4 .2 .2 .2
4618
4619 @item
4620 @b{Neuma aut@*Neumarum Elementa} @tab
4621 @b{Figurae@*Rectae} @tab
4622 @b{Figurae@*Liquescentes Auctae} @tab
4623 @b{Figurae@*Liquescentes Deminutae}
4624
4625 @c TODO: \paper block is identical in all of the below examples.
4626 @c Therefore, it should somehow be included rather than duplicated all
4627 @c the time.
4628
4629 @item
4630 @code{1. Punctum}
4631 @tab
4632 @lilypond[noindent, 26pt, nofragment, linewidth=1.5cm]
4633 \include "gregorian-init.ly"
4634 \score {
4635     \notes \transpose c c' {
4636         % Puctum
4637         \[ b \]
4638         \noBreak s^\markup {"a"} \noBreak
4639
4640         % Punctum Inclinatum
4641         \[ \inclinatum b \]
4642         \noBreak s^\markup {"b"}
4643     }
4644     \paper {
4645         interscoreline = 1
4646         \translator {
4647             \ScoreContext
4648             \remove "Bar_number_engraver"
4649         }
4650         \translator {
4651             \StaffContext
4652             \remove "Clef_engraver"
4653             \remove "Key_engraver"
4654             \remove "Staff_symbol_engraver"
4655             \remove "Time_signature_engraver"
4656             \remove "Bar_engraver"
4657             minimumVerticalExtent = ##f
4658         }
4659         \translator {
4660             \VoiceContext
4661             \remove Ligature_bracket_engraver
4662             \consists Vaticana_ligature_engraver
4663             NoteHead \set #'style = #'vaticana_punctum
4664             Stem \set #'transparent = ##t
4665         }
4666     }
4667 }
4668 @end lilypond
4669 @tab
4670 @lilypond[noindent, 26pt, nofragment, linewidth=2.5cm]
4671 \include "gregorian-init.ly"
4672 \score {
4673     \notes \transpose c c' {
4674         % Punctum Auctum Ascendens
4675         \[ \auctum \ascendens b \]
4676         \noBreak s^\markup {"c"} \noBreak
4677
4678         % Punctum Auctum Descendens
4679         \[ \auctum \descendens b \]
4680         \noBreak s^\markup {"d"} \noBreak
4681
4682         % Punctum Inclinatum Auctum
4683         \[ \inclinatum \auctum b \]
4684         \noBreak s^\markup {"e"}
4685     }
4686     \paper {
4687         interscoreline = 1
4688         \translator {
4689             \ScoreContext
4690             \remove "Bar_number_engraver"
4691         }
4692         \translator {
4693             \StaffContext
4694             \remove "Clef_engraver"
4695             \remove "Key_engraver"
4696             \remove "Staff_symbol_engraver"
4697             \remove "Time_signature_engraver"
4698             \remove "Bar_engraver"
4699             minimumVerticalExtent = ##f
4700         }
4701         \translator {
4702             \VoiceContext
4703             \remove Ligature_bracket_engraver
4704             \consists Vaticana_ligature_engraver
4705             NoteHead \set #'style = #'vaticana_punctum
4706             Stem \set #'transparent = ##t
4707         }
4708     }
4709 }
4710 @end lilypond
4711 @tab
4712 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
4713 \include "gregorian-init.ly"
4714 \score {
4715     \notes \transpose c c' {
4716         % Punctum Inclinatum Parvum
4717         \[ \inclinatum \deminutum b \]
4718         \noBreak s^\markup {"f"}
4719     }
4720     \paper {
4721         interscoreline = 1
4722         \translator {
4723             \ScoreContext
4724             \remove "Bar_number_engraver"
4725         }
4726         \translator {
4727             \StaffContext
4728             \remove "Clef_engraver"
4729             \remove "Key_engraver"
4730             \remove "Staff_symbol_engraver"
4731             \remove "Time_signature_engraver"
4732             \remove "Bar_engraver"
4733             minimumVerticalExtent = ##f
4734         }
4735         \translator {
4736             \VoiceContext
4737             \remove Ligature_bracket_engraver
4738             \consists Vaticana_ligature_engraver
4739             NoteHead \set #'style = #'vaticana_punctum
4740             Stem \set #'transparent = ##t
4741         }
4742     }
4743 }
4744 @end lilypond
4745
4746 @item
4747 @code{2. Virga}
4748 @tab
4749 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
4750 \include "gregorian-init.ly"
4751 \score {
4752     \notes \transpose c c' {
4753         % Virga
4754         \[ \virga b \]
4755         \noBreak s^\markup {"g"}
4756     }
4757     \paper {
4758         interscoreline = 1
4759         \translator {
4760             \ScoreContext
4761             \remove "Bar_number_engraver"
4762         }
4763         \translator {
4764             \StaffContext
4765             \remove "Clef_engraver"
4766             \remove "Key_engraver"
4767             \remove "Staff_symbol_engraver"
4768             \remove "Time_signature_engraver"
4769             \remove "Bar_engraver"
4770             minimumVerticalExtent = ##f
4771         }
4772         \translator {
4773             \VoiceContext
4774             \remove Ligature_bracket_engraver
4775             \consists Vaticana_ligature_engraver
4776             NoteHead \set #'style = #'vaticana_punctum
4777             Stem \set #'transparent = ##t
4778         }
4779     }
4780 }
4781 @end lilypond
4782 @tab
4783 @tab
4784
4785 @item
4786 @code{3. Apostropha vel Stropha}
4787 @tab
4788 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
4789 \include "gregorian-init.ly"
4790 \score {
4791     \notes \transpose c c' {
4792         % Stropha
4793         \[ \stropha b \]
4794         \noBreak s^\markup {"h"}
4795     }
4796     \paper {
4797         interscoreline = 1
4798         \translator {
4799             \ScoreContext
4800             \remove "Bar_number_engraver"
4801         }
4802         \translator {
4803             \StaffContext
4804             \remove "Clef_engraver"
4805             \remove "Key_engraver"
4806             \remove "Staff_symbol_engraver"
4807             \remove "Time_signature_engraver"
4808             \remove "Bar_engraver"
4809             minimumVerticalExtent = ##f
4810         }
4811         \translator {
4812             \VoiceContext
4813             \remove Ligature_bracket_engraver
4814             \consists Vaticana_ligature_engraver
4815             NoteHead \set #'style = #'vaticana_punctum
4816             Stem \set #'transparent = ##t
4817         }
4818     }
4819 }
4820 @end lilypond
4821 @tab
4822 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
4823 \include "gregorian-init.ly"
4824 \score {
4825     \notes \transpose c c' {
4826         % Stropha Aucta
4827         \[ \stropha \auctum b \]
4828         \noBreak s^\markup {"i"}
4829     }
4830     \paper {
4831         interscoreline = 1
4832         \translator {
4833             \ScoreContext
4834             \remove "Bar_number_engraver"
4835         }
4836         \translator {
4837             \StaffContext
4838             \remove "Clef_engraver"
4839             \remove "Key_engraver"
4840             \remove "Staff_symbol_engraver"
4841             \remove "Time_signature_engraver"
4842             \remove "Bar_engraver"
4843             minimumVerticalExtent = ##f
4844         }
4845         \translator {
4846             \VoiceContext
4847             \remove Ligature_bracket_engraver
4848             \consists Vaticana_ligature_engraver
4849             NoteHead \set #'style = #'vaticana_punctum
4850             Stem \set #'transparent = ##t
4851         }
4852     }
4853 }
4854 @end lilypond
4855 @tab
4856
4857 @item
4858 @code{4. Oriscus}
4859 @tab
4860 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
4861 \include "gregorian-init.ly"
4862 \score {
4863     \notes \transpose c c' {
4864         % Oriscus
4865         \[ \oriscus b \]
4866         \noBreak s^\markup {"j"}
4867     }
4868     \paper {
4869         interscoreline = 1
4870         \translator {
4871             \ScoreContext
4872             \remove "Bar_number_engraver"
4873         }
4874         \translator {
4875             \StaffContext
4876             \remove "Clef_engraver"
4877             \remove "Key_engraver"
4878             \remove "Staff_symbol_engraver"
4879             \remove "Time_signature_engraver"
4880             \remove "Bar_engraver"
4881             minimumVerticalExtent = ##f
4882         }
4883         \translator {
4884             \VoiceContext
4885             \remove Ligature_bracket_engraver
4886             \consists Vaticana_ligature_engraver
4887             NoteHead \set #'style = #'vaticana_punctum
4888             Stem \set #'transparent = ##t
4889         }
4890     }
4891 }
4892 @end lilypond
4893 @tab
4894 @tab
4895
4896 @item
4897 @code{5. Clivis vel Flexa}
4898 @tab
4899 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
4900 \include "gregorian-init.ly"
4901 \score {
4902     \notes \transpose c c' {
4903         % Clivis vel Flexa
4904         \[ b \flexa g \]
4905         s^\markup {"k"}
4906     }
4907     \paper {
4908         interscoreline = 1
4909         \translator {
4910             \ScoreContext
4911             \remove "Bar_number_engraver"
4912         }
4913         \translator {
4914             \StaffContext
4915             \remove "Clef_engraver"
4916             \remove "Key_engraver"
4917             \remove "Staff_symbol_engraver"
4918             \remove "Time_signature_engraver"
4919             \remove "Bar_engraver"
4920             minimumVerticalExtent = ##f
4921         }
4922         \translator {
4923             \VoiceContext
4924             \remove Ligature_bracket_engraver
4925             \consists Vaticana_ligature_engraver
4926             NoteHead \set #'style = #'vaticana_punctum
4927             Stem \set #'transparent = ##t
4928         }
4929     }
4930 }
4931 @end lilypond
4932 @tab
4933 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
4934 \include "gregorian-init.ly"
4935 \score {
4936     \notes \transpose c c' {
4937         % Clivis Aucta Descendens
4938         \[ b \flexa \auctum \descendens g \]
4939         \noBreak s^\markup {"l"} \noBreak
4940
4941         % Clivis Aucta Ascendens
4942         \[ b \flexa \auctum \ascendens g \]
4943         \noBreak s^\markup {"m"}
4944     }
4945     \paper {
4946         interscoreline = 1
4947         \translator {
4948             \ScoreContext
4949             \remove "Bar_number_engraver"
4950         }
4951         \translator {
4952             \StaffContext
4953             \remove "Clef_engraver"
4954             \remove "Key_engraver"
4955             \remove "Staff_symbol_engraver"
4956             \remove "Time_signature_engraver"
4957             \remove "Bar_engraver"
4958             minimumVerticalExtent = ##f
4959         }
4960         \translator {
4961             \VoiceContext
4962             \remove Ligature_bracket_engraver
4963             \consists Vaticana_ligature_engraver
4964             NoteHead \set #'style = #'vaticana_punctum
4965             Stem \set #'transparent = ##t
4966         }
4967     }
4968 }
4969 @end lilypond
4970 @tab
4971 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
4972 \include "gregorian-init.ly"
4973 \score {
4974     \notes \transpose c c' {
4975         % Cephalicus
4976         \[ b \flexa \deminutum g \]
4977         s^\markup {"n"}
4978     }
4979     \paper {
4980         interscoreline = 1
4981         \translator {
4982             \ScoreContext
4983             \remove "Bar_number_engraver"
4984         }
4985         \translator {
4986             \StaffContext
4987             \remove "Clef_engraver"
4988             \remove "Key_engraver"
4989             \remove "Staff_symbol_engraver"
4990             \remove "Time_signature_engraver"
4991             \remove "Bar_engraver"
4992             minimumVerticalExtent = ##f
4993         }
4994         \translator {
4995             \VoiceContext
4996             \remove Ligature_bracket_engraver
4997             \consists Vaticana_ligature_engraver
4998             NoteHead \set #'style = #'vaticana_punctum
4999             Stem \set #'transparent = ##t
5000         }
5001     }
5002 }
5003 @end lilypond
5004
5005 @item
5006 @code{6. Podatus vel Pes}
5007 @tab
5008 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5009 \include "gregorian-init.ly"
5010 \score {
5011     \notes \transpose c c' {
5012         % Podatus vel Pes
5013         \[ g \pes b \]
5014         s^\markup {"o"}
5015     }
5016     \paper {
5017         interscoreline = 1
5018         \translator {
5019             \ScoreContext
5020             \remove "Bar_number_engraver"
5021         }
5022         \translator {
5023             \StaffContext
5024             \remove "Clef_engraver"
5025             \remove "Key_engraver"
5026             \remove "Staff_symbol_engraver"
5027             \remove "Time_signature_engraver"
5028             \remove "Bar_engraver"
5029             minimumVerticalExtent = ##f
5030         }
5031         \translator {
5032             \VoiceContext
5033             \remove Ligature_bracket_engraver
5034             \consists Vaticana_ligature_engraver
5035             NoteHead \set #'style = #'vaticana_punctum
5036             Stem \set #'transparent = ##t
5037         }
5038     }
5039 }
5040 @end lilypond
5041 @tab
5042 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
5043 \include "gregorian-init.ly"
5044 \score {
5045     \notes \transpose c c' {
5046         % Pes Auctus Descendens
5047         \[ g \pes \auctum \descendens b \]
5048         \noBreak s^\markup {"p"} \noBreak
5049
5050         % Pes Auctus Ascendens
5051         \[ g \pes \auctum \ascendens b \]
5052         \noBreak s^\markup {"q"}
5053     }
5054     \paper {
5055         interscoreline = 1
5056         \translator {
5057             \ScoreContext
5058             \remove "Bar_number_engraver"
5059         }
5060         \translator {
5061             \StaffContext
5062             \remove "Clef_engraver"
5063             \remove "Key_engraver"
5064             \remove "Staff_symbol_engraver"
5065             \remove "Time_signature_engraver"
5066             \remove "Bar_engraver"
5067             minimumVerticalExtent = ##f
5068         }
5069         \translator {
5070             \VoiceContext
5071             \remove Ligature_bracket_engraver
5072             \consists Vaticana_ligature_engraver
5073             NoteHead \set #'style = #'vaticana_punctum
5074             Stem \set #'transparent = ##t
5075         }
5076     }
5077 }
5078 @end lilypond
5079 @tab
5080 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5081 \include "gregorian-init.ly"
5082 \score {
5083     \notes \transpose c c' {
5084         % Epiphonus
5085         \[ g \pes \deminutum b \]
5086         s^\markup {"r"}
5087     }
5088     \paper {
5089         interscoreline = 1
5090         \translator {
5091             \ScoreContext
5092             \remove "Bar_number_engraver"
5093         }
5094         \translator {
5095             \StaffContext
5096             \remove "Clef_engraver"
5097             \remove "Key_engraver"
5098             \remove "Staff_symbol_engraver"
5099             \remove "Time_signature_engraver"
5100             \remove "Bar_engraver"
5101             minimumVerticalExtent = ##f
5102         }
5103         \translator {
5104             \VoiceContext
5105             \remove Ligature_bracket_engraver
5106             \consists Vaticana_ligature_engraver
5107             NoteHead \set #'style = #'vaticana_punctum
5108             Stem \set #'transparent = ##t
5109         }
5110     }
5111 }
5112 @end lilypond
5113
5114 @item
5115 @code{7. Pes Quassus}
5116 @tab
5117 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5118 \include "gregorian-init.ly"
5119 \score {
5120     \notes \transpose c c' {
5121         % Pes Quassus
5122         \[ \oriscus g \pes \virga b \]
5123         s^\markup {"s"}
5124     }
5125     \paper {
5126         interscoreline = 1
5127         \translator {
5128             \ScoreContext
5129             \remove "Bar_number_engraver"
5130         }
5131         \translator {
5132             \StaffContext
5133             \remove "Clef_engraver"
5134             \remove "Key_engraver"
5135             \remove "Staff_symbol_engraver"
5136             \remove "Time_signature_engraver"
5137             \remove "Bar_engraver"
5138             minimumVerticalExtent = ##f
5139         }
5140         \translator {
5141             \VoiceContext
5142             \remove Ligature_bracket_engraver
5143             \consists Vaticana_ligature_engraver
5144             NoteHead \set #'style = #'vaticana_punctum
5145             Stem \set #'transparent = ##t
5146         }
5147     }
5148 }
5149 @end lilypond
5150 @tab
5151 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5152 \include "gregorian-init.ly"
5153 \score {
5154     \notes \transpose c c' {
5155         % Pes Quassus Auctus Descendens
5156         \[ \oriscus g \pes \auctum \descendens b \]
5157         s^\markup {"t"}
5158     }
5159     \paper {
5160         interscoreline = 1
5161         \translator {
5162             \ScoreContext
5163             \remove "Bar_number_engraver"
5164         }
5165         \translator {
5166             \StaffContext
5167             \remove "Clef_engraver"
5168             \remove "Key_engraver"
5169             \remove "Staff_symbol_engraver"
5170             \remove "Time_signature_engraver"
5171             \remove "Bar_engraver"
5172             minimumVerticalExtent = ##f
5173         }
5174         \translator {
5175             \VoiceContext
5176             \remove Ligature_bracket_engraver
5177             \consists Vaticana_ligature_engraver
5178             NoteHead \set #'style = #'vaticana_punctum
5179             Stem \set #'transparent = ##t
5180         }
5181     }
5182 }
5183 @end lilypond
5184 @tab
5185
5186 @item
5187 @code{8. Quilisma Pes}
5188 @tab
5189 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5190 \include "gregorian-init.ly"
5191 \score {
5192     \notes \transpose c c' {
5193         % Quilisma Pes
5194         \[ \quilisma g \pes b \]
5195         s^\markup {"u"}
5196     }
5197     \paper {
5198         interscoreline = 1
5199         \translator {
5200             \ScoreContext
5201             \remove "Bar_number_engraver"
5202         }
5203         \translator {
5204             \StaffContext
5205             \remove "Clef_engraver"
5206             \remove "Key_engraver"
5207             \remove "Staff_symbol_engraver"
5208             \remove "Time_signature_engraver"
5209             \remove "Bar_engraver"
5210             minimumVerticalExtent = ##f
5211         }
5212         \translator {
5213             \VoiceContext
5214             \remove Ligature_bracket_engraver
5215             \consists Vaticana_ligature_engraver
5216             NoteHead \set #'style = #'vaticana_punctum
5217             Stem \set #'transparent = ##t
5218         }
5219     }
5220 }
5221 @end lilypond
5222 @tab
5223 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5224 \include "gregorian-init.ly"
5225 \score {
5226     \notes \transpose c c' {
5227         % Quilisma Pes Auctus Descendens
5228         \[ \quilisma g \pes \auctum \descendens b \]
5229         s^\markup {"v"}
5230     }
5231     \paper {
5232         interscoreline = 1
5233         \translator {
5234             \ScoreContext
5235             \remove "Bar_number_engraver"
5236         }
5237         \translator {
5238             \StaffContext
5239             \remove "Clef_engraver"
5240             \remove "Key_engraver"
5241             \remove "Staff_symbol_engraver"
5242             \remove "Time_signature_engraver"
5243             \remove "Bar_engraver"
5244             minimumVerticalExtent = ##f
5245         }
5246         \translator {
5247             \VoiceContext
5248             \remove Ligature_bracket_engraver
5249             \consists Vaticana_ligature_engraver
5250             NoteHead \set #'style = #'vaticana_punctum
5251             Stem \set #'transparent = ##t
5252         }
5253     }
5254 }
5255 @end lilypond
5256 @tab
5257
5258 @item
5259 @code{9. Podatus Initio Debilis}
5260 @tab
5261 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5262 \include "gregorian-init.ly"
5263 \score {
5264     \notes \transpose c c' {
5265         % Pes Initio Debilis
5266         \[ \deminutum g \pes b \]
5267         s^\markup {"w"}
5268     }
5269     \paper {
5270         interscoreline = 1
5271         \translator {
5272             \ScoreContext
5273             \remove "Bar_number_engraver"
5274         }
5275         \translator {
5276             \StaffContext
5277             \remove "Clef_engraver"
5278             \remove "Key_engraver"
5279             \remove "Staff_symbol_engraver"
5280             \remove "Time_signature_engraver"
5281             \remove "Bar_engraver"
5282             minimumVerticalExtent = ##f
5283         }
5284         \translator {
5285             \VoiceContext
5286             \remove Ligature_bracket_engraver
5287             \consists Vaticana_ligature_engraver
5288             NoteHead \set #'style = #'vaticana_punctum
5289             Stem \set #'transparent = ##t
5290         }
5291     }
5292 }
5293 @end lilypond
5294 @tab
5295 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5296 \include "gregorian-init.ly"
5297 \score {
5298     \notes \transpose c c' {
5299         % Pes Auctus Descendens Initio Debilis
5300         \[ \deminutum g \pes \auctum \descendens b \]
5301         s^\markup {"x"}
5302     }
5303     \paper {
5304         interscoreline = 1
5305         \translator {
5306             \ScoreContext
5307             \remove "Bar_number_engraver"
5308         }
5309         \translator {
5310             \StaffContext
5311             \remove "Clef_engraver"
5312             \remove "Key_engraver"
5313             \remove "Staff_symbol_engraver"
5314             \remove "Time_signature_engraver"
5315             \remove "Bar_engraver"
5316             minimumVerticalExtent = ##f
5317         }
5318         \translator {
5319             \VoiceContext
5320             \remove Ligature_bracket_engraver
5321             \consists Vaticana_ligature_engraver
5322             NoteHead \set #'style = #'vaticana_punctum
5323             Stem \set #'transparent = ##t
5324         }
5325     }
5326 }
5327 @end lilypond
5328 @tab
5329
5330 @item
5331 @code{10. Torculus}
5332 @tab
5333 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5334 \include "gregorian-init.ly"
5335 \score {
5336     \notes \transpose c c' {
5337         % Torculus
5338         \[ a \pes b \flexa g \]
5339         s^\markup {"y"}
5340     }
5341     \paper {
5342         interscoreline = 1
5343         \translator {
5344             \ScoreContext
5345             \remove "Bar_number_engraver"
5346         }
5347         \translator {
5348             \StaffContext
5349             \remove "Clef_engraver"
5350             \remove "Key_engraver"
5351             \remove "Staff_symbol_engraver"
5352             \remove "Time_signature_engraver"
5353             \remove "Bar_engraver"
5354             minimumVerticalExtent = ##f
5355         }
5356         \translator {
5357             \VoiceContext
5358             \remove Ligature_bracket_engraver
5359             \consists Vaticana_ligature_engraver
5360             NoteHead \set #'style = #'vaticana_punctum
5361             Stem \set #'transparent = ##t
5362         }
5363     }
5364 }
5365 @end lilypond
5366 @tab
5367 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5368 \include "gregorian-init.ly"
5369 \score {
5370     \notes \transpose c c' {
5371         % Torculus Auctus Descendens
5372         \[ a \pes b \flexa \auctum \descendens g \]
5373         s^\markup {"z"}
5374     }
5375     \paper {
5376         interscoreline = 1
5377         \translator {
5378             \ScoreContext
5379             \remove "Bar_number_engraver"
5380         }
5381         \translator {
5382             \StaffContext
5383             \remove "Clef_engraver"
5384             \remove "Key_engraver"
5385             \remove "Staff_symbol_engraver"
5386             \remove "Time_signature_engraver"
5387             \remove "Bar_engraver"
5388             minimumVerticalExtent = ##f
5389         }
5390         \translator {
5391             \VoiceContext
5392             \remove Ligature_bracket_engraver
5393             \consists Vaticana_ligature_engraver
5394             NoteHead \set #'style = #'vaticana_punctum
5395             Stem \set #'transparent = ##t
5396         }
5397     }
5398 }
5399 @end lilypond
5400 @tab
5401 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5402 \include "gregorian-init.ly"
5403 \score {
5404     \notes \transpose c c' {
5405         % Torculus Deminutus
5406         \[ a \pes b \flexa \deminutum g \]
5407         s^\markup {"A"}
5408     }
5409     \paper {
5410         interscoreline = 1
5411         \translator {
5412             \ScoreContext
5413             \remove "Bar_number_engraver"
5414         }
5415         \translator {
5416             \StaffContext
5417             \remove "Clef_engraver"
5418             \remove "Key_engraver"
5419             \remove "Staff_symbol_engraver"
5420             \remove "Time_signature_engraver"
5421             \remove "Bar_engraver"
5422             minimumVerticalExtent = ##f
5423         }
5424         \translator {
5425             \VoiceContext
5426             \remove Ligature_bracket_engraver
5427             \consists Vaticana_ligature_engraver
5428             NoteHead \set #'style = #'vaticana_punctum
5429             Stem \set #'transparent = ##t
5430         }
5431     }
5432 }
5433 @end lilypond
5434
5435 @item
5436 @code{11. Torculus Initio Debilis}
5437 @tab
5438 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5439 \include "gregorian-init.ly"
5440 \score {
5441     \notes \transpose c c' {
5442         % Torculus Initio Debilis
5443         \[ \deminutum a \pes b \flexa g \]
5444         s^\markup {"B"}
5445     }
5446     \paper {
5447         interscoreline = 1
5448         \translator {
5449             \ScoreContext
5450             \remove "Bar_number_engraver"
5451         }
5452         \translator {
5453             \StaffContext
5454             \remove "Clef_engraver"
5455             \remove "Key_engraver"
5456             \remove "Staff_symbol_engraver"
5457             \remove "Time_signature_engraver"
5458             \remove "Bar_engraver"
5459             minimumVerticalExtent = ##f
5460         }
5461         \translator {
5462             \VoiceContext
5463             \remove Ligature_bracket_engraver
5464             \consists Vaticana_ligature_engraver
5465             NoteHead \set #'style = #'vaticana_punctum
5466             Stem \set #'transparent = ##t
5467         }
5468     }
5469 }
5470 @end lilypond
5471 @tab
5472 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5473 \include "gregorian-init.ly"
5474 \score {
5475     \notes \transpose c c' {
5476         % Torculus Auctus Descendens Initio Debilis
5477         \[ \deminutum a \pes b \flexa \auctum \descendens g \]
5478         s^\markup {"C"}
5479     }
5480     \paper {
5481         interscoreline = 1
5482         \translator {
5483             \ScoreContext
5484             \remove "Bar_number_engraver"
5485         }
5486         \translator {
5487             \StaffContext
5488             \remove "Clef_engraver"
5489             \remove "Key_engraver"
5490             \remove "Staff_symbol_engraver"
5491             \remove "Time_signature_engraver"
5492             \remove "Bar_engraver"
5493             minimumVerticalExtent = ##f
5494         }
5495         \translator {
5496             \VoiceContext
5497             \remove Ligature_bracket_engraver
5498             \consists Vaticana_ligature_engraver
5499             NoteHead \set #'style = #'vaticana_punctum
5500             Stem \set #'transparent = ##t
5501         }
5502     }
5503 }
5504 @end lilypond
5505 @tab
5506 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5507 \include "gregorian-init.ly"
5508 \score {
5509     \notes \transpose c c' {
5510         % Torculus Deminutus Initio Debilis
5511         \[ \deminutum a \pes b \flexa \deminutum g \]
5512         s^\markup {"D"}
5513     }
5514     \paper {
5515         interscoreline = 1
5516         \translator {
5517             \ScoreContext
5518             \remove "Bar_number_engraver"
5519         }
5520         \translator {
5521             \StaffContext
5522             \remove "Clef_engraver"
5523             \remove "Key_engraver"
5524             \remove "Staff_symbol_engraver"
5525             \remove "Time_signature_engraver"
5526             \remove "Bar_engraver"
5527             minimumVerticalExtent = ##f
5528         }
5529         \translator {
5530             \VoiceContext
5531             \remove Ligature_bracket_engraver
5532             \consists Vaticana_ligature_engraver
5533             NoteHead \set #'style = #'vaticana_punctum
5534             Stem \set #'transparent = ##t
5535         }
5536     }
5537 }
5538 @end lilypond
5539
5540 @item
5541 @code{12. Porrectus}
5542 @tab
5543 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5544 \include "gregorian-init.ly"
5545 \score {
5546     \notes \transpose c c' {
5547         % Porrectus
5548         \[ a \flexa g \pes b \]
5549         s^\markup {"E"}
5550     }
5551     \paper {
5552         interscoreline = 1
5553         \translator {
5554             \ScoreContext
5555             \remove "Bar_number_engraver"
5556         }
5557         \translator {
5558             \StaffContext
5559             \remove "Clef_engraver"
5560             \remove "Key_engraver"
5561             \remove "Staff_symbol_engraver"
5562             \remove "Time_signature_engraver"
5563             \remove "Bar_engraver"
5564             minimumVerticalExtent = ##f
5565         }
5566         \translator {
5567             \VoiceContext
5568             \remove Ligature_bracket_engraver
5569             \consists Vaticana_ligature_engraver
5570             NoteHead \set #'style = #'vaticana_punctum
5571             Stem \set #'transparent = ##t
5572         }
5573     }
5574 }
5575 @end lilypond
5576 @tab
5577 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5578 \include "gregorian-init.ly"
5579 \score {
5580     \notes \transpose c c' {
5581         % Porrectus Auctus Descendens
5582         \[ a \flexa g \pes \auctum \descendens b \]
5583         s^\markup {"F"}
5584     }
5585     \paper {
5586         interscoreline = 1
5587         \translator {
5588             \ScoreContext
5589             \remove "Bar_number_engraver"
5590         }
5591         \translator {
5592             \StaffContext
5593             \remove "Clef_engraver"
5594             \remove "Key_engraver"
5595             \remove "Staff_symbol_engraver"
5596             \remove "Time_signature_engraver"
5597             \remove "Bar_engraver"
5598             minimumVerticalExtent = ##f
5599         }
5600         \translator {
5601             \VoiceContext
5602             \remove Ligature_bracket_engraver
5603             \consists Vaticana_ligature_engraver
5604             NoteHead \set #'style = #'vaticana_punctum
5605             Stem \set #'transparent = ##t
5606         }
5607     }
5608 }
5609 @end lilypond
5610 @tab
5611 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5612 \include "gregorian-init.ly"
5613 \score {
5614     \notes \transpose c c' {
5615         % Porrectus Deminutus
5616         \[ a \flexa g \pes \deminutum b \]
5617         s^\markup {"G"}
5618     }
5619     \paper {
5620         interscoreline = 1
5621         \translator {
5622             \ScoreContext
5623             \remove "Bar_number_engraver"
5624         }
5625         \translator {
5626             \StaffContext
5627             \remove "Clef_engraver"
5628             \remove "Key_engraver"
5629             \remove "Staff_symbol_engraver"
5630             \remove "Time_signature_engraver"
5631             \remove "Bar_engraver"
5632             minimumVerticalExtent = ##f
5633         }
5634         \translator {
5635             \VoiceContext
5636             \remove Ligature_bracket_engraver
5637             \consists Vaticana_ligature_engraver
5638             NoteHead \set #'style = #'vaticana_punctum
5639             Stem \set #'transparent = ##t
5640         }
5641     }
5642 }
5643 @end lilypond
5644
5645 @item
5646 @code{13. Climacus}
5647 @tab
5648 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5649 \include "gregorian-init.ly"
5650 \score {
5651     \notes \transpose c c' {
5652         % Climacus
5653         \[ \virga b \inclinatum a \inclinatum g \]
5654         s^\markup {"H"}
5655     }
5656     \paper {
5657         interscoreline = 1
5658         \translator {
5659             \ScoreContext
5660             \remove "Bar_number_engraver"
5661         }
5662         \translator {
5663             \StaffContext
5664             \remove "Clef_engraver"
5665             \remove "Key_engraver"
5666             \remove "Staff_symbol_engraver"
5667             \remove "Time_signature_engraver"
5668             \remove "Bar_engraver"
5669             minimumVerticalExtent = ##f
5670         }
5671         \translator {
5672             \VoiceContext
5673             \remove Ligature_bracket_engraver
5674             \consists Vaticana_ligature_engraver
5675             NoteHead \set #'style = #'vaticana_punctum
5676             Stem \set #'transparent = ##t
5677         }
5678     }
5679 }
5680 @end lilypond
5681 @tab
5682 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5683 \include "gregorian-init.ly"
5684 \score {
5685     \notes \transpose c c' {
5686         % Climacus Auctus
5687         \[ \virga b \inclinatum a \inclinatum \auctum g \]
5688         s^\markup {"I"}
5689     }
5690     \paper {
5691         interscoreline = 1
5692         \translator {
5693             \ScoreContext
5694             \remove "Bar_number_engraver"
5695         }
5696         \translator {
5697             \StaffContext
5698             \remove "Clef_engraver"
5699             \remove "Key_engraver"
5700             \remove "Staff_symbol_engraver"
5701             \remove "Time_signature_engraver"
5702             \remove "Bar_engraver"
5703             minimumVerticalExtent = ##f
5704         }
5705         \translator {
5706             \VoiceContext
5707             \remove Ligature_bracket_engraver
5708             \consists Vaticana_ligature_engraver
5709             NoteHead \set #'style = #'vaticana_punctum
5710             Stem \set #'transparent = ##t
5711         }
5712     }
5713 }
5714 @end lilypond
5715 @tab
5716 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5717 \include "gregorian-init.ly"
5718 \score {
5719     \notes \transpose c c' {
5720         % Climacus Deminutus
5721         \[ \virga b \inclinatum a \inclinatum \deminutum g \]
5722         s^\markup {"J"}
5723     }
5724     \paper {
5725         interscoreline = 1
5726         \translator {
5727             \ScoreContext
5728             \remove "Bar_number_engraver"
5729         }
5730         \translator {
5731             \StaffContext
5732             \remove "Clef_engraver"
5733             \remove "Key_engraver"
5734             \remove "Staff_symbol_engraver"
5735             \remove "Time_signature_engraver"
5736             \remove "Bar_engraver"
5737             minimumVerticalExtent = ##f
5738         }
5739         \translator {
5740             \VoiceContext
5741             \remove Ligature_bracket_engraver
5742             \consists Vaticana_ligature_engraver
5743             NoteHead \set #'style = #'vaticana_punctum
5744             Stem \set #'transparent = ##t
5745         }
5746     }
5747 }
5748 @end lilypond
5749
5750 @item
5751 @code{14. Scandicus}
5752 @tab
5753 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5754 \include "gregorian-init.ly"
5755 \score {
5756     \notes \transpose c c' {
5757         % Scandicus
5758         \[ g \pes a \virga b \]
5759         s^\markup {"K"}
5760     }
5761     \paper {
5762         interscoreline = 1
5763         \translator {
5764             \ScoreContext
5765             \remove "Bar_number_engraver"
5766         }
5767         \translator {
5768             \StaffContext
5769             \remove "Clef_engraver"
5770             \remove "Key_engraver"
5771             \remove "Staff_symbol_engraver"
5772             \remove "Time_signature_engraver"
5773             \remove "Bar_engraver"
5774             minimumVerticalExtent = ##f
5775         }
5776         \translator {
5777             \VoiceContext
5778             \remove Ligature_bracket_engraver
5779             \consists Vaticana_ligature_engraver
5780             NoteHead \set #'style = #'vaticana_punctum
5781             Stem \set #'transparent = ##t
5782         }
5783     }
5784 }
5785 @end lilypond
5786 @tab
5787 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5788 \include "gregorian-init.ly"
5789 \score {
5790     \notes \transpose c c' {
5791         % Scandicus Auctus Descendens
5792         \[ g \pes a \pes \auctum \descendens b \]
5793         s^\markup {"L"}
5794     }
5795     \paper {
5796         interscoreline = 1
5797         \translator {
5798             \ScoreContext
5799             \remove "Bar_number_engraver"
5800         }
5801         \translator {
5802             \StaffContext
5803             \remove "Clef_engraver"
5804             \remove "Key_engraver"
5805             \remove "Staff_symbol_engraver"
5806             \remove "Time_signature_engraver"
5807             \remove "Bar_engraver"
5808             minimumVerticalExtent = ##f
5809         }
5810         \translator {
5811             \VoiceContext
5812             \remove Ligature_bracket_engraver
5813             \consists Vaticana_ligature_engraver
5814             NoteHead \set #'style = #'vaticana_punctum
5815             Stem \set #'transparent = ##t
5816         }
5817     }
5818 }
5819 @end lilypond
5820 @tab
5821 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5822 \include "gregorian-init.ly"
5823 \score {
5824     \notes \transpose c c' {
5825         % Scandicus Deminutus
5826         \[ g \pes a \pes \deminutum b \]
5827         s^\markup {"M"}
5828     }
5829     \paper {
5830         interscoreline = 1
5831         \translator {
5832             \ScoreContext
5833             \remove "Bar_number_engraver"
5834         }
5835         \translator {
5836             \StaffContext
5837             \remove "Clef_engraver"
5838             \remove "Key_engraver"
5839             \remove "Staff_symbol_engraver"
5840             \remove "Time_signature_engraver"
5841             \remove "Bar_engraver"
5842             minimumVerticalExtent = ##f
5843         }
5844         \translator {
5845             \VoiceContext
5846             \remove Ligature_bracket_engraver
5847             \consists Vaticana_ligature_engraver
5848             NoteHead \set #'style = #'vaticana_punctum
5849             Stem \set #'transparent = ##t
5850         }
5851     }
5852 }
5853 @end lilypond
5854
5855 @item
5856 @code{15. Salicus}
5857 @tab
5858 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5859 \include "gregorian-init.ly"
5860 \score {
5861     \notes \transpose c c' {
5862         % Salicus
5863         \[ g \oriscus a \pes \virga b \]
5864         s^\markup {"N"}
5865     }
5866     \paper {
5867         interscoreline = 1
5868         \translator {
5869             \ScoreContext
5870             \remove "Bar_number_engraver"
5871         }
5872         \translator {
5873             \StaffContext
5874             \remove "Clef_engraver"
5875             \remove "Key_engraver"
5876             \remove "Staff_symbol_engraver"
5877             \remove "Time_signature_engraver"
5878             \remove "Bar_engraver"
5879             minimumVerticalExtent = ##f
5880         }
5881         \translator {
5882             \VoiceContext
5883             \remove Ligature_bracket_engraver
5884             \consists Vaticana_ligature_engraver
5885             NoteHead \set #'style = #'vaticana_punctum
5886             Stem \set #'transparent = ##t
5887         }
5888     }
5889 }
5890 @end lilypond
5891 @tab
5892 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5893 \include "gregorian-init.ly"
5894 \score {
5895     \notes \transpose c c' {
5896         % Salicus Auctus Descendens
5897         \[ g \oriscus a \pes \auctum \descendens b \]
5898         s^\markup {"O"}
5899     }
5900     \paper {
5901         interscoreline = 1
5902         \translator {
5903             \ScoreContext
5904             \remove "Bar_number_engraver"
5905         }
5906         \translator {
5907             \StaffContext
5908             \remove "Clef_engraver"
5909             \remove "Key_engraver"
5910             \remove "Staff_symbol_engraver"
5911             \remove "Time_signature_engraver"
5912             \remove "Bar_engraver"
5913             minimumVerticalExtent = ##f
5914         }
5915         \translator {
5916             \VoiceContext
5917             \remove Ligature_bracket_engraver
5918             \consists Vaticana_ligature_engraver
5919             NoteHead \set #'style = #'vaticana_punctum
5920             Stem \set #'transparent = ##t
5921         }
5922     }
5923 }
5924 @end lilypond
5925 @tab
5926
5927 @item
5928 @code{16. Trigomus}
5929 @tab
5930 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5931 \include "gregorian-init.ly"
5932 \score {
5933     \notes \transpose c c' {
5934         % Trigonus
5935         \[ \stropha b \stropha b \stropha a \]
5936         s^\markup {"P"}
5937     }
5938     \paper {
5939         interscoreline = 1
5940         \translator {
5941             \ScoreContext
5942             \remove "Bar_number_engraver"
5943         }
5944         \translator {
5945             \StaffContext
5946             \remove "Clef_engraver"
5947             \remove "Key_engraver"
5948             \remove "Staff_symbol_engraver"
5949             \remove "Time_signature_engraver"
5950             \remove "Bar_engraver"
5951             minimumVerticalExtent = ##f
5952         }
5953         \translator {
5954             \VoiceContext
5955             \remove Ligature_bracket_engraver
5956             \consists Vaticana_ligature_engraver
5957             NoteHead \set #'style = #'vaticana_punctum
5958             Stem \set #'transparent = ##t
5959         }
5960     }
5961 }
5962 @end lilypond
5963 @tab
5964 @tab
5965
5966 @end multitable
5967
5968
5969 Unlike most other neumes notation systems, the input language for
5970 neumes does not necessarily reflect directly the typographical
5971 appearance, but is designed to solely focuse on musical meaning.  For
5972 example, @code{\[ a \pes b \flexa g \]} produces a Torculus consisting
5973 of three Punctum heads, while @code{\[ a \flexa g \pes b \]} produces
5974 a torculus with a curved flexa shape and only a single Punctum head.
5975 There is no command to explicitly typeset the curved flexa shape; the
5976 decision of when to typeset a curved flexa shape is purely taken from
5977 the musical input.  The idea of this approach is to separate the
5978 musical aspects of the input from the notation style of the output.
5979 This way, the same input can be reused to typeset the same music in a
5980 different style of Gregorian chant notation such as Hufnagel (also
5981 known as German gothic neumes) or Medicaea (kind of a very simple
5982 forerunner of the Editio Vaticana).  As soon as Hufnagel ligature
5983 engraver and Medicaea ligature engraver will have been implemented, it
5984 will be as simple as replacing the ligature engraver in the
5985 VoiceContext to get the desired notation style from the same input.
5986
5987 The following table shows the code fragments that produce the
5988 ligatures in the above neumes table.  The letter in the first column
5989 in each line of the below table indicates to which ligature in the
5990 above table it refers.  The second column gives the name of the
5991 ligature.  The third column shows the code fragment that produces this
5992 ligature, using @code{g}, @code{a} and @code{b} as example pitches.
5993
5994 @multitable @columnfractions .1 .4 .5
5995
5996 @item
5997 @b{#} @tab
5998 @b{Name} @tab
5999 @b{Input Language} @tab
6000
6001 @item
6002 a @tab
6003 Puctum @tab
6004 @samp{@code{\[ b \]}}
6005
6006 @item
6007 b @tab
6008 Punctum Inclinatum @tab
6009 @samp{@code{\[ \inclinatum b \]}}
6010
6011 @item
6012 c @tab
6013 Punctum Auctum Ascendens @tab
6014 @samp{@code{\[ \auctum \ascendens b \]}}
6015
6016 @item
6017 d @tab
6018 Punctum Auctum Descendens @tab
6019 @samp{@code{\[ \auctum \descendens b \]}}
6020
6021 @item
6022 e @tab
6023 Punctum Inclinatum Auctum @tab
6024 @samp{@code{\[ \inclinatum \auctum b \]}}
6025
6026 @item
6027 f @tab
6028 Punctum Inclinatum Parvum @tab
6029 @samp{@code{\[ \inclinatum \deminutum b \]}}
6030
6031 @item
6032 g @tab
6033 Virga @tab
6034 @samp{@code{\[ \virga b \]}}
6035
6036 @item
6037 h @tab
6038 Stropha @tab
6039 @samp{@code{\[ \stropha b \]}}
6040
6041 @item
6042 i @tab
6043 Stropha Aucta @tab
6044 @samp{@code{\[ \stropha \auctum b \]}}
6045
6046 @item
6047 j @tab
6048 Oriscus @tab
6049 @samp{@code{\[ \oriscus b \]}}
6050
6051 @item
6052 k @tab
6053 Clivis vel Flexa @tab
6054 @samp{@code{\[ b \flexa g \]}}
6055
6056 @item
6057 l @tab
6058 Clivis Aucta Descendens @tab
6059 @samp{@code{\[ b \flexa \auctum \descendens g \]}}
6060
6061 @item
6062 m @tab
6063 Clivis Aucta Ascendens @tab
6064 @samp{@code{\[ b \flexa \auctum \ascendens g \]}}
6065
6066 @item
6067 n @tab
6068 Cephalicus @tab
6069 @samp{@code{\[ b \flexa \deminutum g \]}}
6070
6071 @item
6072 o @tab
6073 Podatus vel Pes @tab
6074 @samp{@code{\[ g \pes b \]}}
6075
6076 @item
6077 p @tab
6078 Pes Auctus Descendens @tab
6079 @samp{@code{\[ g \pes \auctum \descendens b \]}}
6080
6081 @item
6082 q @tab
6083 Pes Auctus Ascendens @tab
6084 @samp{@code{\[ g \pes \auctum \ascendens b \]}}
6085
6086 @item
6087 r @tab
6088 Epiphonus @tab
6089 @samp{@code{\[ g \pes \deminutum b \]}}
6090
6091 @item
6092 s @tab
6093 Pes Quassus @tab
6094 @samp{@code{\[ \oriscus g \pes \virga b \]}}
6095
6096 @item
6097 t @tab
6098 Pes Quassus Auctus Descendens @tab
6099 @samp{@code{\[ \oriscus g \pes \auctum \descendens b \]}}
6100
6101 @item
6102 u @tab
6103 Quilisma Pes @tab
6104 @samp{@code{\[ \quilisma g \pes b \]}}
6105
6106 @item
6107 v @tab
6108 Quilisma Pes Auctus Descendens @tab
6109 @samp{@code{\[ \quilisma g \pes \auctum \descendens b \]}}
6110
6111 @item
6112 w @tab
6113 Pes Initio Debilis @tab
6114 @samp{@code{\[ \deminutum g \pes b \]}}
6115
6116 @item
6117 x @tab
6118 Pes Auctus Descendens Initio Debilis @tab
6119 @samp{@code{\[ \deminutum g \pes \auctum \descendens b \]}}
6120
6121 @item
6122 y @tab
6123 Torculus @tab
6124 @samp{@code{\[ a \pes b \flexa g \]}}
6125
6126 @item
6127 z @tab
6128 Torculus Auctus Descendens @tab
6129 @samp{@code{\[ a \pes b \flexa \auctum \descendens g \]}}
6130
6131 @item
6132 A @tab
6133 Torculus Deminutus @tab
6134 @samp{@code{\[ a \pes b \flexa \deminutum g \]}}
6135
6136 @item
6137 B @tab
6138 Torculus Initio Debilis @tab
6139 @samp{@code{\[ \deminutum a \pes b \flexa g \]}}
6140
6141 @item
6142 C @tab
6143 Torculus Auctus Descendens Initio Debilis @tab
6144 @samp{@code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}}
6145
6146 @item
6147 D @tab
6148 Torculus Deminutus Initio Debilis @tab
6149 @samp{@code{\[ \deminutum a \pes b \flexa \deminutum g \]}}
6150
6151 @item
6152 E @tab
6153 Porrectus @tab
6154 @samp{@code{\[ a \flexa g \pes b \]}}
6155
6156 @item
6157 F @tab
6158 Porrectus Auctus Descendens @tab
6159 @samp{@code{\[ a \flexa g \pes \auctum \descendens b \]}}
6160
6161 @item
6162 G @tab
6163 Porrectus Deminutus @tab
6164 @samp{@code{\[ a \flexa g \pes \deminutum b \]}}
6165
6166 @item
6167 H @tab
6168 Climacus @tab
6169 @samp{@code{\[ \virga b \inclinatum a \inclinatum g \]}}
6170
6171 @item
6172 I @tab
6173 Climacus Auctus @tab
6174 @samp{@code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}}
6175
6176 @item
6177 J @tab
6178 Climacus Deminutus @tab
6179 @samp{@code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}}
6180
6181 @item
6182 K @tab
6183 Scandicus @tab
6184 @samp{@code{\[ g \pes a \virga b \]}}
6185
6186 @item
6187 L @tab
6188 Scandicus Auctus Descendens @tab
6189 @samp{@code{\[ g \pes a \pes \auctum \descendens b \]}}
6190
6191 @item
6192 M @tab
6193 Scandicus Deminutus @tab
6194 @samp{@code{\[ g \pes a \pes \deminutum b \]}}
6195
6196 @item
6197 N @tab
6198 Salicus @tab
6199 @samp{@code{\[ g \oriscus a \pes \virga b \]}}
6200
6201 @item
6202 O @tab
6203 Salicus Auctus Descendens @tab
6204 @samp{@code{\[ g \oriscus a \pes \auctum \descendens b \]}}
6205
6206 @item
6207 P @tab
6208 Trigonus @tab
6209 @samp{@code{\[ \stropha b \stropha b \stropha a \]}}
6210
6211 @end multitable
6212
6213 @refbugs
6214
6215 Use special heads for lower/upper head of Pes only when heads are
6216 stacked.
6217
6218 Scandicus Deminutus: Punctum Auctum Ascendens overlaps with
6219 Semivocalis head; this looks awful.
6220
6221 Trigonus: apply equal spacing, regardless of pitch.
6222
6223 @node Figured bass
6224 @subsection Figured bass
6225
6226 @cindex Basso continuo
6227
6228 @c TODO: musicological blurb about FB
6229
6230 @syntax
6231
6232 LilyPond has limited support for figured bass:
6233
6234 @lilypond[verbatim,fragment]
6235 <
6236  \context Voice \notes { \clef bass dis4  c d ais}
6237  \context FiguredBass
6238    \figures {
6239     < 6 >4 < 7 >8 < 6+ [_!] >
6240     < 6 >4 <6 5 [3+] >
6241    }
6242  >
6243 @end lilypond
6244
6245 The support for figured bass consists of two parts: there is an input
6246 mode, introduced by @code{\figures}, where you can enter bass figures
6247 as numbers, and there is a context called @internalsref{FiguredBass}
6248 that takes care of making @internalsref{BassFigure} objects.
6249
6250 In figures input mode, a group of bass figures is delimited by
6251 @code{<} and @code{>}. The duration is entered after the @code{>}.
6252 @example
6253         <4 6>
6254 @end example
6255 @lilypond[fragment]
6256 \context FiguredBass
6257 \figures { <4 6> }
6258 @end lilypond
6259
6260 Accidentals are added to the numbers if you alterate them by
6261 appending @code{-}, @code{!}  and @code{+}.
6262
6263 @example
6264   <4- 6+ 7!>
6265 @end example
6266 @lilypond[fragment]
6267   \context FiguredBass
6268     \figures { <4- 6+ 7!> }
6269 @end lilypond
6270
6271 Spaces or dashes may be inserted by using @code{_}. Brackets are
6272 introduced with @code{[} and @code{]}.
6273
6274 @example
6275         < [4 6] 8 [_ 12]>
6276 @end example
6277 @lilypond[fragment]
6278  \context FiguredBass
6279 \figures { < [4 6] 8 [_ 12]> }
6280 @end lilypond
6281
6282 Although the support for figured bass may superficially resemble chord
6283 support, it works much simpler.  The @code{\figures} mode simply
6284 stores the numbers , and @internalsref{FiguredBass} context prints
6285 them as entered. There is no conversion to pitches, and no
6286 realizations of the bass are played in the MIDI file.
6287
6288 Internally, the code produces markup texts. You can use any of the
6289 markup text properties to override formatting. For example, the
6290 vertical spacing of the figures may be set with @code{baseline-skip}.
6291
6292 @seealso
6293
6294 @internalsref{BassFigureEvent} music, @internalsref{BassFigure} grob,
6295 @internalsref{FiguredBass} context
6296
6297 @refbugs
6298
6299 Slash notation for alterations is not supported.
6300
6301
6302 @node Contemporary notation
6303 @section Contemporary notation
6304
6305 In the 20th century, composers have greatly expanded the musical
6306 vocabulary. With this expansion, many innovations in musical notation
6307 have been tried. For a comprehensive overview, refer to @cite{Stone
6308 1980} (see @ref{Literature}). In general, the use of new, innovative
6309 notation makes a piece harder to understand and perform and its use
6310 should be avoided if possible.  For this reason, support for
6311 contemporary notation in LilyPond is limited.
6312
6313
6314 @menu
6315 * Clusters::                    
6316 * Fermatas::                    
6317 @end menu
6318
6319 @node Clusters
6320 @subsection Clusters
6321
6322 @cindex cluster
6323
6324 In musical terminology, a @emph{cluster} denotes a range of
6325 simultaneously sounding pitches that may change over time.  The set of
6326 available pitches to apply usually depends on the accoustic source.
6327 Thus, in piano music, a cluster typically consists of a continous range
6328 of the semitones as provided by the piano's fixed set of a chromatic
6329 scale.  In choral music, each singer of the choir typically may sing an
6330 arbitrary pitch within the cluster's range that is not bound to any
6331 diatonic, chromatic or other scale.  In electronic music, a cluster
6332 (theoretically) may even cover a continuous range of pitches, thus
6333 resulting in coloured noise, such as pink noise.
6334
6335 Clusters can be denoted in the context of ordinary staff notation by
6336 engraving simple geometrical shapes that replace ordinary notation of
6337 notes.  Ordinary notes as musical events specify starting time and
6338 duration of pitches; however, the duration of a note is expressed by the
6339 shape of the note head rather than by the horizontal graphical extent of
6340 the note symbol.  In contrast, the shape of a cluster geometrically
6341 describes the development of a range of pitches (vertical extent) over
6342 time (horizontal extent).  Still, the geometrical shape of a cluster
6343 covers the area in wich any single pitch contained in the cluster would
6344 be notated as an ordinary note.  From this point of view, it is
6345 reasonable to specify a cluster as the envelope of a set of notes.
6346
6347 @syntax
6348
6349 A cluster is engraved as the envelope of a set of notes. The starting
6350 note is marked with @code{\startCluster}, and the ending note with
6351 @code{\stopCluster}, e.g.,
6352
6353 @example
6354   c4-\startCluster
6355      ...
6356   f4-\stopCluster 
6357 @end example
6358
6359 The following example (from
6360 @inputfileref{input/regression,cluster.ly}) shows what the result
6361 looks like.
6362
6363 @lilypondfile[notexidoc]{cluster.ly}
6364
6365 By default, @internalsref{Cluster_engraver} is in the
6366 @internalsref{Voice} context.  This allows putting ordinary notes and
6367 clusters together in the same staff, even simultaneously.  In such a
6368 case no attempt is made to automatically avoid collisions between
6369 ordinary notes and clusters.
6370
6371 @seealso
6372
6373 @internalsref{Cluster}, @inputfileref{input/regression,cluster.ly},
6374 @internalsref{Cluster_engraver}, @internalsref{ClusterEvent}.
6375
6376 @refbugs
6377
6378 When a cluster is active, note heads must be switched off manually using
6379 @code{\hideNotes}. 
6380
6381 Music expressions like @code{< @{ g8 e8 @} a4 >} are not printed
6382 accurately.  Use @code{<<g a>>8 <<e a>>8} instead.
6383
6384
6385
6386 @node Fermatas
6387 @subsection Fermatas
6388
6389 @cindex fermatas
6390
6391
6392
6393 Contemporary music notation frequently uses special fermata symbols to
6394 indicate fermatas of differing lengths.
6395
6396 @syntax
6397
6398 The following are supported
6399
6400 @lilypond[singleline]
6401 \score {
6402   <  \notes {
6403         \fatText
6404         b'
6405         ^\shortfermata
6406         _\shortfermata
6407         r
6408         b'
6409         ^\fermata
6410         _\fermata
6411
6412         r
6413         b'
6414         ^\longfermata
6415         _\longfermata
6416
6417         r
6418         b'
6419         ^\verylongfermata
6420         _\verylongfermata
6421         r
6422     }
6423     \context Lyrics \lyrics {
6424       "shortfermata" "fermata"  "longfermata" "verylongfermata"
6425     } >
6426 }
6427 @end lilypond
6428
6429 See @ref{Articulations} for general instructions how to apply scripts
6430 such as fermatas to a @code{\notes@{@}} block.
6431
6432 @node Tuning output
6433 @section Tuning output
6434
6435 There are situations where default layout decisions are not
6436 sufficient.  In this section we discuss ways to override these
6437 defaults.
6438
6439 Formatting is internally done by manipulating so called objects (graphic
6440 objects). Each object carries with it a set of properties (object
6441 properties) specific to that object.  For example, a stem object has
6442 properties that specify its direction, length and thickness.
6443
6444 The most direct way of tuning the output is by altering the values of
6445 these properties. There are two ways of doing that: first, you can
6446 temporarily change the definition of one type of object, thus
6447 affecting a whole set of objects.  Second, you can select one specific
6448 object, and set a object property in that object.
6449
6450 @menu
6451 * Tuning objects ::             
6452 * Applyoutput::                 
6453 * Outputproperty::              
6454 * Font selection::              
6455 * Text markup::                 
6456 @end menu
6457
6458 @node Tuning objects 
6459 @subsection Tuning objects 
6460
6461 @cindex object description
6462
6463 The definition of an object is actually a list of default object
6464 properties. For example, the definition of the Stem object (available
6465 in @file{scm/grob-description.scm}), includes the following definitions for
6466 @internalsref{Stem}
6467
6468 @example
6469         (thickness . 1.3)
6470         (beamed-lengths . (0.0 2.5 2.0 1.5))
6471         (Y-extent-callback . ,Stem::height)
6472         @var{...}
6473 @end example
6474
6475
6476 By adding variables on top of these existing definitions, the system
6477 defaults is overriden, and the appearance of a graphical objects is
6478 altered.
6479
6480 @syntax
6481
6482
6483 Changing a variable for only   one object is commonly achieved with
6484 @code{\once}:
6485
6486 @example
6487 \once \property @var{context}.@var{grobname}
6488   \override @var{symbol} = @var{value}
6489 @end example
6490 Here @var{symbol} is a Scheme expression of symbol type, @var{context}
6491 and @var{grobname} is a string and @var{value} is a Scheme expression.
6492 This command applies a setting only during one moment in the score.
6493
6494 In the following example, only one @internalsref{Stem} object is
6495 changed from its original setting:
6496
6497 @lilypond[verbatim, fragment, relative=1]
6498   c4 
6499   \once \property Voice.Stem \set #'thickness = #4
6500   c4
6501   c4
6502 @end lilypond
6503 @cindex @code{\once}
6504
6505 For changing more objects, the same command, without @code{\once} can
6506 be used.
6507 @example
6508 \property @var{context}.@var{grobname} \override @var{symbol} = @var{value}
6509 @end example
6510 This command adds @code{@var{symbol} = @var{value}} to the definition
6511 of @var{grobname} in the context @var{context}, and this definition
6512 stays in place until it is removed.
6513
6514 An existing definition may be removed by the following command
6515 @c
6516 @example
6517 \property @var{context}.@var{grobname} \revert @var{symbol}
6518 @end example
6519 @c
6520 All @code{\override} and @code{\revert} commands should be balanced.
6521 The @code{\set} shorthand, performs a revert followed by an override,
6522 and is often more convenient to use
6523
6524 @example
6525 \property @var{context}.@var{grobname} \set @var{symbol} = @var{value}
6526 @end example
6527
6528 Some examples: 
6529 @lilypond[verbatim,quote]
6530 c'4 \property Voice.Stem \override #'thickness = #4.0
6531 c'4
6532 c'4 \property Voice.Stem \revert #'thickness
6533 c'4
6534 @end lilypond
6535
6536 The following example gives exactly the same result as the previous
6537 one (assuming the system default for stem thickness is 1.3).
6538 @c
6539 @lilypond[verbatim,quote]
6540   c'4 \property Voice.Stem \set #'thickness = #4.0
6541   c'4
6542   c'4 \property Voice.Stem \set #'thickness = #1.3
6543   c'4
6544 @end lilypond
6545
6546 Reverting a setting which was not set in the first place has no
6547 effect. However, if the setting was set as a system default, this may
6548 remove the default value, and this may give surprising results,
6549 including crashes.  In other words, @code{\override} and
6550 @code{\revert} must be carefully balanced.
6551
6552 These are examples of correct nesting of @code{\override}, @code{\set},
6553 @code{\revert}. 
6554
6555 A clumsy but correct form:
6556 @example
6557   \override \revert \override \revert \override \revert
6558 @end example
6559
6560 Shorter version of the same:
6561 @example 
6562   \override \set \set  \revert
6563 @end example
6564
6565 A short form, using only @code{\set}. This requires you to know the
6566 default value:
6567 @example
6568   \set \set \set \set @var{to default value}
6569 @end example
6570
6571 If there is no default (i.e. by default, the object property is unset),
6572 then you can use
6573 @example
6574   \set \set \set \revert
6575 @end example
6576
6577 For the digirati, the object description is an Scheme association
6578 list. Since a Scheme list is a singly linked list, we can treat it as
6579 a stack, and @code{\override} and @code{\revert} are push and pop
6580 operations.  The association list is stored in a normal context
6581 property, hence
6582 @example
6583  \property Voice.NoteHead  = #'() 
6584 @end example
6585 will effectively erase @internalsref{NoteHead}s from the current
6586 @internalsref{Voice}. However, this mechanism is not guaranteed to
6587 work, and may cause crashes or other anomalous behavior.
6588
6589 @seealso
6590
6591 @internalsref{OverrideProperty}, @internalsref{RevertProperty},
6592 @internalsref{PropertySet}, @internalsref{backend properties},
6593 @internalsref{All Graphical Objects}.
6594
6595
6596 @refbugs
6597
6598 The backend is not very strict in type-checking object properties.
6599 Cyclic references in @var{value} cause hangs and/or crashes.
6600 Similarly, reverting properties that are system defaults may also lead
6601 to crashes.
6602
6603
6604 @node Applyoutput
6605 @subsection Applyoutput
6606
6607 The most versatile way of tuning object is @code{\applyoutput}. Its
6608 syntax is
6609 @example
6610 \applyoutput @var{proc}
6611 @end example
6612 where @var{proc} is a Scheme function, taking four arguments.
6613
6614 When interpreted, the function @var{proc} is called for every grob found
6615 in the context, with the following arguments:
6616 @itemize @bullet
6617 @item the grob itself
6618 @item the context where the grob was created
6619 @item the context where @code{\applyoutput} is processed.
6620 @end itemize
6621
6622 In addition, the cause of the grob, i.e.  the music expression or object
6623 that was responsible for creating the object, is in the object property
6624 @code{cause}.  For example, for a note head, this is a
6625 @internalsref{NoteHead} event, and for a @internalsref{Stem} object,
6626 this is a @internalsref{NoteHead} object.
6627
6628
6629 @node Outputproperty
6630 @subsection Outputproperty
6631
6632 @cindex \outputproperty
6633
6634 Another way of tuning objects is the more arcane @code{\outputproperty}
6635 feature.  The syntax is as follows:
6636 @example
6637 \outputproperty @var{predicate} @var{symbol} = @var{value}
6638 @end example
6639 Here @code{predicate} is a Scheme function taking an object argument, and
6640 returning a boolean.  This statement is processed by the
6641 @code{Output_property_engraver}.  It instructs the engraver to feed all
6642 objects that it sees to @var{predicate}. Whenever the predicate returns
6643 true, the object property @var{symbol} will be set to @var{value}.
6644
6645 You will need to combine this statement with @code{\context} to select
6646 the appropriate context to apply this to.
6647 @inputfileref{input/regression,output-property.ly} shows an example of
6648 the use of @code{\outputproperty}.
6649
6650 @refbugs
6651
6652 If possible, avoid this feature: the semantics are not very clean, and
6653 the syntax and semantics are up for rewrite.
6654
6655
6656 @node Font selection
6657 @subsection Font selection
6658
6659 The most common thing to change about the appearance of fonts is
6660 their size. The font size of any context can be easily
6661 changed by setting the @code{fontSize} property for that context:
6662 @c
6663 @lilypond[fragment,relative=1,verbatim,quote]
6664   c4 c4 \property Voice.fontSize = #-1
6665   f4 g4
6666 @end lilypond
6667  This command will set @code{font-relative-size} (see below),
6668  and does not change the size of variable symbols, such as
6669 beams or slurs.  You can use this command to get smaller symbol for
6670 cue notes, but that involves some more subtleties. An elaborate
6671 example of those is in @inputfileref{input/test,cue-notes.ly}.
6672
6673 @cindex magnification
6674
6675 The size of the font may be scaled with the object property
6676 @code{font-magnification}.  For example, @code{2.0} blows up all
6677 letters by a factor 2 in both directions.
6678
6679
6680 @cindex cue notes
6681 @cindex font size
6682 @cindex size
6683 @cindex symbol size
6684 @cindex glyph size
6685
6686 The font used for printing a object can be selected by setting
6687 @code{font-name}, e.g.
6688 @example
6689   \property Staff.TimeSignature
6690     \set #'font-name = #"cmr17"
6691 @end example
6692 You may use any font which is available to @TeX{}, such as foreign
6693 fonts or fonts that do not belong to the Computer Modern font family.
6694
6695 Font selection for the standard fonts, @TeX{}'s Computer Modern fonts,
6696 can also be adjusted with a more fine-grained mechanism.  By setting
6697 the object properties described below, you can select a different font.
6698 All three mechanisms work for every object that supports
6699 @code{font-interface}.
6700
6701 @table @code
6702 @item font-family
6703  A symbol indicating the general class of the typeface.  Supported are
6704 @code{roman} (Computer Modern), @code{braces} (for piano staff
6705 braces), @code{music} (the standard music font, including ancient
6706 glyphs), @code{dynamic} (for dynamic signs) and @code{typewriter}.
6707   
6708 @item font-shape
6709   A symbol indicating the shape of the font, there are typically several
6710   font shapes available for each font family. Choices are @code{italic},
6711   @code{caps} and @code{upright} 
6712
6713 @item font-series
6714 A  symbol indicating the series of the font. There are typically several
6715 font series for each font family and shape. Choices are @code{medium}
6716 and @code{bold}. 
6717
6718 @item font-relative-size
6719   A number indicating the size relative the standard size.  For example,
6720   with 20pt staff height, relative size -1  corresponds to 16pt staff
6721   height, and relative size +1 corresponds to 23 pt staff height.
6722
6723    There are small differences in design between fonts designed for
6724 different sizes, hence @code{font-relative-size} is preferred over
6725 @code{font-magnification} for changing font sizes.
6726
6727
6728 @item font-design-size
6729 A number indicating  the design size of the font. 
6730
6731 This is a feature of the Computer Modern Font: each point size has a
6732 slightly different design. Smaller design sizes are relatively wider,
6733 which enhances readability.
6734 @end table
6735
6736 For any of these properties, the value @code{*} (i.e. the symbol
6737 @code{*}, entered as @code{#'*}), acts as a wildcard. This can be used
6738 to override default setting, which are always present. For example:
6739 @example
6740   \property Lyrics.LyricText \override #'font-series = #'bold
6741   \property Lyrics.LyricText \override #'font-family = #'typewriter
6742   \property Lyrics.LyricText \override #'font-shape  = #'*
6743 @end example
6744
6745 @cindex @code{font-style}
6746
6747
6748
6749 @refbugs
6750
6751 Relative size is not linked to any real size.
6752
6753 There is no style sheet provided for other fonts besides the @TeX{}
6754 family, and the style sheet cannot be modified easily.
6755
6756 @cindex font selection
6757 @cindex font magnification
6758 @cindex @code{font-interface}
6759
6760
6761 @node Text markup
6762 @subsection Text markup
6763 @cindex text markup
6764 @cindex markup text
6765
6766
6767 @cindex typeset text
6768
6769 LilyPond has an internal mechanism to typeset texts. You can access it
6770 with the keyword @code{\markup}. Within markup mode, you can enter texts
6771 similar to lyrics: simply enter them, surrounded by spaces. 
6772 @cindex markup
6773
6774 @lilypond[verbatim,fragment,relative=1]
6775  c1^\markup { hello }
6776  c1_\markup { hi there }
6777  c1^\markup { hi \bold there, is \italic anyone home? }
6778 @end lilypond
6779
6780 @cindex font switching
6781
6782 The line of the example demonstrates font switching commands.  The
6783 command only apply to the first following word; enclose a set of texts
6784 with braces to apply a command to more words.
6785 @example
6786   \markup @{ \bold @{ hi there @} @}
6787 @end example
6788 For clarity, you can also do this for single arguments, e.g.
6789 @example
6790   \markup @{ is \italic @{ anyone @} home @}
6791 @end example
6792
6793 @cindex font size, texts
6794
6795 The following size commands set abolute sizes
6796
6797 @cindex \teeny
6798 @cindex \tiny
6799 @cindex \small
6800 @cindex \large
6801 @cindex \huge
6802
6803 @table @code
6804 @item \teeny
6805 @item \tiny
6806 @item \small
6807 @item \large
6808 @item \huge
6809 @end table
6810
6811 You can also make letter larger or smaller relative to their neighbors,
6812 with the commands @code{\larger} and @code{\smaller}.
6813 @cindex smaller
6814 @cindex larger
6815
6816 @cindex font style, for texts
6817 @cindex \bold
6818 @cindex \dynamic
6819 @cindex \number
6820 @cindex \italic
6821
6822 The following font change commands are defined:
6823 @table @code
6824 @item \dynamic
6825 This changes to the font used for dynamic signs.  This font does not
6826 contain all characters of the alphabet, so when producing ``piu f'',
6827 the ``piu'' should be done in a different font.
6828
6829
6830 @item \number
6831 This changes to the font used for time signatures. It only contains
6832 numbers and a few punctuation marks.
6833 @item \italic
6834 Changes @code{font-shape} to @code{italic}
6835 @item \bold
6836 Changes @code{font-series} to @code{bold}
6837 @end table
6838
6839 @cindex raising text
6840 @cindex lowering text
6841 @cindex moving text
6842 @cindex translating text
6843
6844 @cindex \sub
6845 @cindex \super
6846
6847 Raising and lowering texts can be done with @code{\super} and
6848 @code{\sub}.
6849
6850 @lilypond[verbatim,fragment,relative=1]
6851  c1^\markup { E "=" mc \super "2" }
6852 @end lilypond
6853
6854 @cindex \raise
6855
6856 If you want to give an explicit amount for lowering or raising, use
6857 @code{\raise}.  This command takes a Scheme valued first argument, and
6858 a markup object as second argument
6859 @c
6860 @lilypond[verbatim,fragment,relative=1,quote]
6861  c1^\markup { C \small \raise #1.0 \bold { "9/7+" }}
6862 @end lilypond
6863 The argument to @code{\raise} is the vertical displacement amount,
6864 measured in (global) staff spaces.
6865
6866 Other commands taking  single arguments include
6867 @table @code
6868
6869 @item \bracket, \hbracket
6870  Bracket the argument markup with normal and horizontal brackets
6871 respectively.
6872
6873 @item \musicglyph
6874 @cindex \musicglyph
6875   This is converted to a musical symbol, e.g. @code{\musicglyph
6876 #"accidentals-0"} will select the natural sign from the music font.
6877 See @ref{The Feta font} for  a complete listing of the possible glyphs.
6878 @item \char
6879 This produces a single character, e.g. @code{\char #65} produces the 
6880 letter 'A'.
6881
6882 @item \hspace #@var{amount}
6883 @cindex \hspace
6884 This produces a invisible object taking horizontal space.
6885 @example 
6886 \markup @{ A \hspace #2.0 B @} 
6887 @end example
6888 will put extra space between A and B, on top of the space that is
6889 normally inserted before elements on a line.
6890
6891 @item \fontsize #@var{size}
6892 @cindex \fontsize
6893 This sets the relative font size, eg.
6894 @example
6895 A \fontsize #2 @{ B C @} D
6896 @end example
6897
6898
6899 This will enlarge the B and the C by two steps.
6900 @item  \translate #(cons @var{x} @var{y})
6901 @cindex  \translate
6902 This translates an object. Its first argument is a cons of numbers
6903 @example
6904 A \translate #(cons 2 -3) @{ B C @} D
6905 @end example
6906 This moves `B C' 2 spaces to the right, and 3 down.
6907
6908 @item \magnify  #@var{mag}
6909 @cindex \magnify
6910 This sets the font magnification for the its argument. In the following
6911 example, the middle A will be 10% larger.
6912 @example
6913 A \magnify #1.1 @{ A @} A
6914 @end example
6915
6916
6917 @item \override #(@var{key} . @var{value})
6918 @cindex \override
6919 This overrides a  formatting property for its argument. The argument
6920 should be a key/value pair, e.g.
6921 @example
6922 m \override #'(font-family . math) m m
6923 @end example
6924 @end table
6925
6926 In markup mode you can compose expressions, similar to mathematical
6927 expressions, XML documents and music expressions.  The braces group
6928 notes into horizontal lines. Other types of lists also exist: you can
6929 stack expressions grouped with @code{<<}, and @code{>>} vertically with
6930 the command @code{\column}. Similarly, @code{\center} aligns texts by
6931 their center lines. 
6932
6933 @lilypond[verbatim,fragment,relative=1]
6934  c1^\markup { \column << a bbbb c >> }
6935  c1^\markup { \center << a bbbb c >> }
6936  c1^\markup { \line << a b c >> }
6937 @end lilypond
6938
6939 The markup mechanism is extensible.  Refer to
6940 @file{scm/new-markup.scm} for more information on extending the markup
6941 mode.
6942
6943
6944
6945 @seealso
6946
6947 @internalsref{Markup functions}, @file{scm/new-markup.scm}
6948
6949 @refbugs
6950
6951 @cindex kerning
6952
6953
6954 Text layout is ultimately done by @TeX{}, which does kerning of
6955 letters.  LilyPond does not account for kerning, so texts will be
6956 spaced slightly too wide.
6957
6958 Syntax errors for markup mode are confusing.
6959
6960
6961 @node Global layout
6962 @section Global layout
6963
6964 The global layout determined by three factors: the page layout, the
6965 line breaks and the spacing. These all influence each other. The
6966 choice of spacing determines how densely each system of music is set,
6967 which influences where line breaks breaks are chosen, and thus
6968 ultimately how many pages a piece of music takes. In this section, the
6969 algorithm for spacing music is explained, and how spacing can be
6970 tuned.
6971
6972 Globally spoken, this procedure happens in three steps: first,
6973 flexible distances (``springs'') are chosen, based on durations. All
6974 possible line breaking combination are tried, and the one with the
6975 best results---a layout that has uniform density and requires as
6976 little stretching or cramping as possible---is chosen. When the score
6977 is processed by @TeX{}, each page is filled with systems, and page breaks
6978 are chosen whenever the page gets full.
6979
6980
6981
6982 @menu
6983 * Vertical spacing::            
6984 * Horizontal spacing::          
6985 * Font Size::                   
6986 * Line breaking::               
6987 * Page layout::                 
6988 @end menu
6989
6990
6991 @node Vertical spacing
6992 @subsection Vertical spacing
6993
6994 @cindex vertical spacing
6995 @cindex distance between staves
6996 @cindex staff distance
6997 @cindex between staves, distance
6998 @cindex staffs per page
6999
7000
7001 The height of each system is determined automatically by lilypond, to
7002 keep systems from bumping into each other, some minimum distances are
7003 set.  By changing these, you can put staves closer together, and thus
7004 put more  systems onto one page.
7005
7006 Normally staves are stacked vertically. To make
7007 staves maintain a distance, their vertical size is padded. This is
7008 done with the property @code{minimumVerticalExtent}. It takes a pair
7009 of numbers, so if you want to make it smaller from its, then you could
7010 set
7011 @example
7012   \property Staff.minimumVerticalExtent = #'(-4 . 4)
7013 @end example
7014 This sets the vertical size of the current staff to 4 staff-space on
7015 either side of the center staff line.  The argument of
7016 @code{minimumVerticalExtent} is interpreted as an interval, where the
7017 center line is the 0, so the first number is generally negative.  The
7018 staff can be made larger at the bottom by setting it to @code{(-6
7019 . 4)}.
7020
7021 The piano staves are handled a little differently: to make cross-staff
7022 beaming work correctly, it necessary that the distance between staves
7023 is fixed beforehand.  This is also done with a
7024 @internalsref{VerticalAlignment} object, created in
7025 @internalsref{PianoStaff}. In this object the distance between the
7026 staves is fixed by setting @code{forced-distance}. If you want to
7027 override this, use a @code{\translator} block as follows:
7028 @example
7029   \translator @{
7030     \PianoStaffContext
7031     VerticalAlignment \override #'forced-distance = #9
7032   @}
7033 @end example
7034 This would bring the staves together at a distance of 9 staff spaces,
7035 measured from the center line of each staff.
7036
7037 @seealso
7038
7039 Vertical aligment of staves is handled by the
7040 @internalsref{VerticalAlignment} object.
7041
7042
7043
7044 @node Horizontal spacing
7045 @subsection Horizontal Spacing
7046
7047 The spacing engine translates differences in durations into
7048 stretchable distances (``springs'') of differing lengths. Longer
7049 durations get more space, shorter durations get less.  The shortest
7050 durations get a fixed amount of space (which is controlled by
7051 @code{shortest-duration-space} in the @internalsref{SpacingSpanner}
7052 object). The longer the duration, the more space it gets: doubling a
7053 duration adds a fixed amount (this amount is controlled by
7054 @code{spacing-increment}) of space to the note.
7055
7056 For example, the following piece contains lots of half, quarter and
7057 8th notes, the eighth note is followed by 1 note head width (NHW). 
7058 The quarter note is followed by 2 NHW, the half by 3 NHW, etc.
7059 @lilypond[fragment, verbatim, relative=1] c2 c4. c8 c4. c8 c4. c8 c8
7060 c8 c4 c4 c4
7061 @end lilypond
7062
7063 Normally, @code{shortest-duration-space} is set to 1.2, which is the
7064 width of a note head, and @code{shortest-duration-space} is set to
7065 2.0, meaning that the shortest note gets 2 NHW (2 times
7066 @code{shortest-duration-space}) of space. For normal notes, this space
7067 is always counted from the left edge of the symbol, so the shortest
7068 notes are generally followed by one NHW of space.
7069
7070 If one would follow the above procedure exactly, then adding a single
7071 32th note to a score that uses 8th and 16th notes, would widen up the
7072 entire score a lot. The shortest note is no longer a 16th, but a 32nd,
7073 thus adding 2 noteheads of space to every note. To prevent this, the
7074 shortest duration for spacing is not the shortest note in the score,
7075 but the most commonly found shortest note.  Notes that are even
7076 shorter this are followed by a space that is proportonial to their
7077 duration relative to the common shortest note.  So if we were to add
7078 only a few 16th notes to the example above, they would be followed by
7079 half a NHW:
7080
7081 @lilypond[fragment, verbatim, relative=2]
7082  c2 c4. c8 c4. c16-[ c-] c4. c8 c8 c8 c4 c4 c4
7083 @end lilypond
7084
7085 The most common shortest duration is determined as follows: in every
7086 measure, the shortest duration is determined. The most common short
7087 duration, is taken as the basis for the spacing, with the stipulation
7088 that this shortest duration should always be equal to or shorter than
7089 1/8th note. The shortest duration is printed when you run lilypond
7090 with @code{--verbose}.  These durations may also be customized. If you
7091 set the @code{common-shortest-duration} in
7092 @internalsref{SpacingSpanner}, then this sets the base duration for
7093 spacing. The maximum duration for this base (normally 1/8th), is set
7094 through @code{base-shortest-duration}.
7095
7096 @cindex @code{common-shortest-duration}
7097 @cindex @code{base-shortest-duration}
7098 @cindex @code{stem-spacing-correction}
7099 @cindex @code{spacing}
7100
7101 In the introduction it was explained that stem directions influence
7102 spacing. This is controlled with @code{stem-spacing-correction}
7103 property in @internalsref{NoteSpacing}, which are generated for every
7104 @internalsref{Voice} context. The @code{StaffSpacing} object
7105 (generated at @internalsref{Staff} context) contains the same property
7106 for controlling the stem/barline spacing. The following example
7107 shows these corrections, once with default settings, and once with
7108 exaggerated corrections.
7109
7110 @lilypond
7111     \score { \notes {
7112       c'4 e''4 e'4 b'4 |
7113       b'4 e''4 b'4 e''4|
7114       \property Staff.NoteSpacing \override #'stem-spacing-correction
7115       = #1.5
7116       \property Staff.StaffSpacing \override #'stem-spacing-correction
7117       = #1.5
7118       c'4 e''4 e'4 b'4 |
7119       b'4 e''4 b'4 e''4|      
7120     }
7121     \paper { raggedright = ##t } }
7122 @end lilypond
7123
7124 @cindex SpacingSpanner, overriding properties
7125
7126 Properties of the  @internalsref{SpacingSpanner} must be overriden
7127 from the @code{\paper} block, since the @internalsref{SpacingSpanner}
7128 is created before any @code{\property} statements are interpreted.
7129 @example
7130 \paper @{ \translator  @{
7131   \ScoreContext
7132   SpacingSpanner \override #'spacing-increment = #3.0
7133 @} @}
7134 @end example
7135
7136
7137 @seealso
7138
7139 @internalsref{SpacingSpanner}, @internalsref{NoteSpacing},
7140 @internalsref{StaffSpacing}, @internalsref{SeparationItem},
7141 @internalsref{SeparatingGroupSpanner}.
7142
7143 @refbugs
7144
7145 Spacing is determined on a score wide basis. If you have a score that
7146 changes its character (measured in durations) halfway during the
7147 score, the part containing the longer durations will be spaced too
7148 widely.
7149
7150 There is no convenient mechanism to manually override spacing.
7151
7152
7153
7154 @node Font Size
7155 @subsection Font size
7156 @cindex font size, setting
7157 @cindex staff size, setting
7158 @cindex @code{paper} file
7159
7160 The Feta font provides musical symbols at seven different sizes.
7161 These fonts are 11 point, 13 point, 16 point, 20 point, 23 point, and
7162 26 point.  The point size of a font is the height of the corresponding
7163 staff (excluding line thicknesses).
7164
7165 Definitions for these sizes are the files @file{paperSZ.ly}, where
7166 @code{SZ} is one of 11, 13, 16, 20, 23 and 26.  If you include any
7167 of these files, the variables @code{paperEleven},
7168 @code{paperThirteen}, @code{paperSixteen}, 
7169 @code{paperTwenty}, @code{paperTwentythree}, and @code{paperTwentysix}
7170 are defined respectively.  The default @code{\paper} block is also
7171 set. These files should be imported at toplevel, i.e.
7172 @example
7173         \include "paper26.ly"
7174         \score @{  ... @}
7175 @end example
7176
7177 The font definitions are generated using a Scheme function. For more
7178 details, see the file @file{scm/font.scm}.
7179
7180
7181
7182 @node Line breaking
7183 @subsection Line breaking
7184
7185 @cindex line breaks
7186 @cindex breaking lines
7187
7188 Line breaks are normally computed automatically. They are chosen such
7189 that lines look neither cramped nor loose, and that consecutive lines
7190 have similar density.
7191
7192 Occasionally you might want to override the automatic breaks; you can
7193 do this by  specifying @code{\break}. This will force a line break at
7194 this point.  Line breaks can only occur at places where there are bar
7195 lines.  If you want to have a line break where there is no bar line,
7196 you can force an invisible bar line by entering @code{\bar
7197 ""}. Similarly, @code{\noBreak} forbids a line break at a 
7198 point.
7199
7200
7201 @cindex regular line breaks
7202 @cindex four bar music. 
7203
7204 If you want linebreaks at regular intervals, you can use the following:
7205 @example
7206 <  \repeat unfold 7 @{ s1 * 4 \break  @}
7207    @emph{the real music}
7208
7209 @end  example
7210 This makes the following 28 measures (assuming 4/4 time) be broken every
7211 4 measures.
7212
7213 @seealso
7214
7215 @internalsref{BreakEvent}
7216
7217
7218 @node Page layout
7219 @subsection Page layout
7220
7221 @cindex page breaks
7222 @cindex breaking pages
7223
7224 @cindex @code{indent}
7225 @cindex @code{linewidth}
7226
7227 The most basic settings influencing the spacing are @code{indent} and
7228 @code{linewidth}. They are set in the @code{\paper} block. They
7229 control the indentation of the first line of music, and the lengths of
7230 the lines.
7231
7232 If  @code{raggedright} is set to true in the @code{\paper}
7233 block, then the lines are justified at their natural length. This
7234 useful for short fragments, and for checking how tight the natural
7235 spacing is.
7236
7237 @cindex page layout
7238 @cindex vertical spacing
7239
7240 The page layout process happens outside the LilyPond formatting
7241 engine: variables controlling page layout are passed to the output,
7242 and are further interpreted by @code{ly2dvi}. @code{ly2dvi} responds
7243 to the following variables in the @code{\paper} block.  The variable
7244 @code{textheight} sets the total height of the music on each page.
7245 The spacing between systems is controlled with @code{interscoreline},
7246 its default is 16pt.  The distance between the score lines will
7247 stretch in order to fill the full page @code{interscorelinefill} is
7248 set to a positive number.  In that case @code{interscoreline}
7249 specifies the minimum spacing.
7250
7251 @cindex @code{textheight}
7252 @cindex @code{interscoreline}
7253 @cindex @code{interscorelinefill}
7254
7255 If the variable @code{lastpagefill} is defined,
7256 @c fixme: this should only be done if lastpagefill == #t 
7257 systems are evenly distributed vertically on the last page.  This
7258 might produce ugly results in case there are not enough systems on the
7259 last page.  The @command{lilypond-book} command ignores
7260 @code{lastpagefill}.  See @ref{lilypond-book manual} for more
7261 information.
7262
7263 @cindex @code{lastpagefill}
7264
7265 Page breaks are normally computed by @TeX{}, so they are not under
7266 direct control of LilyPond.  However, you can insert a commands into
7267 the @file{.tex} output to instruct @TeX{} where to break pages.  This
7268 is done by setting the @code{between-systems-strings} on the
7269 @internalsref{NonMusicalPaperColumn} where the system is broken.
7270 An example is shown in @inputfileref{input/regression,between-systems.ly}.
7271
7272 @cindex paper size
7273 @cindex page size
7274 @cindex @code{papersize}
7275
7276 To change the paper size, you must first set the
7277 @code{papersize} paper variable variable.  Set it to
7278 the strings @code{a4}, @code{letter}, or @code{legal}.  After this
7279 specification, you must set the font as described above.  If you want
7280 the default font, then use the 20 point font.
7281
7282 @example
7283         \paper@{ papersize = "a4" @}
7284         \include "paper16.ly"
7285 @end example
7286
7287 The file @code{paper16.ly}  will now include a file named @file{a4.ly}, which
7288 will set the paper variables @code{hsize} and @code{vsize} (used by
7289 Lilypond and @code{ly2dvi})
7290
7291
7292 @seealso
7293
7294 @ref{Invoking ly2dvi},
7295 @inputfileref{input/regression,between-systems.ly},
7296 @internalsref{NonMusicalPaperColumn}.
7297
7298 @refbugs
7299
7300 There is no concept of page breaking, which makes it difficult to
7301 choose sensible page breaks in multi-page pieces.
7302
7303
7304
7305
7306 @node Sound
7307 @section Sound
7308 @cindex Sound
7309
7310 Entered music can also be converted to MIDI output.  The performance
7311 is good enough for proof-hearing the music for errors.
7312
7313
7314 Ties, dynamics and tempo changes are interpreted.  Dynamic marks,
7315 crescendi and decrescendi translate into MIDI volume levels.  Dynamic
7316 marks translate to a fixed fraction of the available MIDI volume
7317 range, crescendi and decrescendi make the volume vary linearly
7318 between their two extremities.  The fractions be adjusted by
7319 @code{dynamicAbsoluteVolumeFunction} in @internalsref{Voice} context.
7320
7321 For each type of musical instrument (that MIDI supports), a volume range
7322 can be defined.  This gives you basic equalizer control, which can
7323 enhance the quality of the MIDI output remarkably.  The equalizer
7324 can be controlled by setting @code{instrumentEqualizer}.
7325
7326 Both loudness controls are combined to produce the final  MIDI volume. 
7327
7328 @refbugs
7329
7330 Many musically interesting effects, such as swing, articulation,
7331 slurring, etc., are translated to MIDI.
7332
7333
7334 @menu
7335 * MIDI block::                  
7336 * MIDI instrument names::       
7337 @end menu
7338
7339
7340 @node MIDI block
7341 @subsection MIDI block
7342 @cindex MIDI block
7343
7344
7345 The MIDI block is analogous to the paper block, but it is somewhat
7346 simpler.  The @code{\midi} block can contain:
7347 @cindex MIDI block
7348
7349 @itemize @bullet
7350   @item  a @code{\tempo} definition
7351   @item  context definitions
7352 @end itemize
7353
7354 Assignments in the @code{\midi} block are not allowed.
7355
7356
7357
7358 @cindex context definition
7359
7360 Context definitions follow precisely the same syntax as within the
7361 \paper block.  Translation modules for sound are called performers.
7362 The contexts for MIDI output are defined in @file{ly/performer-init.ly}.
7363
7364
7365 @node MIDI instrument names
7366 @subsection MIDI instrument names
7367
7368 @cindex instrument names
7369 @cindex @code{Staff.midiInstrument}
7370 @cindex @code{Staff.instrument}
7371
7372 The MIDI instrument name is set by the @code{Staff.midiInstrument}
7373 property or, if that property is not set, the @code{Staff.instrument}
7374 property.  The instrument name should be chosen from the list in
7375 @ref{MIDI instruments}.
7376
7377 @refbugs
7378
7379 If the selected string does not exactly match, then LilyPond uses the
7380 default (Grand Piano). It is not possible to select an instrument by
7381 number.
7382
7383