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