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