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