]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/refman.itely
* Documentation/user/refman.itely,
[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 namess
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.  The following table contains the extended neumes
4607 table of the 2nd volume of the Antiphonale Romanum (@emph{Liber
4608 Hymnarius}), published 1983 by the monks of Solesmes.
4609
4610 @multitable @columnfractions  .4 .2 .2 .2
4611
4612 @item
4613 @b{Neuma aut@*Neumarum Elementa} @tab
4614 @b{Figurae@*Rectae} @tab
4615 @b{Figurae@*Liquescentes Auctae} @tab
4616 @b{Figurae@*Liquescentes Deminutae}
4617
4618 @c TODO: \paper block is identical in all of the below examples.
4619 @c Therefore, it should somehow be included rather than duplicated all
4620 @c the time.
4621
4622 @item
4623 @code{1. Punctum} @tab
4624 @lilypond[noindent, 26pt, nofragment, linewidth=1.5cm]
4625 \include "gregorian-init.ly"
4626 \score {
4627     \notes \transpose c c' {
4628         % Puctum
4629         \[ b \]
4630
4631         % Punctum Inclinatum
4632         \[ \inclinatum b \]
4633     }
4634     \paper {
4635         interscoreline = 1
4636         \translator {
4637             \ScoreContext
4638             \remove "Bar_number_engraver"
4639         }
4640         \translator {
4641             \StaffContext
4642             \remove "Clef_engraver"
4643             \remove "Key_engraver"
4644             \remove "Staff_symbol_engraver"
4645             \remove "Time_signature_engraver"
4646             \remove "Bar_engraver"
4647             minimumVerticalExtent = ##f
4648         }
4649         \translator {
4650             \VoiceContext
4651             \remove Ligature_bracket_engraver
4652             \consists Vaticana_ligature_engraver
4653             NoteHead \set #'style = #'vaticana_punctum
4654             Stem \set #'transparent = ##t
4655         }
4656     }
4657 }
4658 @end lilypond @tab
4659 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4660 \include "gregorian-init.ly"
4661 \score {
4662     \notes \transpose c c' {
4663         % Punctum Auctum Ascendens
4664         \[ \auctum \ascendens b \]
4665
4666         % Punctum Auctum Descendens
4667         \[ \auctum \descendens b \]
4668
4669         % Punctum Inclinatum Auctum
4670         \[ \inclinatum \auctum b \]
4671     }
4672     \paper {
4673         interscoreline = 1
4674         \translator {
4675             \ScoreContext
4676             \remove "Bar_number_engraver"
4677         }
4678         \translator {
4679             \StaffContext
4680             \remove "Clef_engraver"
4681             \remove "Key_engraver"
4682             \remove "Staff_symbol_engraver"
4683             \remove "Time_signature_engraver"
4684             \remove "Bar_engraver"
4685             minimumVerticalExtent = ##f
4686         }
4687         \translator {
4688             \VoiceContext
4689             \remove Ligature_bracket_engraver
4690             \consists Vaticana_ligature_engraver
4691             NoteHead \set #'style = #'vaticana_punctum
4692             Stem \set #'transparent = ##t
4693         }
4694     }
4695 }
4696 @end lilypond @tab
4697 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4698 \include "gregorian-init.ly"
4699 \score {
4700     \notes \transpose c c' {
4701         % Punctum Inclinatum Parvum
4702         \[ \inclinatum \deminutum b \]
4703     }
4704     \paper {
4705         interscoreline = 1
4706         \translator {
4707             \ScoreContext
4708             \remove "Bar_number_engraver"
4709         }
4710         \translator {
4711             \StaffContext
4712             \remove "Clef_engraver"
4713             \remove "Key_engraver"
4714             \remove "Staff_symbol_engraver"
4715             \remove "Time_signature_engraver"
4716             \remove "Bar_engraver"
4717             minimumVerticalExtent = ##f
4718         }
4719         \translator {
4720             \VoiceContext
4721             \remove Ligature_bracket_engraver
4722             \consists Vaticana_ligature_engraver
4723             NoteHead \set #'style = #'vaticana_punctum
4724             Stem \set #'transparent = ##t
4725         }
4726     }
4727 }
4728 @end lilypond
4729
4730 @item
4731 @code{2. Virga} @tab
4732 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4733 \include "gregorian-init.ly"
4734 \score {
4735     \notes \transpose c c' {
4736         % Virga
4737         \[ \virga b \]
4738     }
4739     \paper {
4740         interscoreline = 1
4741         \translator {
4742             \ScoreContext
4743             \remove "Bar_number_engraver"
4744         }
4745         \translator {
4746             \StaffContext
4747             \remove "Clef_engraver"
4748             \remove "Key_engraver"
4749             \remove "Staff_symbol_engraver"
4750             \remove "Time_signature_engraver"
4751             \remove "Bar_engraver"
4752             minimumVerticalExtent = ##f
4753         }
4754         \translator {
4755             \VoiceContext
4756             \remove Ligature_bracket_engraver
4757             \consists Vaticana_ligature_engraver
4758             NoteHead \set #'style = #'vaticana_punctum
4759             Stem \set #'transparent = ##t
4760         }
4761     }
4762 }
4763 @end lilypond @tab @tab
4764
4765 @item
4766 @code{3. Apostropha vel Stropha} @tab
4767 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4768 \include "gregorian-init.ly"
4769 \score {
4770     \notes \transpose c c' {
4771         % Stropha
4772         \[ \stropha b \]
4773     }
4774     \paper {
4775         interscoreline = 1
4776         \translator {
4777             \ScoreContext
4778             \remove "Bar_number_engraver"
4779         }
4780         \translator {
4781             \StaffContext
4782             \remove "Clef_engraver"
4783             \remove "Key_engraver"
4784             \remove "Staff_symbol_engraver"
4785             \remove "Time_signature_engraver"
4786             \remove "Bar_engraver"
4787             minimumVerticalExtent = ##f
4788         }
4789         \translator {
4790             \VoiceContext
4791             \remove Ligature_bracket_engraver
4792             \consists Vaticana_ligature_engraver
4793             NoteHead \set #'style = #'vaticana_punctum
4794             Stem \set #'transparent = ##t
4795         }
4796     }
4797 }
4798 @end lilypond @tab
4799 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4800 \include "gregorian-init.ly"
4801 \score {
4802     \notes \transpose c c' {
4803         % Stropha Aucta
4804         \[ \stropha \auctum b \]
4805     }
4806     \paper {
4807         interscoreline = 1
4808         \translator {
4809             \ScoreContext
4810             \remove "Bar_number_engraver"
4811         }
4812         \translator {
4813             \StaffContext
4814             \remove "Clef_engraver"
4815             \remove "Key_engraver"
4816             \remove "Staff_symbol_engraver"
4817             \remove "Time_signature_engraver"
4818             \remove "Bar_engraver"
4819             minimumVerticalExtent = ##f
4820         }
4821         \translator {
4822             \VoiceContext
4823             \remove Ligature_bracket_engraver
4824             \consists Vaticana_ligature_engraver
4825             NoteHead \set #'style = #'vaticana_punctum
4826             Stem \set #'transparent = ##t
4827         }
4828     }
4829 }
4830 @end lilypond @tab
4831
4832 @item
4833 @code{4. Oriscus} @tab
4834 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4835 \include "gregorian-init.ly"
4836 \score {
4837     \notes \transpose c c' {
4838         % Oriscus
4839         \[ \oriscus b \]
4840     }
4841     \paper {
4842         interscoreline = 1
4843         \translator {
4844             \ScoreContext
4845             \remove "Bar_number_engraver"
4846         }
4847         \translator {
4848             \StaffContext
4849             \remove "Clef_engraver"
4850             \remove "Key_engraver"
4851             \remove "Staff_symbol_engraver"
4852             \remove "Time_signature_engraver"
4853             \remove "Bar_engraver"
4854             minimumVerticalExtent = ##f
4855         }
4856         \translator {
4857             \VoiceContext
4858             \remove Ligature_bracket_engraver
4859             \consists Vaticana_ligature_engraver
4860             NoteHead \set #'style = #'vaticana_punctum
4861             Stem \set #'transparent = ##t
4862         }
4863     }
4864 }
4865 @end lilypond @tab @tab
4866
4867 @item
4868 @code{5. Clivis vel Flexa} @tab
4869 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4870 \include "gregorian-init.ly"
4871 \score {
4872     \notes \transpose c c' {
4873         % Clivis vel Flexa
4874         \[ b \flexa g \]
4875     }
4876     \paper {
4877         interscoreline = 1
4878         \translator {
4879             \ScoreContext
4880             \remove "Bar_number_engraver"
4881         }
4882         \translator {
4883             \StaffContext
4884             \remove "Clef_engraver"
4885             \remove "Key_engraver"
4886             \remove "Staff_symbol_engraver"
4887             \remove "Time_signature_engraver"
4888             \remove "Bar_engraver"
4889             minimumVerticalExtent = ##f
4890         }
4891         \translator {
4892             \VoiceContext
4893             \remove Ligature_bracket_engraver
4894             \consists Vaticana_ligature_engraver
4895             NoteHead \set #'style = #'vaticana_punctum
4896             Stem \set #'transparent = ##t
4897         }
4898     }
4899 }
4900 @end lilypond @tab
4901 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4902 \include "gregorian-init.ly"
4903 \score {
4904     \notes \transpose c c' {
4905         % Clivis Aucta Descendens
4906         \[ b \flexa \auctum \descendens g \]
4907
4908         % Clivis Aucta Ascendens
4909         \[ b \flexa \auctum \ascendens g \]
4910     }
4911     \paper {
4912         interscoreline = 1
4913         \translator {
4914             \ScoreContext
4915             \remove "Bar_number_engraver"
4916         }
4917         \translator {
4918             \StaffContext
4919             \remove "Clef_engraver"
4920             \remove "Key_engraver"
4921             \remove "Staff_symbol_engraver"
4922             \remove "Time_signature_engraver"
4923             \remove "Bar_engraver"
4924             minimumVerticalExtent = ##f
4925         }
4926         \translator {
4927             \VoiceContext
4928             \remove Ligature_bracket_engraver
4929             \consists Vaticana_ligature_engraver
4930             NoteHead \set #'style = #'vaticana_punctum
4931             Stem \set #'transparent = ##t
4932         }
4933     }
4934 }
4935 @end lilypond @tab
4936 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4937 \include "gregorian-init.ly"
4938 \score {
4939     \notes \transpose c c' {
4940         % Cephalicus
4941         \[ b \flexa \deminutum g \]
4942     }
4943     \paper {
4944         interscoreline = 1
4945         \translator {
4946             \ScoreContext
4947             \remove "Bar_number_engraver"
4948         }
4949         \translator {
4950             \StaffContext
4951             \remove "Clef_engraver"
4952             \remove "Key_engraver"
4953             \remove "Staff_symbol_engraver"
4954             \remove "Time_signature_engraver"
4955             \remove "Bar_engraver"
4956             minimumVerticalExtent = ##f
4957         }
4958         \translator {
4959             \VoiceContext
4960             \remove Ligature_bracket_engraver
4961             \consists Vaticana_ligature_engraver
4962             NoteHead \set #'style = #'vaticana_punctum
4963             Stem \set #'transparent = ##t
4964         }
4965     }
4966 }
4967 @end lilypond
4968
4969 @item
4970 @code{6. Podatus vel Pes} @tab
4971 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
4972 \include "gregorian-init.ly"
4973 \score {
4974     \notes \transpose c c' {
4975         % Podatus vel Pes
4976         \[ g \pes b \]
4977     }
4978     \paper {
4979         interscoreline = 1
4980         \translator {
4981             \ScoreContext
4982             \remove "Bar_number_engraver"
4983         }
4984         \translator {
4985             \StaffContext
4986             \remove "Clef_engraver"
4987             \remove "Key_engraver"
4988             \remove "Staff_symbol_engraver"
4989             \remove "Time_signature_engraver"
4990             \remove "Bar_engraver"
4991             minimumVerticalExtent = ##f
4992         }
4993         \translator {
4994             \VoiceContext
4995             \remove Ligature_bracket_engraver
4996             \consists Vaticana_ligature_engraver
4997             NoteHead \set #'style = #'vaticana_punctum
4998             Stem \set #'transparent = ##t
4999         }
5000     }
5001 }
5002 @end lilypond @tab
5003 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5004 \include "gregorian-init.ly"
5005 \score {
5006     \notes \transpose c c' {
5007         % Pes Auctus Descendens
5008         \[ g \pes \auctum \descendens b \]
5009
5010         % Pes Auctus Ascendens
5011         \[ g \pes \auctum \ascendens b \]
5012     }
5013     \paper {
5014         interscoreline = 1
5015         \translator {
5016             \ScoreContext
5017             \remove "Bar_number_engraver"
5018         }
5019         \translator {
5020             \StaffContext
5021             \remove "Clef_engraver"
5022             \remove "Key_engraver"
5023             \remove "Staff_symbol_engraver"
5024             \remove "Time_signature_engraver"
5025             \remove "Bar_engraver"
5026             minimumVerticalExtent = ##f
5027         }
5028         \translator {
5029             \VoiceContext
5030             \remove Ligature_bracket_engraver
5031             \consists Vaticana_ligature_engraver
5032             NoteHead \set #'style = #'vaticana_punctum
5033             Stem \set #'transparent = ##t
5034         }
5035     }
5036 }
5037 @end lilypond @tab
5038 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5039 \include "gregorian-init.ly"
5040 \score {
5041     \notes \transpose c c' {
5042         % Epiphonus
5043         \[ g \pes \deminutum b \]
5044     }
5045     \paper {
5046         interscoreline = 1
5047         \translator {
5048             \ScoreContext
5049             \remove "Bar_number_engraver"
5050         }
5051         \translator {
5052             \StaffContext
5053             \remove "Clef_engraver"
5054             \remove "Key_engraver"
5055             \remove "Staff_symbol_engraver"
5056             \remove "Time_signature_engraver"
5057             \remove "Bar_engraver"
5058             minimumVerticalExtent = ##f
5059         }
5060         \translator {
5061             \VoiceContext
5062             \remove Ligature_bracket_engraver
5063             \consists Vaticana_ligature_engraver
5064             NoteHead \set #'style = #'vaticana_punctum
5065             Stem \set #'transparent = ##t
5066         }
5067     }
5068 }
5069 @end lilypond
5070
5071 @item
5072 @code{7. Pes Quassus} @tab
5073 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5074 \include "gregorian-init.ly"
5075 \score {
5076     \notes \transpose c c' {
5077         % Pes Quassus
5078         \[ \oriscus g \pes \virga b \]
5079     }
5080     \paper {
5081         interscoreline = 1
5082         \translator {
5083             \ScoreContext
5084             \remove "Bar_number_engraver"
5085         }
5086         \translator {
5087             \StaffContext
5088             \remove "Clef_engraver"
5089             \remove "Key_engraver"
5090             \remove "Staff_symbol_engraver"
5091             \remove "Time_signature_engraver"
5092             \remove "Bar_engraver"
5093             minimumVerticalExtent = ##f
5094         }
5095         \translator {
5096             \VoiceContext
5097             \remove Ligature_bracket_engraver
5098             \consists Vaticana_ligature_engraver
5099             NoteHead \set #'style = #'vaticana_punctum
5100             Stem \set #'transparent = ##t
5101         }
5102     }
5103 }
5104 @end lilypond @tab
5105 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5106 \include "gregorian-init.ly"
5107 \score {
5108     \notes \transpose c c' {
5109         % Pes Quassus Auctus Descendens
5110         \[ \oriscus g \pes \auctum \descendens b \]
5111     }
5112     \paper {
5113         interscoreline = 1
5114         \translator {
5115             \ScoreContext
5116             \remove "Bar_number_engraver"
5117         }
5118         \translator {
5119             \StaffContext
5120             \remove "Clef_engraver"
5121             \remove "Key_engraver"
5122             \remove "Staff_symbol_engraver"
5123             \remove "Time_signature_engraver"
5124             \remove "Bar_engraver"
5125             minimumVerticalExtent = ##f
5126         }
5127         \translator {
5128             \VoiceContext
5129             \remove Ligature_bracket_engraver
5130             \consists Vaticana_ligature_engraver
5131             NoteHead \set #'style = #'vaticana_punctum
5132             Stem \set #'transparent = ##t
5133         }
5134     }
5135 }
5136 @end lilypond @tab
5137
5138 @item
5139 @code{8. Quilisma Pes} @tab
5140 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5141 \include "gregorian-init.ly"
5142 \score {
5143     \notes \transpose c c' {
5144         % Quilisma Pes
5145         \[ \quilisma g \pes b \]
5146     }
5147     \paper {
5148         interscoreline = 1
5149         \translator {
5150             \ScoreContext
5151             \remove "Bar_number_engraver"
5152         }
5153         \translator {
5154             \StaffContext
5155             \remove "Clef_engraver"
5156             \remove "Key_engraver"
5157             \remove "Staff_symbol_engraver"
5158             \remove "Time_signature_engraver"
5159             \remove "Bar_engraver"
5160             minimumVerticalExtent = ##f
5161         }
5162         \translator {
5163             \VoiceContext
5164             \remove Ligature_bracket_engraver
5165             \consists Vaticana_ligature_engraver
5166             NoteHead \set #'style = #'vaticana_punctum
5167             Stem \set #'transparent = ##t
5168         }
5169     }
5170 }
5171 @end lilypond @tab
5172 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5173 \include "gregorian-init.ly"
5174 \score {
5175     \notes \transpose c c' {
5176         % Quilisma Pes Auctus Descendens
5177         \[ \quilisma g \pes \auctum \descendens b \]
5178     }
5179     \paper {
5180         interscoreline = 1
5181         \translator {
5182             \ScoreContext
5183             \remove "Bar_number_engraver"
5184         }
5185         \translator {
5186             \StaffContext
5187             \remove "Clef_engraver"
5188             \remove "Key_engraver"
5189             \remove "Staff_symbol_engraver"
5190             \remove "Time_signature_engraver"
5191             \remove "Bar_engraver"
5192             minimumVerticalExtent = ##f
5193         }
5194         \translator {
5195             \VoiceContext
5196             \remove Ligature_bracket_engraver
5197             \consists Vaticana_ligature_engraver
5198             NoteHead \set #'style = #'vaticana_punctum
5199             Stem \set #'transparent = ##t
5200         }
5201     }
5202 }
5203 @end lilypond @tab
5204
5205 @item
5206 @code{9. Podatus Initio Debilis} @tab
5207 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5208 \include "gregorian-init.ly"
5209 \score {
5210     \notes \transpose c c' {
5211         % Pes Initio Debilis
5212         \[ \deminutum g \pes b \]
5213     }
5214     \paper {
5215         interscoreline = 1
5216         \translator {
5217             \ScoreContext
5218             \remove "Bar_number_engraver"
5219         }
5220         \translator {
5221             \StaffContext
5222             \remove "Clef_engraver"
5223             \remove "Key_engraver"
5224             \remove "Staff_symbol_engraver"
5225             \remove "Time_signature_engraver"
5226             \remove "Bar_engraver"
5227             minimumVerticalExtent = ##f
5228         }
5229         \translator {
5230             \VoiceContext
5231             \remove Ligature_bracket_engraver
5232             \consists Vaticana_ligature_engraver
5233             NoteHead \set #'style = #'vaticana_punctum
5234             Stem \set #'transparent = ##t
5235         }
5236     }
5237 }
5238 @end lilypond @tab
5239 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5240 \include "gregorian-init.ly"
5241 \score {
5242     \notes \transpose c c' {
5243         % Pes Auctus Descendens Initio Debilis
5244         \[ \deminutum g \pes \auctum \descendens b \]
5245     }
5246     \paper {
5247         interscoreline = 1
5248         \translator {
5249             \ScoreContext
5250             \remove "Bar_number_engraver"
5251         }
5252         \translator {
5253             \StaffContext
5254             \remove "Clef_engraver"
5255             \remove "Key_engraver"
5256             \remove "Staff_symbol_engraver"
5257             \remove "Time_signature_engraver"
5258             \remove "Bar_engraver"
5259             minimumVerticalExtent = ##f
5260         }
5261         \translator {
5262             \VoiceContext
5263             \remove Ligature_bracket_engraver
5264             \consists Vaticana_ligature_engraver
5265             NoteHead \set #'style = #'vaticana_punctum
5266             Stem \set #'transparent = ##t
5267         }
5268     }
5269 }
5270 @end lilypond @tab
5271
5272 @item
5273 @code{10. Torculus} @tab
5274 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5275 \include "gregorian-init.ly"
5276 \score {
5277     \notes \transpose c c' {
5278         % Torculus
5279         \[ a \pes b \flexa g \]
5280     }
5281     \paper {
5282         interscoreline = 1
5283         \translator {
5284             \ScoreContext
5285             \remove "Bar_number_engraver"
5286         }
5287         \translator {
5288             \StaffContext
5289             \remove "Clef_engraver"
5290             \remove "Key_engraver"
5291             \remove "Staff_symbol_engraver"
5292             \remove "Time_signature_engraver"
5293             \remove "Bar_engraver"
5294             minimumVerticalExtent = ##f
5295         }
5296         \translator {
5297             \VoiceContext
5298             \remove Ligature_bracket_engraver
5299             \consists Vaticana_ligature_engraver
5300             NoteHead \set #'style = #'vaticana_punctum
5301             Stem \set #'transparent = ##t
5302         }
5303     }
5304 }
5305 @end lilypond @tab
5306 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5307 \include "gregorian-init.ly"
5308 \score {
5309     \notes \transpose c c' {
5310         % Torculus Auctus Descendens
5311         \[ a \pes b \flexa \auctum \descendens g \]
5312     }
5313     \paper {
5314         interscoreline = 1
5315         \translator {
5316             \ScoreContext
5317             \remove "Bar_number_engraver"
5318         }
5319         \translator {
5320             \StaffContext
5321             \remove "Clef_engraver"
5322             \remove "Key_engraver"
5323             \remove "Staff_symbol_engraver"
5324             \remove "Time_signature_engraver"
5325             \remove "Bar_engraver"
5326             minimumVerticalExtent = ##f
5327         }
5328         \translator {
5329             \VoiceContext
5330             \remove Ligature_bracket_engraver
5331             \consists Vaticana_ligature_engraver
5332             NoteHead \set #'style = #'vaticana_punctum
5333             Stem \set #'transparent = ##t
5334         }
5335     }
5336 }
5337 @end lilypond @tab
5338 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5339 \include "gregorian-init.ly"
5340 \score {
5341     \notes \transpose c c' {
5342         % Torculus Deminutus
5343         \[ a \pes b \flexa \deminutum g \]
5344     }
5345     \paper {
5346         interscoreline = 1
5347         \translator {
5348             \ScoreContext
5349             \remove "Bar_number_engraver"
5350         }
5351         \translator {
5352             \StaffContext
5353             \remove "Clef_engraver"
5354             \remove "Key_engraver"
5355             \remove "Staff_symbol_engraver"
5356             \remove "Time_signature_engraver"
5357             \remove "Bar_engraver"
5358             minimumVerticalExtent = ##f
5359         }
5360         \translator {
5361             \VoiceContext
5362             \remove Ligature_bracket_engraver
5363             \consists Vaticana_ligature_engraver
5364             NoteHead \set #'style = #'vaticana_punctum
5365             Stem \set #'transparent = ##t
5366         }
5367     }
5368 }
5369 @end lilypond
5370
5371 @item
5372 @code{11. Torculus Initio Debilis} @tab
5373 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5374 \include "gregorian-init.ly"
5375 \score {
5376     \notes \transpose c c' {
5377         % Torculus Initio Debilis
5378         \[ \deminutum a \pes b \flexa g \]
5379     }
5380     \paper {
5381         interscoreline = 1
5382         \translator {
5383             \ScoreContext
5384             \remove "Bar_number_engraver"
5385         }
5386         \translator {
5387             \StaffContext
5388             \remove "Clef_engraver"
5389             \remove "Key_engraver"
5390             \remove "Staff_symbol_engraver"
5391             \remove "Time_signature_engraver"
5392             \remove "Bar_engraver"
5393             minimumVerticalExtent = ##f
5394         }
5395         \translator {
5396             \VoiceContext
5397             \remove Ligature_bracket_engraver
5398             \consists Vaticana_ligature_engraver
5399             NoteHead \set #'style = #'vaticana_punctum
5400             Stem \set #'transparent = ##t
5401         }
5402     }
5403 }
5404 @end lilypond @tab
5405 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5406 \include "gregorian-init.ly"
5407 \score {
5408     \notes \transpose c c' {
5409         % Torculus Auctus Descendens Initio Debilis
5410         \[ \deminutum a \pes b \flexa \auctum \descendens g \]
5411     }
5412     \paper {
5413         interscoreline = 1
5414         \translator {
5415             \ScoreContext
5416             \remove "Bar_number_engraver"
5417         }
5418         \translator {
5419             \StaffContext
5420             \remove "Clef_engraver"
5421             \remove "Key_engraver"
5422             \remove "Staff_symbol_engraver"
5423             \remove "Time_signature_engraver"
5424             \remove "Bar_engraver"
5425             minimumVerticalExtent = ##f
5426         }
5427         \translator {
5428             \VoiceContext
5429             \remove Ligature_bracket_engraver
5430             \consists Vaticana_ligature_engraver
5431             NoteHead \set #'style = #'vaticana_punctum
5432             Stem \set #'transparent = ##t
5433         }
5434     }
5435 }
5436 @end lilypond @tab
5437 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5438 \include "gregorian-init.ly"
5439 \score {
5440     \notes \transpose c c' {
5441         % Torculus Deminutus Initio Debilis
5442         \[ \deminutum a \pes b \flexa \deminutum g \]
5443     }
5444     \paper {
5445         interscoreline = 1
5446         \translator {
5447             \ScoreContext
5448             \remove "Bar_number_engraver"
5449         }
5450         \translator {
5451             \StaffContext
5452             \remove "Clef_engraver"
5453             \remove "Key_engraver"
5454             \remove "Staff_symbol_engraver"
5455             \remove "Time_signature_engraver"
5456             \remove "Bar_engraver"
5457             minimumVerticalExtent = ##f
5458         }
5459         \translator {
5460             \VoiceContext
5461             \remove Ligature_bracket_engraver
5462             \consists Vaticana_ligature_engraver
5463             NoteHead \set #'style = #'vaticana_punctum
5464             Stem \set #'transparent = ##t
5465         }
5466     }
5467 }
5468 @end lilypond
5469
5470 @item
5471 @code{12. Porrectus} @tab
5472 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5473 \include "gregorian-init.ly"
5474 \score {
5475     \notes \transpose c c' {
5476         % Porrectus
5477         \[ a \flexa g \pes b \]
5478     }
5479     \paper {
5480         interscoreline = 1
5481         \translator {
5482             \ScoreContext
5483             \remove "Bar_number_engraver"
5484         }
5485         \translator {
5486             \StaffContext
5487             \remove "Clef_engraver"
5488             \remove "Key_engraver"
5489             \remove "Staff_symbol_engraver"
5490             \remove "Time_signature_engraver"
5491             \remove "Bar_engraver"
5492             minimumVerticalExtent = ##f
5493         }
5494         \translator {
5495             \VoiceContext
5496             \remove Ligature_bracket_engraver
5497             \consists Vaticana_ligature_engraver
5498             NoteHead \set #'style = #'vaticana_punctum
5499             Stem \set #'transparent = ##t
5500         }
5501     }
5502 }
5503 @end lilypond @tab
5504 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5505 \include "gregorian-init.ly"
5506 \score {
5507     \notes \transpose c c' {
5508         % Porrectus Auctus Descendens
5509         \[ a \flexa g \pes \auctum \descendens b \]
5510     }
5511     \paper {
5512         interscoreline = 1
5513         \translator {
5514             \ScoreContext
5515             \remove "Bar_number_engraver"
5516         }
5517         \translator {
5518             \StaffContext
5519             \remove "Clef_engraver"
5520             \remove "Key_engraver"
5521             \remove "Staff_symbol_engraver"
5522             \remove "Time_signature_engraver"
5523             \remove "Bar_engraver"
5524             minimumVerticalExtent = ##f
5525         }
5526         \translator {
5527             \VoiceContext
5528             \remove Ligature_bracket_engraver
5529             \consists Vaticana_ligature_engraver
5530             NoteHead \set #'style = #'vaticana_punctum
5531             Stem \set #'transparent = ##t
5532         }
5533     }
5534 }
5535 @end lilypond @tab
5536 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5537 \include "gregorian-init.ly"
5538 \score {
5539     \notes \transpose c c' {
5540         % Porrectus Deminutus
5541         \[ a \flexa g \pes \deminutum b \]
5542     }
5543     \paper {
5544         interscoreline = 1
5545         \translator {
5546             \ScoreContext
5547             \remove "Bar_number_engraver"
5548         }
5549         \translator {
5550             \StaffContext
5551             \remove "Clef_engraver"
5552             \remove "Key_engraver"
5553             \remove "Staff_symbol_engraver"
5554             \remove "Time_signature_engraver"
5555             \remove "Bar_engraver"
5556             minimumVerticalExtent = ##f
5557         }
5558         \translator {
5559             \VoiceContext
5560             \remove Ligature_bracket_engraver
5561             \consists Vaticana_ligature_engraver
5562             NoteHead \set #'style = #'vaticana_punctum
5563             Stem \set #'transparent = ##t
5564         }
5565     }
5566 }
5567 @end lilypond
5568
5569 @item
5570 @code{13. Climacus} @tab
5571 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5572 \include "gregorian-init.ly"
5573 \score {
5574     \notes \transpose c c' {
5575         % Climacus
5576         \[ \virga b \inclinatum a \inclinatum g \]
5577     }
5578     \paper {
5579         interscoreline = 1
5580         \translator {
5581             \ScoreContext
5582             \remove "Bar_number_engraver"
5583         }
5584         \translator {
5585             \StaffContext
5586             \remove "Clef_engraver"
5587             \remove "Key_engraver"
5588             \remove "Staff_symbol_engraver"
5589             \remove "Time_signature_engraver"
5590             \remove "Bar_engraver"
5591             minimumVerticalExtent = ##f
5592         }
5593         \translator {
5594             \VoiceContext
5595             \remove Ligature_bracket_engraver
5596             \consists Vaticana_ligature_engraver
5597             NoteHead \set #'style = #'vaticana_punctum
5598             Stem \set #'transparent = ##t
5599         }
5600     }
5601 }
5602 @end lilypond @tab
5603 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5604 \include "gregorian-init.ly"
5605 \score {
5606     \notes \transpose c c' {
5607         % Climacus Auctus
5608         \[ \virga b \inclinatum a \inclinatum \auctum g \]
5609     }
5610     \paper {
5611         interscoreline = 1
5612         \translator {
5613             \ScoreContext
5614             \remove "Bar_number_engraver"
5615         }
5616         \translator {
5617             \StaffContext
5618             \remove "Clef_engraver"
5619             \remove "Key_engraver"
5620             \remove "Staff_symbol_engraver"
5621             \remove "Time_signature_engraver"
5622             \remove "Bar_engraver"
5623             minimumVerticalExtent = ##f
5624         }
5625         \translator {
5626             \VoiceContext
5627             \remove Ligature_bracket_engraver
5628             \consists Vaticana_ligature_engraver
5629             NoteHead \set #'style = #'vaticana_punctum
5630             Stem \set #'transparent = ##t
5631         }
5632     }
5633 }
5634 @end lilypond @tab
5635 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5636 \include "gregorian-init.ly"
5637 \score {
5638     \notes \transpose c c' {
5639         % Climacus Deminutus
5640         \[ \virga b \inclinatum a \inclinatum \deminutum g \]
5641     }
5642     \paper {
5643         interscoreline = 1
5644         \translator {
5645             \ScoreContext
5646             \remove "Bar_number_engraver"
5647         }
5648         \translator {
5649             \StaffContext
5650             \remove "Clef_engraver"
5651             \remove "Key_engraver"
5652             \remove "Staff_symbol_engraver"
5653             \remove "Time_signature_engraver"
5654             \remove "Bar_engraver"
5655             minimumVerticalExtent = ##f
5656         }
5657         \translator {
5658             \VoiceContext
5659             \remove Ligature_bracket_engraver
5660             \consists Vaticana_ligature_engraver
5661             NoteHead \set #'style = #'vaticana_punctum
5662             Stem \set #'transparent = ##t
5663         }
5664     }
5665 }
5666 @end lilypond
5667
5668 @item
5669 @code{14. Scandicus} @tab
5670 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5671 \include "gregorian-init.ly"
5672 \score {
5673     \notes \transpose c c' {
5674         % Scandicus
5675         \[ g \pes a \virga b \]
5676     }
5677     \paper {
5678         interscoreline = 1
5679         \translator {
5680             \ScoreContext
5681             \remove "Bar_number_engraver"
5682         }
5683         \translator {
5684             \StaffContext
5685             \remove "Clef_engraver"
5686             \remove "Key_engraver"
5687             \remove "Staff_symbol_engraver"
5688             \remove "Time_signature_engraver"
5689             \remove "Bar_engraver"
5690             minimumVerticalExtent = ##f
5691         }
5692         \translator {
5693             \VoiceContext
5694             \remove Ligature_bracket_engraver
5695             \consists Vaticana_ligature_engraver
5696             NoteHead \set #'style = #'vaticana_punctum
5697             Stem \set #'transparent = ##t
5698         }
5699     }
5700 }
5701 @end lilypond @tab
5702 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5703 \include "gregorian-init.ly"
5704 \score {
5705     \notes \transpose c c' {
5706         % Scandicus Auctus Descendens
5707         \[ g \pes a \pes \auctum \descendens b \]
5708     }
5709     \paper {
5710         interscoreline = 1
5711         \translator {
5712             \ScoreContext
5713             \remove "Bar_number_engraver"
5714         }
5715         \translator {
5716             \StaffContext
5717             \remove "Clef_engraver"
5718             \remove "Key_engraver"
5719             \remove "Staff_symbol_engraver"
5720             \remove "Time_signature_engraver"
5721             \remove "Bar_engraver"
5722             minimumVerticalExtent = ##f
5723         }
5724         \translator {
5725             \VoiceContext
5726             \remove Ligature_bracket_engraver
5727             \consists Vaticana_ligature_engraver
5728             NoteHead \set #'style = #'vaticana_punctum
5729             Stem \set #'transparent = ##t
5730         }
5731     }
5732 }
5733 @end lilypond @tab
5734 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5735 \include "gregorian-init.ly"
5736 \score {
5737     \notes \transpose c c' {
5738         % Scandicus Deminutus
5739         \[ g \pes a \pes \deminutum b \]
5740     }
5741     \paper {
5742         interscoreline = 1
5743         \translator {
5744             \ScoreContext
5745             \remove "Bar_number_engraver"
5746         }
5747         \translator {
5748             \StaffContext
5749             \remove "Clef_engraver"
5750             \remove "Key_engraver"
5751             \remove "Staff_symbol_engraver"
5752             \remove "Time_signature_engraver"
5753             \remove "Bar_engraver"
5754             minimumVerticalExtent = ##f
5755         }
5756         \translator {
5757             \VoiceContext
5758             \remove Ligature_bracket_engraver
5759             \consists Vaticana_ligature_engraver
5760             NoteHead \set #'style = #'vaticana_punctum
5761             Stem \set #'transparent = ##t
5762         }
5763     }
5764 }
5765 @end lilypond
5766
5767 @item
5768 @code{15. Salicus} @tab
5769 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5770 \include "gregorian-init.ly"
5771 \score {
5772     \notes \transpose c c' {
5773         % Salicus
5774         \[ g \oriscus a \pes \virga b \]
5775     }
5776     \paper {
5777         interscoreline = 1
5778         \translator {
5779             \ScoreContext
5780             \remove "Bar_number_engraver"
5781         }
5782         \translator {
5783             \StaffContext
5784             \remove "Clef_engraver"
5785             \remove "Key_engraver"
5786             \remove "Staff_symbol_engraver"
5787             \remove "Time_signature_engraver"
5788             \remove "Bar_engraver"
5789             minimumVerticalExtent = ##f
5790         }
5791         \translator {
5792             \VoiceContext
5793             \remove Ligature_bracket_engraver
5794             \consists Vaticana_ligature_engraver
5795             NoteHead \set #'style = #'vaticana_punctum
5796             Stem \set #'transparent = ##t
5797         }
5798     }
5799 }
5800 @end lilypond @tab
5801 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5802 \include "gregorian-init.ly"
5803 \score {
5804     \notes \transpose c c' {
5805         % Salicus Auctus Descendens
5806         \[ g \oriscus a \pes \auctum \descendens b \]
5807     }
5808     \paper {
5809         interscoreline = 1
5810         \translator {
5811             \ScoreContext
5812             \remove "Bar_number_engraver"
5813         }
5814         \translator {
5815             \StaffContext
5816             \remove "Clef_engraver"
5817             \remove "Key_engraver"
5818             \remove "Staff_symbol_engraver"
5819             \remove "Time_signature_engraver"
5820             \remove "Bar_engraver"
5821             minimumVerticalExtent = ##f
5822         }
5823         \translator {
5824             \VoiceContext
5825             \remove Ligature_bracket_engraver
5826             \consists Vaticana_ligature_engraver
5827             NoteHead \set #'style = #'vaticana_punctum
5828             Stem \set #'transparent = ##t
5829         }
5830     }
5831 }
5832 @end lilypond @tab
5833
5834 @item
5835 @code{16. Trigomus} @tab
5836 @lilypond[noindent, 26pt, nofragment, linewidth=3.0cm]
5837 \include "gregorian-init.ly"
5838 \score {
5839     \notes \transpose c c' {
5840         % Trigonus
5841         \[ \stropha b \stropha b \stropha a \]
5842     }
5843     \paper {
5844         interscoreline = 1
5845         \translator {
5846             \ScoreContext
5847             \remove "Bar_number_engraver"
5848         }
5849         \translator {
5850             \StaffContext
5851             \remove "Clef_engraver"
5852             \remove "Key_engraver"
5853             \remove "Staff_symbol_engraver"
5854             \remove "Time_signature_engraver"
5855             \remove "Bar_engraver"
5856             minimumVerticalExtent = ##f
5857         }
5858         \translator {
5859             \VoiceContext
5860             \remove Ligature_bracket_engraver
5861             \consists Vaticana_ligature_engraver
5862             NoteHead \set #'style = #'vaticana_punctum
5863             Stem \set #'transparent = ##t
5864         }
5865     }
5866 }
5867 @end lilypond @tab @tab
5868
5869 @end multitable
5870
5871 @refbugs
5872
5873 Horizontal head alignment is broken in Pes Initio Debilis.
5874
5875 Use special heads for lower/upper head of Pes only when heads are
5876 stacked.
5877
5878 @node Figured bass
5879 @subsection Figured bass
5880
5881 @cindex Basso continuo
5882
5883 @c TODO: musicological blurb about FB
5884
5885 @syntax
5886
5887 LilyPond has limited support for figured bass:
5888
5889 @lilypond[verbatim,fragment]
5890 <
5891  \context Voice \notes { \clef bass dis4  c d ais}
5892  \context FiguredBass
5893    \figures {
5894     < 6 >4 < 7 >8 < 6+ [_!] >
5895     < 6 >4 <6 5 [3+] >
5896    }
5897  >
5898 @end lilypond
5899
5900 The support for figured bass consists of two parts: there is an input
5901 mode, introduced by @code{\figures}, where you can enter bass figures
5902 as numbers, and there is a context called @internalsref{FiguredBass}
5903 that takes care of making @internalsref{BassFigure} objects.
5904
5905 In figures input mode, a group of bass figures is delimited by
5906 @code{<} and @code{>}. The duration is entered after the @code{>}.
5907 @example
5908         <4 6>
5909 @end example
5910 @lilypond[fragment]
5911 \context FiguredBass
5912 \figures { <4 6> }
5913 @end lilypond
5914
5915 Accidentals are added to the numbers if you alterate them by
5916 appending @code{-}, @code{!}  and @code{+}.
5917
5918 @example
5919   <4- 6+ 7!>
5920 @end example
5921 @lilypond[fragment]
5922   \context FiguredBass
5923     \figures { <4- 6+ 7!> }
5924 @end lilypond
5925
5926 Spaces or dashes may be inserted by using @code{_}. Brackets are
5927 introduced with @code{[} and @code{]}.
5928
5929 @example
5930         < [4 6] 8 [_ 12]>
5931 @end example
5932 @lilypond[fragment]
5933  \context FiguredBass
5934 \figures { < [4 6] 8 [_ 12]> }
5935 @end lilypond
5936
5937 Although the support for figured bass may superficially resemble chord
5938 support, it works much simpler.  The @code{\figures} mode simply
5939 stores the numbers , and @internalsref{FiguredBass} context prints
5940 them as entered. There is no conversion to pitches, and no
5941 realizations of the bass are played in the MIDI file.
5942
5943 Internally, the code produces markup texts. You can use any of the
5944 markup text properties to override formatting. For example, the
5945 vertical spacing of the figures may be set with @code{baseline-skip}.
5946
5947 @seealso
5948
5949 @internalsref{BassFigureEvent} music, @internalsref{BassFigure} grob,
5950 @internalsref{FiguredBass} context
5951
5952 @refbugs
5953
5954 Slash notation for alterations is not supported.
5955
5956
5957 @node Contemporary notation
5958 @section Contemporary notation
5959
5960 In the 20th century, composers have greatly expanded the musical
5961 vocabulary. With this expansion, many innovations in musical notation
5962 have been tried. For a comprehensive overview, refer to @cite{Stone
5963 1980} (see @ref{Literature}). In general, the use of new, innovative
5964 notation makes a piece harder to understand and perform and its use
5965 should be avoided if possible.  For this reason, support for
5966 contemporary notation in LilyPond is limited.
5967
5968
5969 @menu
5970 * Clusters::                    
5971 * Fermatas::                    
5972 @end menu
5973
5974 @node Clusters
5975 @subsection Clusters
5976
5977 @cindex cluster
5978
5979 In musical terminology, a @emph{cluster} denotes a range of
5980 simultaneously sounding pitches that may change over time.  The set of
5981 available pitches to apply usually depends on the accoustic source.
5982 Thus, in piano music, a cluster typically consists of a continous range
5983 of the semitones as provided by the piano's fixed set of a chromatic
5984 scale.  In choral music, each singer of the choir typically may sing an
5985 arbitrary pitch within the cluster's range that is not bound to any
5986 diatonic, chromatic or other scale.  In electronic music, a cluster
5987 (theoretically) may even cover a continuous range of pitches, thus
5988 resulting in coloured noise, such as pink noise.
5989
5990 Clusters can be denoted in the context of ordinary staff notation by
5991 engraving simple geometrical shapes that replace ordinary notation of
5992 notes.  Ordinary notes as musical events specify starting time and
5993 duration of pitches; however, the duration of a note is expressed by the
5994 shape of the note head rather than by the horizontal graphical extent of
5995 the note symbol.  In contrast, the shape of a cluster geometrically
5996 describes the development of a range of pitches (vertical extent) over
5997 time (horizontal extent).  Still, the geometrical shape of a cluster
5998 covers the area in wich any single pitch contained in the cluster would
5999 be notated as an ordinary note.  From this point of view, it is
6000 reasonable to specify a cluster as the envelope of a set of notes.
6001
6002 @syntax
6003
6004 A cluster is engraved as the envelope of a set of notes. The starting
6005 note is marked with @code{\startCluster}, and the ending note with
6006 @code{\stopCluster}, e.g.,
6007
6008 @example
6009   c4-\startCluster
6010      ...
6011   f4-\stopCluster 
6012 @end example
6013
6014 The following example (from
6015 @inputfileref{input/regression,cluster.ly}) shows what the result
6016 looks like.
6017
6018 @lilypondfile[notexidoc]{cluster.ly}
6019
6020 By default, @internalsref{Cluster_engraver} is in the
6021 @internalsref{Voice} context.  This allows putting ordinary notes and
6022 clusters together in the same staff, even simultaneously.  In such a
6023 case no attempt is made to automatically avoid collisions between
6024 ordinary notes and clusters.
6025
6026 @seealso
6027
6028 @internalsref{Cluster}, @inputfileref{input/regression,cluster.ly},
6029 @internalsref{Cluster_engraver}, @internalsref{ClusterEvent}.
6030
6031 @refbugs
6032
6033 When a cluster is active, note heads must be switched off manually using
6034 @code{\hideNotes}. 
6035
6036 Music expressions like @code{< @{ g8 e8 @} a4 >} are not printed
6037 accurately.  Use @code{<<g a>>8 <<e a>>8} instead.
6038
6039
6040
6041 @node Fermatas
6042 @subsection Fermatas
6043
6044 @cindex fermatas
6045
6046
6047
6048 Contemporary music notation frequently uses special fermata symbols to
6049 indicate fermatas of differing lengths.
6050
6051 @syntax
6052
6053 The following are supported
6054
6055 @lilypond[singleline]
6056 \score {
6057   <  \notes {
6058         \fatText
6059         b'
6060         ^\shortfermata
6061         _\shortfermata
6062         r
6063         b'
6064         ^\fermata
6065         _\fermata
6066
6067         r
6068         b'
6069         ^\longfermata
6070         _\longfermata
6071
6072         r
6073         b'
6074         ^\verylongfermata
6075         _\verylongfermata
6076         r
6077     }
6078     \context Lyrics \lyrics {
6079       "shortfermata" "fermata"  "longfermata" "verylongfermata"
6080     } >
6081 }
6082 @end lilypond
6083
6084 See @ref{Articulations} for general instructions how to apply scripts
6085 such as fermatas to a @code{\notes@{@}} block.
6086
6087 @node Tuning output
6088 @section Tuning output
6089
6090 There are situations where default layout decisions are not
6091 sufficient.  In this section we discuss ways to override these
6092 defaults.
6093
6094 Formatting is internally done by manipulating so called objects (graphic
6095 objects). Each object carries with it a set of properties (object
6096 properties) specific to that object.  For example, a stem object has
6097 properties that specify its direction, length and thickness.
6098
6099 The most direct way of tuning the output is by altering the values of
6100 these properties. There are two ways of doing that: first, you can
6101 temporarily change the definition of one type of object, thus
6102 affecting a whole set of objects.  Second, you can select one specific
6103 object, and set a object property in that object.
6104
6105 @menu
6106 * Tuning objects ::             
6107 * Applyoutput::                 
6108 * Outputproperty::              
6109 * Font selection::              
6110 * Text markup::                 
6111 @end menu
6112
6113 @node Tuning objects 
6114 @subsection Tuning objects 
6115
6116 @cindex object description
6117
6118 The definition of an object is actually a list of default object
6119 properties. For example, the definition of the Stem object (available
6120 in @file{scm/grob-description.scm}), includes the following definitions for
6121 @internalsref{Stem}
6122
6123 @example
6124         (thickness . 1.3)
6125         (beamed-lengths . (0.0 2.5 2.0 1.5))
6126         (Y-extent-callback . ,Stem::height)
6127         @var{...}
6128 @end example
6129
6130
6131 By adding variables on top of these existing definitions, the system
6132 defaults is overriden, and the appearance of a graphical objects is
6133 altered.
6134
6135 @syntax
6136
6137
6138 Changing a variable for only   one object is commonly achieved with
6139 @code{\once}:
6140
6141 @example
6142 \once \property @var{context}.@var{grobname}
6143   \override @var{symbol} = @var{value}
6144 @end example
6145 Here @var{symbol} is a Scheme expression of symbol type, @var{context}
6146 and @var{grobname} is a string and @var{value} is a Scheme expression.
6147 This command applies a setting only during one moment in the score.
6148
6149 In the following example, only one @internalsref{Stem} object is
6150 changed from its original setting:
6151
6152 @lilypond[verbatim, fragment, relative=1]
6153   c4 
6154   \once \property Voice.Stem \set #'thickness = #4
6155   c4
6156   c4
6157 @end lilypond
6158 @cindex @code{\once}
6159
6160 For changing more objects, the same command, without @code{\once} can
6161 be used.
6162 @example
6163 \property @var{context}.@var{grobname} \override @var{symbol} = @var{value}
6164 @end example
6165 This command adds @code{@var{symbol} = @var{value}} to the definition
6166 of @var{grobname} in the context @var{context}, and this definition
6167 stays in place until it is removed.
6168
6169 An existing definition may be removed by the following command
6170 @c
6171 @example
6172 \property @var{context}.@var{grobname} \revert @var{symbol}
6173 @end example
6174 @c
6175 All @code{\override} and @code{\revert} commands should be balanced.
6176 The @code{\set} shorthand, performs a revert followed by an override,
6177 and is often more convenient to use
6178
6179 @example
6180 \property @var{context}.@var{grobname} \set @var{symbol} = @var{value}
6181 @end example
6182
6183 Some examples: 
6184 @lilypond[verbatim,quote]
6185 c'4 \property Voice.Stem \override #'thickness = #4.0
6186 c'4
6187 c'4 \property Voice.Stem \revert #'thickness
6188 c'4
6189 @end lilypond
6190
6191 The following example gives exactly the same result as the previous
6192 one (assuming the system default for stem thickness is 1.3).
6193 @c
6194 @lilypond[verbatim,quote]
6195   c'4 \property Voice.Stem \set #'thickness = #4.0
6196   c'4
6197   c'4 \property Voice.Stem \set #'thickness = #1.3
6198   c'4
6199 @end lilypond
6200
6201 Reverting a setting which was not set in the first place has no
6202 effect. However, if the setting was set as a system default, this may
6203 remove the default value, and this may give surprising results,
6204 including crashes.  In other words, @code{\override} and
6205 @code{\revert} must be carefully balanced.
6206
6207 These are examples of correct nesting of @code{\override}, @code{\set},
6208 @code{\revert}. 
6209
6210 A clumsy but correct form:
6211 @example
6212   \override \revert \override \revert \override \revert
6213 @end example
6214
6215 Shorter version of the same:
6216 @example 
6217   \override \set \set  \revert
6218 @end example
6219
6220 A short form, using only @code{\set}. This requires you to know the
6221 default value:
6222 @example
6223   \set \set \set \set @var{to default value}
6224 @end example
6225
6226 If there is no default (i.e. by default, the object property is unset),
6227 then you can use
6228 @example
6229   \set \set \set \revert
6230 @end example
6231
6232 For the digirati, the object description is an Scheme association
6233 list. Since a Scheme list is a singly linked list, we can treat it as
6234 a stack, and @code{\override} and @code{\revert} are push and pop
6235 operations.  The association list is stored in a normal context
6236 property, hence
6237 @example
6238  \property Voice.NoteHead  = #'() 
6239 @end example
6240 will effectively erase @internalsref{NoteHead}s from the current
6241 @internalsref{Voice}. However, this mechanism is not guaranteed to
6242 work, and may cause crashes or other anomalous behavior.
6243
6244 @seealso
6245
6246 @internalsref{OverrideProperty}, @internalsref{RevertProperty},
6247 @internalsref{PropertySet}, @internalsref{backend properties},
6248 @internalsref{All Graphical Objects}.
6249
6250
6251 @refbugs
6252
6253 The backend is not very strict in type-checking object properties.
6254 Cyclic references in @var{value} cause hangs and/or crashes.
6255 Similarly, reverting properties that are system defaults may also lead
6256 to crashes.
6257
6258
6259 @node Applyoutput
6260 @subsection Applyoutput
6261
6262 The most versatile way of tuning object is @code{\applyoutput}. Its
6263 syntax is
6264 @example
6265 \applyoutput @var{proc}
6266 @end example
6267 where @var{proc} is a Scheme function, taking four arguments.
6268
6269 When interpreted, the function @var{proc} is called for every grob found
6270 in the context, with the following arguments:
6271 @itemize @bullet
6272 @item the grob itself
6273 @item the context where the grob was created
6274 @item the context where @code{\applyoutput} is processed.
6275 @end itemize
6276
6277 In addition, the cause of the grob, i.e.  the music expression or object
6278 that was responsible for creating the object, is in the object property
6279 @code{cause}.  For example, for a note head, this is a
6280 @internalsref{NoteHead} event, and for a @internalsref{Stem} object,
6281 this is a @internalsref{NoteHead} object.
6282
6283
6284 @node Outputproperty
6285 @subsection Outputproperty
6286
6287 @cindex \outputproperty
6288
6289 Another way of tuning objects is the more arcane @code{\outputproperty}
6290 feature.  The syntax is as follows:
6291 @example
6292 \outputproperty @var{predicate} @var{symbol} = @var{value}
6293 @end example
6294 Here @code{predicate} is a Scheme function taking an object argument, and
6295 returning a boolean.  This statement is processed by the
6296 @code{Output_property_engraver}.  It instructs the engraver to feed all
6297 objects that it sees to @var{predicate}. Whenever the predicate returns
6298 true, the object property @var{symbol} will be set to @var{value}.
6299
6300 You will need to combine this statement with @code{\context} to select
6301 the appropriate context to apply this to.
6302 @inputfileref{input/regression,output-property.ly} shows an example of
6303 the use of @code{\outputproperty}.
6304
6305 @refbugs
6306
6307 If possible, avoid this feature: the semantics are not very clean, and
6308 the syntax and semantics are up for rewrite.
6309
6310
6311 @node Font selection
6312 @subsection Font selection
6313
6314 The most common thing to change about the appearance of fonts is
6315 their size. The font size of any context can be easily
6316 changed by setting the @code{fontSize} property for that context:
6317 @c
6318 @lilypond[fragment,relative=1,verbatim,quote]
6319   c4 c4 \property Voice.fontSize = #-1
6320   f4 g4
6321 @end lilypond
6322  This command will set @code{font-relative-size} (see below),
6323  and does not change the size of variable symbols, such as
6324 beams or slurs.  You can use this command to get smaller symbol for
6325 cue notes, but that involves some more subtleties. An elaborate
6326 example of those is in @inputfileref{input/test,cue-notes.ly}.
6327
6328 @cindex magnification
6329
6330 The size of the font may be scaled with the object property
6331 @code{font-magnification}.  For example, @code{2.0} blows up all
6332 letters by a factor 2 in both directions.
6333
6334
6335 @cindex cue notes
6336 @cindex font size
6337 @cindex size
6338 @cindex symbol size
6339 @cindex glyph size
6340
6341 The font used for printing a object can be selected by setting
6342 @code{font-name}, e.g.
6343 @example
6344   \property Staff.TimeSignature
6345     \set #'font-name = #"cmr17"
6346 @end example
6347 You may use any font which is available to @TeX{}, such as foreign
6348 fonts or fonts that do not belong to the Computer Modern font family.
6349
6350 Font selection for the standard fonts, @TeX{}'s Computer Modern fonts,
6351 can also be adjusted with a more fine-grained mechanism.  By setting
6352 the object properties described below, you can select a different font.
6353 All three mechanisms work for every object that supports
6354 @code{font-interface}.
6355
6356 @table @code
6357 @item font-family
6358  A symbol indicating the general class of the typeface.  Supported are
6359 @code{roman} (Computer Modern), @code{braces} (for piano staff
6360 braces), @code{music} (the standard music font, including ancient
6361 glyphs), @code{dynamic} (for dynamic signs) and @code{typewriter}.
6362   
6363 @item font-shape
6364   A symbol indicating the shape of the font, there are typically several
6365   font shapes available for each font family. Choices are @code{italic},
6366   @code{caps} and @code{upright} 
6367
6368 @item font-series
6369 A  symbol indicating the series of the font. There are typically several
6370 font series for each font family and shape. Choices are @code{medium}
6371 and @code{bold}. 
6372
6373 @item font-relative-size
6374   A number indicating the size relative the standard size.  For example,
6375   with 20pt staff height, relative size -1  corresponds to 16pt staff
6376   height, and relative size +1 corresponds to 23 pt staff height.
6377
6378    There are small differences in design between fonts designed for
6379 different sizes, hence @code{font-relative-size} is preferred over
6380 @code{font-magnification} for changing font sizes.
6381
6382
6383 @item font-design-size
6384 A number indicating  the design size of the font. 
6385
6386 This is a feature of the Computer Modern Font: each point size has a
6387 slightly different design. Smaller design sizes are relatively wider,
6388 which enhances readability.
6389 @end table
6390
6391 For any of these properties, the value @code{*} (i.e. the symbol
6392 @code{*}, entered as @code{#'*}), acts as a wildcard. This can be used
6393 to override default setting, which are always present. For example:
6394 @example
6395   \property Lyrics.LyricText \override #'font-series = #'bold
6396   \property Lyrics.LyricText \override #'font-family = #'typewriter
6397   \property Lyrics.LyricText \override #'font-shape  = #'*
6398 @end example
6399
6400 @cindex @code{font-style}
6401
6402
6403
6404 @refbugs
6405
6406 Relative size is not linked to any real size.
6407
6408 There is no style sheet provided for other fonts besides the @TeX{}
6409 family, and the style sheet cannot be modified easily.
6410
6411 @cindex font selection
6412 @cindex font magnification
6413 @cindex @code{font-interface}
6414
6415
6416 @node Text markup
6417 @subsection Text markup
6418 @cindex text markup
6419 @cindex markup text
6420
6421
6422 @cindex typeset text
6423
6424 LilyPond has an internal mechanism to typeset texts. You can access it
6425 with the keyword @code{\markup}. Within markup mode, you can enter texts
6426 similar to lyrics: simply enter them, surrounded by spaces. 
6427 @cindex markup
6428
6429 @lilypond[verbatim,fragment,relative=1]
6430  c1^\markup { hello }
6431  c1_\markup { hi there }
6432  c1^\markup { hi \bold there, is \italic anyone home? }
6433 @end lilypond
6434
6435 @cindex font switching
6436
6437 The line of the example demonstrates font switching commands.  The
6438 command only apply to the first following word; enclose a set of texts
6439 with braces to apply a command to more words.
6440 @example
6441   \markup @{ \bold @{ hi there @} @}
6442 @end example
6443 For clarity, you can also do this for single arguments, e.g.
6444 @example
6445   \markup @{ is \italic @{ anyone @} home @}
6446 @end example
6447
6448 @cindex font size, texts
6449
6450 The following size commands set abolute sizes
6451
6452 @cindex \teeny
6453 @cindex \tiny
6454 @cindex \small
6455 @cindex \large
6456 @cindex \huge
6457
6458 @table @code
6459 @item \teeny
6460 @item \tiny
6461 @item \small
6462 @item \large
6463 @item \huge
6464 @end table
6465
6466 You can also make letter larger or smaller relative to their neighbors,
6467 with the commands @code{\larger} and @code{\smaller}.
6468 @cindex smaller
6469 @cindex larger
6470
6471 @cindex font style, for texts
6472 @cindex \bold
6473 @cindex \dynamic
6474 @cindex \number
6475 @cindex \italic
6476
6477 The following font change commands are defined:
6478 @table @code
6479 @item \dynamic
6480 This changes to the font used for dynamic signs.  This font does not
6481 contain all characters of the alphabet, so when producing ``piu f'',
6482 the ``piu'' should be done in a different font.
6483
6484
6485 @item \number
6486 This changes to the font used for time signatures. It only contains
6487 numbers and a few punctuation marks.
6488 @item \italic
6489 Changes @code{font-shape} to @code{italic}
6490 @item \bold
6491 Changes @code{font-series} to @code{bold}
6492 @end table
6493
6494 @cindex raising text
6495 @cindex lowering text
6496 @cindex moving text
6497 @cindex translating text
6498
6499 @cindex \sub
6500 @cindex \super
6501
6502 Raising and lowering texts can be done with @code{\super} and
6503 @code{\sub}.
6504
6505 @lilypond[verbatim,fragment,relative=1]
6506  c1^\markup { E "=" mc \super "2" }
6507 @end lilypond
6508
6509 @cindex \raise
6510
6511 If you want to give an explicit amount for lowering or raising, use
6512 @code{\raise}.  This command takes a Scheme valued first argument, and
6513 a markup object as second argument
6514 @c
6515 @lilypond[verbatim,fragment,relative=1,quote]
6516  c1^\markup { C \small \raise #1.0 \bold { "9/7+" }}
6517 @end lilypond
6518 The argument to @code{\raise} is the vertical displacement amount,
6519 measured in (global) staff spaces.
6520
6521 Other commands taking  single arguments include
6522 @table @code
6523
6524 @item \bracket, \hbracket
6525  Bracket the argument markup with normal and horizontal brackets
6526 respectively.
6527
6528 @item \musicglyph
6529 @cindex \musicglyph
6530   This is converted to a musical symbol, e.g. @code{\musicglyph
6531 #"accidentals-0"} will select the natural sign from the music font.
6532 See @ref{The Feta font} for  a complete listing of the possible glyphs.
6533 @item \char
6534 This produces a single character, e.g. @code{\char #65} produces the 
6535 letter 'A'.
6536
6537 @item \hspace #@var{amount}
6538 @cindex \hspace
6539 This produces a invisible object taking horizontal space.
6540 @example 
6541 \markup @{ A \hspace #2.0 B @} 
6542 @end example
6543 will put extra space between A and B, on top of the space that is
6544 normally inserted before elements on a line.
6545
6546 @item \fontsize #@var{size}
6547 @cindex \fontsize
6548 This sets the relative font size, eg.
6549 @example
6550 A \fontsize #2 @{ B C @} D
6551 @end example
6552
6553
6554 This will enlarge the B and the C by two steps.
6555 @item  \translate #(cons @var{x} @var{y})
6556 @cindex  \translate
6557 This translates an object. Its first argument is a cons of numbers
6558 @example
6559 A \translate #(cons 2 -3) @{ B C @} D
6560 @end example
6561 This moves `B C' 2 spaces to the right, and 3 down.
6562
6563 @item \magnify  #@var{mag}
6564 @cindex \magnify
6565 This sets the font magnification for the its argument. In the following
6566 example, the middle A will be 10% larger.
6567 @example
6568 A \magnify #1.1 @{ A @} A
6569 @end example
6570
6571
6572 @item \override #(@var{key} . @var{value})
6573 @cindex \override
6574 This overrides a  formatting property for its argument. The argument
6575 should be a key/value pair, e.g.
6576 @example
6577 m \override #'(font-family . math) m m
6578 @end example
6579 @end table
6580
6581 In markup mode you can compose expressions, similar to mathematical
6582 expressions, XML documents and music expressions.  The braces group
6583 notes into horizontal lines. Other types of lists also exist: you can
6584 stack expressions grouped with @code{<<}, and @code{>>} vertically with
6585 the command @code{\column}. Similarly, @code{\center} aligns texts by
6586 their center lines. 
6587
6588 @lilypond[verbatim,fragment,relative=1]
6589  c1^\markup { \column << a bbbb c >> }
6590  c1^\markup { \center << a bbbb c >> }
6591  c1^\markup { \line << a b c >> }
6592 @end lilypond
6593
6594 The markup mechanism is extensible.  Refer to
6595 @file{scm/new-markup.scm} for more information on extending the markup
6596 mode.
6597
6598
6599
6600 @seealso
6601
6602 @internalsref{Markup functions}, @file{scm/new-markup.scm}
6603
6604 @refbugs
6605
6606 @cindex kerning
6607
6608
6609 Text layout is ultimately done by @TeX{}, which does kerning of
6610 letters.  LilyPond does not account for kerning, so texts will be
6611 spaced slightly too wide.
6612
6613 Syntax errors for markup mode are confusing.
6614
6615
6616 @node Global layout
6617 @section Global layout
6618
6619 The global layout determined by three factors: the page layout, the
6620 line breaks and the spacing. These all influence each other. The
6621 choice of spacing determines how densely each system of music is set,
6622 which influences where line breaks breaks are chosen, and thus
6623 ultimately how many pages a piece of music takes. In this section, the
6624 algorithm for spacing music is explained, and how spacing can be
6625 tuned.
6626
6627 Globally spoken, this procedure happens in three steps: first,
6628 flexible distances (``springs'') are chosen, based on durations. All
6629 possible line breaking combination are tried, and the one with the
6630 best results---a layout that has uniform density and requires as
6631 little stretching or cramping as possible---is chosen. When the score
6632 is processed by @TeX{}, each page is filled with systems, and page breaks
6633 are chosen whenever the page gets full.
6634
6635
6636
6637 @menu
6638 * Vertical spacing::            
6639 * Horizontal spacing::          
6640 * Font Size::                   
6641 * Line breaking::               
6642 * Page layout::                 
6643 @end menu
6644
6645
6646 @node Vertical spacing
6647 @subsection Vertical spacing
6648
6649 @cindex vertical spacing
6650 @cindex distance between staves
6651 @cindex staff distance
6652 @cindex between staves, distance
6653 @cindex staffs per page
6654
6655
6656 The height of each system is determined automatically by lilypond, to
6657 keep systems from bumping into each other, some minimum distances are
6658 set.  By changing these, you can put staves closer together, and thus
6659 put more  systems onto one page.
6660
6661 Normally staves are stacked vertically. To make
6662 staves maintain a distance, their vertical size is padded. This is
6663 done with the property @code{minimumVerticalExtent}. It takes a pair
6664 of numbers, so if you want to make it smaller from its, then you could
6665 set
6666 @example
6667   \property Staff.minimumVerticalExtent = #'(-4 . 4)
6668 @end example
6669 This sets the vertical size of the current staff to 4 staff-space on
6670 either side of the center staff line.  The argument of
6671 @code{minimumVerticalExtent} is interpreted as an interval, where the
6672 center line is the 0, so the first number is generally negative.  The
6673 staff can be made larger at the bottom by setting it to @code{(-6
6674 . 4)}.
6675
6676 The piano staves are handled a little differently: to make cross-staff
6677 beaming work correctly, it necessary that the distance between staves
6678 is fixed beforehand.  This is also done with a
6679 @internalsref{VerticalAlignment} object, created in
6680 @internalsref{PianoStaff}. In this object the distance between the
6681 staves is fixed by setting @code{forced-distance}. If you want to
6682 override this, use a @code{\translator} block as follows:
6683 @example
6684   \translator @{
6685     \PianoStaffContext
6686     VerticalAlignment \override #'forced-distance = #9
6687   @}
6688 @end example
6689 This would bring the staves together at a distance of 9 staff spaces,
6690 measured from the center line of each staff.
6691
6692 @seealso
6693
6694 Vertical aligment of staves is handled by the
6695 @internalsref{VerticalAlignment} object.
6696
6697
6698
6699 @node Horizontal spacing
6700 @subsection Horizontal Spacing
6701
6702 The spacing engine translates differences in durations into
6703 stretchable distances (``springs'') of differing lengths. Longer
6704 durations get more space, shorter durations get less.  The shortest
6705 durations get a fixed amount of space (which is controlled by
6706 @code{shortest-duration-space} in the @internalsref{SpacingSpanner}
6707 object). The longer the duration, the more space it gets: doubling a
6708 duration adds a fixed amount (this amount is controlled by
6709 @code{spacing-increment}) of space to the note.
6710
6711 For example, the following piece contains lots of half, quarter and
6712 8th notes, the eighth note is followed by 1 note head width (NHW). 
6713 The quarter note is followed by 2 NHW, the half by 3 NHW, etc.
6714 @lilypond[fragment, verbatim, relative=1] c2 c4. c8 c4. c8 c4. c8 c8
6715 c8 c4 c4 c4
6716 @end lilypond
6717
6718 Normally, @code{shortest-duration-space} is set to 1.2, which is the
6719 width of a note head, and @code{shortest-duration-space} is set to
6720 2.0, meaning that the shortest note gets 2 NHW (2 times
6721 @code{shortest-duration-space}) of space. For normal notes, this space
6722 is always counted from the left edge of the symbol, so the shortest
6723 notes are generally followed by one NHW of space.
6724
6725 If one would follow the above procedure exactly, then adding a single
6726 32th note to a score that uses 8th and 16th notes, would widen up the
6727 entire score a lot. The shortest note is no longer a 16th, but a 32nd,
6728 thus adding 2 noteheads of space to every note. To prevent this, the
6729 shortest duration for spacing is not the shortest note in the score,
6730 but the most commonly found shortest note.  Notes that are even
6731 shorter this are followed by a space that is proportonial to their
6732 duration relative to the common shortest note.  So if we were to add
6733 only a few 16th notes to the example above, they would be followed by
6734 half a NHW:
6735
6736 @lilypond[fragment, verbatim, relative=2]
6737  c2 c4. c8 c4. c16-[ c-] c4. c8 c8 c8 c4 c4 c4
6738 @end lilypond
6739
6740 The most common shortest duration is determined as follows: in every
6741 measure, the shortest duration is determined. The most common short
6742 duration, is taken as the basis for the spacing, with the stipulation
6743 that this shortest duration should always be equal to or shorter than
6744 1/8th note. The shortest duration is printed when you run lilypond
6745 with @code{--verbose}.  These durations may also be customized. If you
6746 set the @code{common-shortest-duration} in
6747 @internalsref{SpacingSpanner}, then this sets the base duration for
6748 spacing. The maximum duration for this base (normally 1/8th), is set
6749 through @code{base-shortest-duration}.
6750
6751 @cindex @code{common-shortest-duration}
6752 @cindex @code{base-shortest-duration}
6753 @cindex @code{stem-spacing-correction}
6754 @cindex @code{spacing}
6755
6756 In the introduction it was explained that stem directions influence
6757 spacing. This is controlled with @code{stem-spacing-correction}
6758 property in @internalsref{NoteSpacing}, which are generated for every
6759 @internalsref{Voice} context. The @code{StaffSpacing} object
6760 (generated at @internalsref{Staff} context) contains the same property
6761 for controlling the stem/barline spacing. The following example
6762 shows these corrections, once with default settings, and once with
6763 exaggerated corrections.
6764
6765 @lilypond
6766     \score { \notes {
6767       c'4 e''4 e'4 b'4 |
6768       b'4 e''4 b'4 e''4|
6769       \property Staff.NoteSpacing \override #'stem-spacing-correction
6770       = #1.5
6771       \property Staff.StaffSpacing \override #'stem-spacing-correction
6772       = #1.5
6773       c'4 e''4 e'4 b'4 |
6774       b'4 e''4 b'4 e''4|      
6775     }
6776     \paper { raggedright = ##t } }
6777 @end lilypond
6778
6779 @cindex SpacingSpanner, overriding properties
6780
6781 Properties of the  @internalsref{SpacingSpanner} must be overriden
6782 from the @code{\paper} block, since the @internalsref{SpacingSpanner}
6783 is created before any @code{\property} statements are interpreted.
6784 @example
6785 \paper @{ \translator  @{
6786   \ScoreContext
6787   SpacingSpanner \override #'spacing-increment = #3.0
6788 @} @}
6789 @end example
6790
6791
6792 @seealso
6793
6794 @internalsref{SpacingSpanner}, @internalsref{NoteSpacing},
6795 @internalsref{StaffSpacing}, @internalsref{SeparationItem},
6796 @internalsref{SeparatingGroupSpanner}.
6797
6798 @refbugs
6799
6800 Spacing is determined on a score wide basis. If you have a score that
6801 changes its character (measured in durations) halfway during the
6802 score, the part containing the longer durations will be spaced too
6803 widely.
6804
6805 There is no convenient mechanism to manually override spacing.
6806
6807
6808
6809 @node Font Size
6810 @subsection Font size
6811 @cindex font size, setting
6812 @cindex staff size, setting
6813 @cindex @code{paper} file
6814
6815 The Feta font provides musical symbols at seven different sizes.
6816 These fonts are 11 point, 13 point, 16 point, 20 point, 23 point, and
6817 26 point.  The point size of a font is the height of the corresponding
6818 staff (excluding line thicknesses).
6819
6820 Definitions for these sizes are the files @file{paperSZ.ly}, where
6821 @code{SZ} is one of 11, 13, 16, 20, 23 and 26.  If you include any
6822 of these files, the variables @code{paperEleven},
6823 @code{paperThirteen}, @code{paperSixteen}, 
6824 @code{paperTwenty}, @code{paperTwentythree}, and @code{paperTwentysix}
6825 are defined respectively.  The default @code{\paper} block is also
6826 set. These files should be imported at toplevel, i.e.
6827 @example
6828         \include "paper26.ly"
6829         \score @{  ... @}
6830 @end example
6831
6832 The font definitions are generated using a Scheme function. For more
6833 details, see the file @file{scm/font.scm}.
6834
6835
6836
6837 @node Line breaking
6838 @subsection Line breaking
6839
6840 @cindex line breaks
6841 @cindex breaking lines
6842
6843 Line breaks are normally computed automatically. They are chosen such
6844 that lines look neither cramped nor loose, and that consecutive lines
6845 have similar density.
6846
6847 Occasionally you might want to override the automatic breaks; you can
6848 do this by  specifying @code{\break}. This will force a line break at
6849 this point.  Line breaks can only occur at places where there are bar
6850 lines.  If you want to have a line break where there is no bar line,
6851 you can force an invisible bar line by entering @code{\bar
6852 ""}. Similarly, @code{\noBreak} forbids a line break at a 
6853 point.
6854
6855
6856 @cindex regular line breaks
6857 @cindex four bar music. 
6858
6859 If you want linebreaks at regular intervals, you can use the following:
6860 @example
6861 <  \repeat unfold 7 @{ s1 * 4 \break  @}
6862    @emph{the real music}
6863
6864 @end  example
6865 This makes the following 28 measures (assuming 4/4 time) be broken every
6866 4 measures.
6867
6868 @seealso
6869
6870 @internalsref{BreakEvent}
6871
6872
6873 @node Page layout
6874 @subsection Page layout
6875
6876 @cindex page breaks
6877 @cindex breaking pages
6878
6879 @cindex @code{indent}
6880 @cindex @code{linewidth}
6881
6882 The most basic settings influencing the spacing are @code{indent} and
6883 @code{linewidth}. They are set in the @code{\paper} block. They
6884 control the indentation of the first line of music, and the lengths of
6885 the lines.
6886
6887 If  @code{raggedright} is set to true in the @code{\paper}
6888 block, then the lines are justified at their natural length. This
6889 useful for short fragments, and for checking how tight the natural
6890 spacing is.
6891
6892 @cindex page layout
6893 @cindex vertical spacing
6894
6895 The page layout process happens outside the LilyPond formatting
6896 engine: variables controlling page layout are passed to the output,
6897 and are further interpreted by @code{ly2dvi}. @code{ly2dvi} responds
6898 to the following variables in the @code{\paper} block.  The variable
6899 @code{textheight} sets the total height of the music on each page.
6900 The spacing between systems is controlled with @code{interscoreline},
6901 its default is 16pt.  The distance between the score lines will
6902 stretch in order to fill the full page @code{interscorelinefill} is
6903 set to a positive number.  In that case @code{interscoreline}
6904 specifies the minimum spacing.
6905
6906 @cindex @code{textheight}
6907 @cindex @code{interscoreline}
6908 @cindex @code{interscorelinefill}
6909
6910 If the variable @code{lastpagefill} is defined,
6911 @c fixme: this should only be done if lastpagefill == #t 
6912 systems are evenly distributed vertically on the last page.  This
6913 might produce ugly results in case there are not enough systems on the
6914 last page.  The @command{lilypond-book} command ignores
6915 @code{lastpagefill}.  See @ref{lilypond-book manual} for more
6916 information.
6917
6918 @cindex @code{lastpagefill}
6919
6920 Page breaks are normally computed by @TeX{}, so they are not under
6921 direct control of LilyPond.  However, you can insert a commands into
6922 the @file{.tex} output to instruct @TeX{} where to break pages.  This
6923 is done by setting the @code{between-systems-strings} on the
6924 @internalsref{NonMusicalPaperColumn} where the system is broken.
6925 An example is shown in @inputfileref{input/regression,between-systems.ly}.
6926
6927 @cindex paper size
6928 @cindex page size
6929 @cindex @code{papersize}
6930
6931 To change the paper size, you must first set the
6932 @code{papersize} paper variable variable.  Set it to
6933 the strings @code{a4}, @code{letter}, or @code{legal}.  After this
6934 specification, you must set the font as described above.  If you want
6935 the default font, then use the 20 point font.
6936
6937 @example
6938         \paper@{ papersize = "a4" @}
6939         \include "paper16.ly"
6940 @end example
6941
6942 The file @code{paper16.ly}  will now include a file named @file{a4.ly}, which
6943 will set the paper variables @code{hsize} and @code{vsize} (used by
6944 Lilypond and @code{ly2dvi})
6945
6946
6947 @seealso
6948
6949 @ref{Invoking ly2dvi},
6950 @inputfileref{input/regression,between-systems.ly},
6951 @internalsref{NonMusicalPaperColumn}.
6952
6953 @refbugs
6954
6955 There is no concept of page breaking, which makes it difficult to
6956 choose sensible page breaks in multi-page pieces.
6957
6958
6959
6960
6961 @node Sound
6962 @section Sound
6963 @cindex Sound
6964
6965 Entered music can also be converted to MIDI output.  The performance
6966 is good enough for proof-hearing the music for errors.
6967
6968
6969 Ties, dynamics and tempo changes are interpreted.  Dynamic marks,
6970 crescendi and decrescendi translate into MIDI volume levels.  Dynamic
6971 marks translate to a fixed fraction of the available MIDI volume
6972 range, crescendi and decrescendi make the volume vary linearly
6973 between their two extremities.  The fractions be adjusted by
6974 @code{dynamicAbsoluteVolumeFunction} in @internalsref{Voice} context.
6975
6976 For each type of musical instrument (that MIDI supports), a volume range
6977 can be defined.  This gives you basic equalizer control, which can
6978 enhance the quality of the MIDI output remarkably.  The equalizer
6979 can be controlled by setting @code{instrumentEqualizer}.
6980
6981 Both loudness controls are combined to produce the final  MIDI volume. 
6982
6983 @refbugs
6984
6985 Many musically interesting effects, such as swing, articulation,
6986 slurring, etc., are translated to MIDI.
6987
6988
6989 @menu
6990 * MIDI block::                  
6991 * MIDI instrument names::       
6992 @end menu
6993
6994
6995 @node MIDI block
6996 @subsection MIDI block
6997 @cindex MIDI block
6998
6999
7000 The MIDI block is analogous to the paper block, but it is somewhat
7001 simpler.  The @code{\midi} block can contain:
7002 @cindex MIDI block
7003
7004 @itemize @bullet
7005   @item  a @code{\tempo} definition
7006   @item  context definitions
7007 @end itemize
7008
7009 Assignments in the @code{\midi} block are not allowed.
7010
7011
7012
7013 @cindex context definition
7014
7015 Context definitions follow precisely the same syntax as within the
7016 \paper block.  Translation modules for sound are called performers.
7017 The contexts for MIDI output are defined in @file{ly/performer-init.ly}.
7018
7019
7020 @node MIDI instrument names
7021 @subsection MIDI instrument names
7022
7023 @cindex instrument names
7024 @cindex @code{Staff.midiInstrument}
7025 @cindex @code{Staff.instrument}
7026
7027 The MIDI instrument name is set by the @code{Staff.midiInstrument}
7028 property or, if that property is not set, the @code{Staff.instrument}
7029 property.  The instrument name should be chosen from the list in
7030 @ref{MIDI instruments}.
7031
7032 @refbugs
7033
7034 If the selected string does not exactly match, then LilyPond uses the
7035 default (Grand Piano). It is not possible to select an instrument by
7036 number.
7037
7038