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