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