]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/notation.itely
* lily/parser.yy (relative_music): start at middle C without pitch
[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[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[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[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[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[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 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 whichBar
1184 @cindex repeatCommands
1185 @cindex 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[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 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
1757 @c TODO: should explain that ^( and _( set directions
1758 @c should set attachments with ^ and _ ?  
1759
1760 Slurs avoid crossing stems, and are generally attached to note heads.
1761 However, in some situations with beams, slurs may be attached to stem
1762 ends.  If you want to override this layout you can do this through the
1763 object property @code{attachment} of @internalsref{Slur}.  Its value
1764 is a pair of symbols, specifying the attachment type of the left and
1765 right end points
1766
1767 @lilypond[quote,fragment,relative=1,verbatim]
1768 \slurUp
1769 \override Stem #'length = #5.5
1770 g'8(g g4)
1771 \override Slur #'attachment = #'(stem . stem)
1772 g8( g g4)
1773 @end lilypond
1774
1775 If a slur would strike through a stem or beam, the slur will be moved
1776 away upward or downward. If this happens, attaching the slur to the
1777 stems might look better
1778
1779 @lilypond[quote,fragment,relative=1,verbatim]
1780 \stemUp \slurUp
1781 d32( d'4 d8..)
1782 \override Slur #'attachment = #'(stem . stem)
1783 d,32( d'4 d8..)
1784 @end lilypond
1785
1786 @refcommands
1787
1788
1789 @cindex @code{\slurUp}
1790 @code{\slurUp}, 
1791 @cindex @code{\slurDown}
1792 @code{\slurDown}, 
1793 @cindex @code{\slurBoth}
1794 @code{\slurBoth}, 
1795 @cindex @code{\slurDotted}
1796 @code{\slurDotted}, 
1797 @cindex @code{\slurSolid}
1798 @code{\slurSolid}.
1799
1800 @seealso
1801
1802 Program reference: @seeinternals{Slur}, and @internalsref{SlurEvent}.
1803
1804
1805 @refbugs
1806
1807 Producing nice slurs is a difficult problem, and LilyPond 
1808 uses a simple, empiric method to produce slurs. In some cases, its
1809 results are ugly.
1810
1811
1812 @cindex Adjusting slurs
1813
1814 @node Phrasing slurs
1815 @subsection Phrasing slurs
1816
1817 @cindex phrasing slurs
1818 @cindex phrasing marks
1819
1820 A phrasing slur (or phrasing mark) connects chords and is used to
1821 indicate a musical sentence. It is started using @code{\(} and @code{\)}
1822 respectively
1823
1824 @lilypond[quote,fragment,verbatim,relative=1]
1825 \time 6/4 c'\( d( e) f( e)  d\) 
1826 @end lilypond
1827
1828 Typographically, the phrasing slur behaves almost exactly like a
1829 normal slur.  However, they are treated as different objects.  A
1830 @code{\slurUp} will have no effect on a phrasing slur; instead, you
1831 should use @code{\phrasingSlurUp}, @code{\phrasingSlurDown}, and
1832 @code{\phrasingSlurBoth}.
1833
1834 The commands @code{\slurUp}, @code{\slurDown}, and @code{\slurBoth}
1835 will only affect normal slurs and not phrasing slurs.
1836
1837 @refcommands
1838
1839 @cindex @code{\phrasingSlurUp}
1840 @code{\phrasingSlurUp}, 
1841 @cindex @code{\phrasingSlurDown}
1842 @code{\phrasingSlurDown}, 
1843 @cindex @code{\phrasingSlurBoth}
1844 @code{\phrasingSlurBoth}.
1845
1846 @seealso
1847
1848 Program reference: see also @internalsref{PhrasingSlur}, and
1849 @internalsref{PhrasingSlurEvent}.
1850
1851 @refbugs
1852
1853 Phrasing slurs have the same limitations in their formatting as normal
1854 slurs. Putting phrasing slurs over rests leads to spurious warnings.
1855
1856 @node Breath marks
1857 @subsection Breath marks
1858
1859 Breath marks are entered using @code{\breathe}
1860
1861
1862 @lilypond[quote,fragment,relative=1,verbatim]
1863 c'4 \breathe d4
1864 @end lilypond
1865
1866 The glyph of the breath mark can be tuned by overriding the
1867 @code{text} property of the @code{BreathingSign} layout object with
1868 any markup text.   For example,
1869 @lilypond[quote,fragment,verbatim,relative=1]
1870 c'4
1871 \override BreathingSign #'text
1872   = #(make-musicglyph-markup "scripts-rvarcomma")
1873 \breathe
1874 d4
1875 @end lilypond
1876
1877 @seealso 
1878
1879 Program reference: @internalsref{BreathingSign},
1880 @internalsref{BreathingSignEvent}.
1881
1882 Examples: @inputfileref{input/regression,breathing-sign.ly}.
1883
1884
1885 @node Metronome marks
1886 @subsection Metronome marks
1887
1888 @cindex Tempo
1889 @cindex beats per minute
1890 @cindex metronome marking
1891
1892 Metronome settings can be entered as follows
1893 @example 
1894   \tempo @var{duration} = @var{per-minute} 
1895 @end example
1896
1897 In the MIDI output, they are interpreted as a tempo change, and in the
1898 paper output, a metronome marking is printed
1899 @cindex @code{\tempo}
1900 @lilypond[quote,fragment,verbatim]
1901 \tempo 8.=120 c''1
1902 @end lilypond
1903
1904 @seealso
1905
1906 Program reference: @internalsref{MetronomeChangeEvent}.
1907   
1908
1909
1910 @node Text spanners
1911 @subsection Text spanners
1912 @cindex Text spanners
1913
1914 Some performance indications, e.g. @i{rallentando} or @i{accelerando},
1915 are written as texts, and extended over many measures with dotted
1916 lines.  You can create such texts using text spanners: attach
1917 @code{\startTextSpan} and @code{\stopTextSpan} to the
1918 start and ending note of the spanner. 
1919
1920 The string to be printed, as well as the style, is set through object
1921 properties
1922
1923 @lilypond[quote,fragment,relative=1,verbatim]
1924 \relative c' {
1925   c1 
1926   \override TextSpanner #'direction = #-1
1927   \override TextSpanner #'edge-text = #'("rall " . "")
1928   c2\startTextSpan b c\stopTextSpan a
1929 }
1930 @end lilypond
1931
1932
1933 @seealso
1934
1935 Internals @internalsref{TextSpanEvent},
1936 @internalsref{TextSpanner}.
1937
1938 Examples: @inputfileref{input/regression,text-spanner.ly}.
1939
1940
1941 @node Analysis brackets
1942 @subsection Analysis brackets
1943 @cindex brackets
1944 @cindex phrasing brackets
1945 @cindex musicological analysis
1946 @cindex note grouping bracket
1947
1948 Brackets are used in musical analysis to indicate structure in musical
1949 pieces. LilyPond supports a simple form of nested horizontal brackets.
1950 To use this, add the @internalsref{Horizontal_bracket_engraver} to
1951 @internalsref{Staff} context.  A bracket is started with
1952 @code{\startGroup} and closed with @code{\stopGroup}
1953
1954 @lilypond[quote,raggedright,verbatim]
1955 \score {
1956   \notes \relative c'' {  
1957     c4\startGroup\startGroup
1958     c4\stopGroup
1959     c4\startGroup
1960     c4\stopGroup\stopGroup
1961   }
1962   \paper {
1963     \context {
1964       \Staff \consists "Horizontal_bracket_engraver"
1965 }}}
1966 @end lilypond
1967
1968 @seealso
1969
1970 Program reference: @internalsref{HorizontalBracket},
1971 @internalsref{NoteGroupingEvent}.
1972
1973 Examples: @inputfileref{input/regression,note-group-bracket.ly}. 
1974
1975
1976 @node Articulations
1977 @subsection Articulations
1978 @cindex Articulations
1979
1980 @cindex articulations
1981 @cindex scripts
1982 @cindex ornaments
1983
1984 A variety of symbols can appear above and below notes to indicate
1985 different characteristics of the performance. They are added to a note
1986 by adding a dash and  the character signifying the
1987 articulation. They are demonstrated here
1988
1989 @lilypondfile[quote,raggedright]{script-abbreviations.ly}
1990
1991 The meanings of these shorthands can be changed. See
1992 @file{ly/script-init.ly} for examples.
1993
1994
1995 The script is automatically placed, but if you need to force
1996 directions, you can use @code{_} to force them down, or @code{^} to
1997 put them up
1998 @lilypond[quote,fragment,verbatim]
1999 c''4^^ c''4_^
2000 @end lilypond
2001
2002 Other symbols can be added using the syntax
2003 @var{note}@code{\}@var{name}, e.g. @code{c4\fermata}. Again, they
2004 can be forced up or down using @code{^} and @code{_},
2005 e.g.
2006
2007 @lilypond[quote,verbatim,fragment,relative=3]
2008 c\fermata c^\fermata c_\fermata
2009 @end lilypond
2010
2011
2012
2013 @cindex accent
2014 @cindex marcato
2015 @cindex staccatissimo
2016 @cindex fermata
2017 @cindex stopped
2018 @cindex staccato
2019 @cindex portato
2020 @cindex tenuto
2021 @cindex upbow
2022 @cindex downbow
2023 @cindex foot marks
2024 @cindex organ pedal marks
2025 @cindex turn
2026 @cindex open
2027 @cindex flageolet
2028 @cindex reverseturn
2029 @cindex trill
2030 @cindex prall
2031 @cindex mordent
2032 @cindex prallprall
2033 @cindex prallmordent
2034 @cindex prall, up
2035 @cindex prall, down
2036 @cindex mordent
2037 @cindex thumb marking
2038 @cindex segno
2039 @cindex coda
2040 @cindex varcoda
2041
2042 @lilypondfile[quote,raggedright]{script-chart.ly}
2043
2044 @refcommands
2045
2046 @cindex @code{\scriptUp}
2047 @code{\scriptUp}, 
2048 @cindex @code{\scriptDown}
2049 @code{\scriptDown}, 
2050 @cindex @code{\scriptBoth}
2051 @code{\scriptBoth}.
2052
2053 @seealso
2054
2055 Program reference: @internalsref{ScriptEvent}, and @internalsref{Script}.
2056
2057 @refbugs
2058
2059 These note ornaments appear in the printed output but have no
2060 effect on the MIDI rendering of the music.
2061
2062
2063 @node Fingering instructions
2064 @subsection Fingering instructions
2065
2066 @cindex fingering
2067
2068 Fingering instructions can be entered using
2069 @example
2070   @var{note}-@var{digit}
2071 @end example
2072 For finger changes, use markup texts
2073 @c
2074 @lilypond[quote,verbatim,raggedright,fragment]
2075 c'4-1 c'4-2 c'4-3 c'4-4
2076 c'^\markup { \finger "2-3" }
2077 @end lilypond
2078
2079 @cindex finger change
2080 @cindex scripts
2081 @cindex superscript
2082 @cindex subscript
2083
2084 You can use the thumb-script to indicate that a note should be
2085 played with the thumb (e.g. in cello music)
2086
2087 @lilypond[quote,verbatim,raggedright,fragment]
2088 <a' a''-3>8_\thumb <b' b''-3>_\thumb
2089 @end lilypond
2090
2091 Fingerings for chords can also be added to individual notes
2092 of the chord by adding them after the pitches
2093 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
2094 < c-1 e-2 g-3 b-5 >4
2095 @end lilypond
2096
2097 @noindent
2098 iIn this case, setting @code{fingeringOrientations} will put  fingerings next
2099 to note heads
2100
2101 @lilypond[quote,verbatim,raggedright,fragment,relative=1]
2102 \set fingeringOrientations = #'(left down)
2103 <c-1 es-2 g-4 bes-5 > 4
2104 \set fingeringOrientations = #'(up right down)
2105 <c-1 es-2 g-4 bes-5 > 4
2106 \set fingeringOrientations = #'(right)
2107 <es-2>4
2108 @end lilypond
2109
2110 The last note demonstrates how fingering instructions can be put close
2111 to note heads in monophonic music, using this feature.
2112         
2113 @seealso
2114
2115 Program reference: @internalsref{FingerEvent}, and @internalsref{Fingering}.
2116
2117 Examples: @inputfileref{input/regression,finger-chords.ly}.
2118
2119 @node Text scripts
2120 @subsection Text scripts
2121 @cindex Text scripts
2122
2123 @cindex text items, non-empty
2124 @cindex non-empty texts
2125
2126 It is possible to place arbitrary strings of text or markup text (see
2127 @ref{Text markup}) above or below notes by using a string
2128 @code{c^"text"}.  By default, these indications do not influence the
2129 note spacing, but by using the command @code{\fatText}, the widths
2130 will be taken into account
2131 @c
2132 @lilypond[quote,fragment,raggedright,verbatim]
2133 \relative c' {
2134   c4^"longtext" \fatText c4_"longlongtext" c4
2135 }
2136 @end lilypond
2137
2138 It is possible to use @TeX{} commands in the strings, but this should
2139 be avoided because the exact dimensions of the string can then no
2140 longer be computed.
2141
2142 @refcommands
2143
2144 @cindex @code{\fatText}
2145 @code{\fatText}, 
2146 @cindex @code{\emptyText}
2147 @code{\emptyText}.
2148
2149 @seealso
2150
2151 In this manual: @ref{Text markup}.
2152
2153 Program reference: @internalsref{TextScriptEvent}, @internalsref{TextScript}.
2154
2155
2156
2157
2158 @node Grace notes
2159 @subsection Grace notes
2160
2161
2162 @c should have blurb about accaciatura / appogiatura
2163
2164 @cindex @code{\grace}
2165 @cindex ornaments
2166 @cindex grace notes
2167
2168 Grace notes are ornaments that are written out.  The most common ones
2169 are acciaccatura, which should be played as very short.  It is denoted
2170 by a slurred small note with a slashed stem.  The appoggiatura is a
2171 grace note that takes a fixed fraction of the main note, is and
2172 denoted as a slurred note in small print without a slash.
2173 They are entered with the commands @code{\acciaccatura} and
2174 @code{\appoggiatura}, as demonstrated in the following example
2175
2176
2177 @cindex appoggiatura
2178 @cindex acciaccatura
2179
2180 @lilypond[quote,relative=2,verbatim,fragment]
2181 b4 \acciaccatura d8 c4 \appoggiatura e8 d4
2182 \acciaccatura { g16[ f] } e4
2183 @end lilypond
2184
2185 Both are special forms of the @code{\grace} command. By prefixing this
2186 keyword to a music expression, a new one is formed, which will be
2187 printed in a smaller font and takes up no logical time in a measure.
2188
2189 @lilypond[quote,relative=2,verbatim,fragment]
2190 c4 \grace c16 c4
2191 \grace { c16[ d16] } c2 c4
2192 @end lilypond
2193
2194 @noindent
2195 Unlike @code{\acciaccatura} and @code{\appoggiatura}, the
2196 @code{\grace} command does not start a slur.
2197
2198 Internally, timing for grace notes is done using a second, `grace'
2199 time. Every point in time consists of two rational numbers: one
2200 denotes the logical time, one denotes the grace timing. The above
2201 example is shown here with timing tuples
2202
2203 @lilypond[quote,raggedright]
2204 <<
2205   \relative c''{ 
2206     c4 \grace c16  c4  \grace {
2207     c16[  d16] } c2 c4
2208   }
2209   \new Lyrics \lyrics {
2210     \markup { (0,0) } 4
2211     \grace { \markup {
2212       ( \fraction 1 4 ,  \fraction -1 16 ) } 16 }
2213     \markup { (\fraction 1 4 , 0 ) } 4
2214     \grace {
2215       \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16
2216       \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16
2217     } 
2218     \markup { ( \fraction 2 4 , 0 ) }
2219   }
2220 >>
2221 @end lilypond
2222
2223
2224 The placement of grace notes is synchronized between different staves.
2225 In the following example, there are two sixteenth graces notes for
2226 every eighth grace note
2227
2228 @lilypond[quote,relative=2,verbatim,fragment] 
2229 << \new Staff { e4 \grace { c16[ d e f] } e4 }
2230    \new Staff { c'4 \grace { g8[ b] } c4 } >>
2231 @end lilypond
2232
2233
2234
2235 If you want to end a note with a grace, the standard trick is to put
2236 the grace notes after a ``space note''
2237
2238 @lilypond[quote,fragment,verbatim,relative=2]
2239 \context Voice {
2240   << { d1^\trill ( }
2241      { s2 \grace { c16[ d] } } >>
2242   c4)
2243 }
2244 @end lilypond
2245
2246 @noindent
2247 By adjusting the duration of the skip note (here it is a half-note),
2248 the space between the main-note and the grace is adjusted.
2249
2250
2251 A @code{\grace} section will introduce special typesetting settings,
2252 for example, to produce smaller type, and set directions. Hence, when
2253 introducing layout tweaks, they should be inside the grace section,
2254 for example,
2255 @lilypond[quote,fragment,verbatim,relative=2]
2256 \new Voice {
2257   \acciaccatura {
2258     \override Stem #'direction = #-1
2259     f16->
2260     \revert Stem #'direction
2261   }
2262   g4
2263 }
2264 @end lilypond
2265
2266 @noindent
2267 The overrides should also be reverted inside the grace section.
2268
2269 If the layout of grace sections must be changed throughout the music,
2270 then this can be accomplished through the function
2271 @code{add-grace-property}. The following example undefines the Stem
2272 direction for this grace, so stems do not always point up.
2273
2274 @example
2275 \new Staff @{
2276    #(add-grace-property 'Voice 'Stem 'direction '())
2277    @dots{}
2278 @}
2279 @end example
2280
2281 @noindent
2282 Another option is to change the variables @code{startGraceMusic},
2283 @code{stopGraceMusic}, @code{startAccacciaturaMusic},
2284 @code{stopAccacciaturaMusic}, @code{startAppoggiaturaMusic},
2285 @code{stopAppoggiaturaMusic}.  More information is in the file
2286 @file{ly/grace-init.ly}.
2287
2288
2289 @seealso
2290
2291 Program reference: @internalsref{GraceMusic}.
2292
2293 @refbugs
2294
2295 A score that starts with an @code{\grace} section needs an explicit
2296 @code{\context Voice} declaration, otherwise the main note and grace
2297 note end up on different staves.
2298
2299 Grace note synchronization can also lead to surprises. Staff notation,
2300 such as key signatures, bar lines, etc. are also synchronized. Take
2301 care when you mix staves with grace notes and staves without, for example,
2302
2303 @lilypond[quote,relative=2,verbatim,fragment]
2304 << \new Staff { e4 \bar "|:" \grace c16 d4 }
2305    \new Staff { c4  \bar "|:"  d4 } >>
2306 @end lilypond
2307
2308 @noindent
2309 This can be remedied by inserting grace skips, for the above example
2310
2311 @example
2312 \new Staff @{ c4  \bar "|:"  \grace s16 d4 @} >>
2313 @end example
2314
2315 Grace sections should only be used within sequential music
2316 expressions.  Nesting or juxtaposing grace sections is not supported,
2317 and might produce crashes or other errors.
2318
2319
2320 @node Glissando
2321 @subsection Glissando
2322 @cindex Glissando 
2323
2324 @cindex @code{\glissando}
2325
2326 A glissando is a smooth change in pitch. It is denoted by a line or a
2327 wavy line between two notes.
2328
2329
2330 A glissando line can be requested by attaching a @code{\glissando} to
2331 a note
2332
2333 @lilypond[quote,fragment,relative=1,verbatim]
2334 c'\glissando c'
2335 @end lilypond
2336
2337 @seealso
2338
2339 Program reference: @internalsref{Glissando}, and @internalsref{GlissandoEvent}.
2340
2341 Example files: @file{input/regression,glissando.ly}
2342
2343  
2344
2345 @refbugs
2346
2347 Printing text over the line (such as @emph{gliss.}) is not supported.
2348
2349
2350 @node Dynamics
2351 @subsection Dynamics
2352 @cindex Dynamics
2353
2354
2355
2356 @cindex @code{\ppp}
2357 @cindex @code{\pp}
2358 @cindex @code{\p}
2359 @cindex @code{\mp}
2360 @cindex @code{\mf}
2361 @cindex @code{\f}
2362 @cindex @code{\ff}
2363 @cindex @code{\fff}
2364 @cindex @code{\ffff}
2365 @cindex @code{\fp}
2366 @cindex @code{\sf}
2367 @cindex @code{\sff}
2368 @cindex @code{\sp}
2369 @cindex @code{\spp}
2370 @cindex @code{\sfz}
2371 @cindex @code{\rfz}
2372
2373
2374 Absolute dynamic marks are specified using a command after a note
2375 @code{c4\ff}.  The available dynamic marks are @code{\ppp},
2376 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2377 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
2378 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}
2379
2380 @lilypond[quote,verbatim,raggedright,fragment,relative=1]
2381 c'\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
2382 c2\sf c\rfz
2383 @end lilypond
2384
2385 @cindex @code{\<}
2386 @cindex @code{\>}
2387 @cindex @code{\"!}
2388
2389
2390
2391 A crescendo mark is started with @code{\<} and terminated with
2392 @code{\!}. A decrescendo is started with @code{\>} and also terminated
2393 with @code{\!}.  Because these marks are bound to notes, if you must
2394 use spacer notes if multiple marks during one note are needed
2395
2396 @lilypond[quote,fragment,verbatim]
2397 c''\< c''\! d''\> e''\! 
2398 << f''1 { s4 s4\< s4\! \> s4\! } >>
2399 @end lilypond
2400 This may give rise to very short hairpins. Use @code{minimum-length}
2401 in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for
2402 example
2403
2404 @example
2405  \override Staff.Hairpin #'minimum-length = #5
2406 @end example
2407
2408 You can also use a text saying @emph{cresc.} instead of hairpins. Here
2409 is an example how to do it
2410
2411 @lilypond[quote,fragment,relative=2,verbatim]
2412 \setTextCresc
2413 c \< d e f\!
2414 \setHairpinCresc
2415 e\> d c b\!
2416 @end lilypond
2417
2418 @cindex crescendo
2419 @cindex decrescendo
2420
2421 You can also supply your own texts
2422 @lilypond[quote,fragment,relative=1,verbatim]
2423 \context Voice {
2424   \set crescendoText = \markup { \italic "cresc. poco" }
2425   \set crescendoSpanner = #'dashed-line
2426   a'2\< a a a\!\mf
2427 }
2428 @end lilypond
2429
2430 @cindex diminuendo
2431
2432
2433 @refcommands
2434
2435 @cindex @code{\dynamicUp}
2436 @code{\dynamicUp}, 
2437 @cindex @code{\dynamicDown}
2438 @code{\dynamicDown}, 
2439 @cindex @code{\dynamicBoth}
2440 @code{\dynamicBoth}.
2441
2442 @cindex direction, of dynamics
2443
2444 @seealso
2445
2446 Program reference: @internalsref{CrescendoEvent},
2447 @internalsref{DecrescendoEvent}, and
2448 @internalsref{AbsoluteDynamicEvent}.
2449
2450 Dynamics @internalsref{DynamicText} and @internalsref{Hairpin}
2451 objects. Vertical positioning of these symbols is handled by the
2452 @internalsref{DynamicLineSpanner} object.
2453
2454
2455 @node Repeats
2456 @section Repeats
2457
2458
2459 @cindex repeats
2460 @cindex @code{\repeat}
2461
2462
2463 Repetition is a central concept in music, and multiple notations exist
2464 for repetitions. In LilyPond, most of these notations can be captured
2465 in a uniform syntax. One of the advantages is that they can be
2466 rendered in MIDI accurately.
2467
2468 The following types of repetition are supported
2469
2470 @table @code
2471 @item unfold
2472 Repeated music is fully written (played) out.  Useful for MIDI
2473 output, and entering repetitive music.
2474
2475 @item volta
2476 This is the normal notation: Repeats are not written out, but
2477 alternative endings (volte) are printed, left to right.
2478
2479 @ignore
2480 @item fold
2481 Alternative endings are written stacked. This has limited use but may be
2482 used to typeset two lines of lyrics in songs with repeats, see
2483 @inputfileref{input,star-spangled-banner.ly}.
2484 @end ignore
2485
2486 @c tremolo, beamed
2487 @item tremolo
2488 Make tremolo beams.
2489
2490 @item percent
2491 Make beat or measure repeats. These look like percent signs.
2492
2493 @end table  
2494
2495 @menu
2496 * Repeat syntax::               
2497 * Repeats and MIDI::            
2498 * Manual repeat commands::      
2499 * Tremolo repeats::             
2500 * Tremolo subdivisions::        
2501 * Measure repeats::             
2502 @end menu
2503
2504 @node Repeat syntax
2505 @subsection Repeat syntax
2506
2507
2508 LilyPond has one syntactic construct for specifying different types of
2509 repeats.  The syntax is
2510
2511 @example
2512   \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2513 @end example
2514
2515 If you have alternative endings, you may add
2516 @cindex @code{\alternative}
2517 @example
2518  \alternative @code{@{} @var{alternative1}
2519             @var{alternative2}
2520             @var{alternative3} @dots{} @code{@}}
2521 @end example
2522 where each @var{alternative} is a music expression.  If you do not
2523 give enough alternatives for all of the repeats, the first alternative
2524 is assumed to be played more than once.
2525
2526 Normal notation repeats are used like this
2527 @lilypond[quote,fragment,verbatim,relative=2]
2528 c1
2529 \repeat volta 2 { c4 d e f }
2530 \repeat volta 2 { f e d c }
2531 @end lilypond
2532
2533 With alternative endings
2534 @lilypond[quote,fragment,verbatim,relative=2]
2535 c1
2536 \repeat volta 2 {c4 d e f} 
2537 \alternative { {d2 d} {f f,} }
2538 @end lilypond
2539
2540
2541 @lilypond[quote,fragment,verbatim,relative=2]
2542 \context Staff {
2543   \partial 4
2544   \repeat volta 4 { e | c2 d2 | e2 f2 | }
2545   \alternative { { g4 g g } { a | a a a a | b2. } }
2546 }
2547 @end lilypond
2548
2549 @refbugs
2550
2551 A nested repeat like
2552
2553 @example 
2554 \repeat @dots{}
2555 \repeat @dots{}
2556 \alternative 
2557 @end example 
2558
2559 @noindent
2560 is ambiguous, since it is is not clear to which @code{\repeat} the
2561 @code{\alternative} belongs. This ambiguity is resolved by always
2562 having the @code{\alternative} belong to the inner @code{\repeat}.
2563 For clarity, it is advisable to use braces in such situations.
2564 @cindex ambiguity
2565
2566 @node Repeats and MIDI
2567 @subsection Repeats and MIDI
2568
2569 @cindex expanding repeats
2570
2571 For instructions on how to expand repeats for MIDI output, see the
2572 example file @inputfileref{input/test,unfold-all-repeats.ly}.
2573
2574
2575 @refbugs
2576
2577 Timing information is not remembered at the start of an alternative,
2578 so after a repeat timing information must be reset by hand, for
2579 example by setting @code{Score.measurePosition} or entering
2580 @code{\partial}.  Similarly, slurs or ties are also not repeated.
2581
2582
2583 @node Manual repeat commands
2584 @subsection Manual repeat commands
2585
2586 @cindex @code{repeatCommands}
2587
2588 The property @code{repeatCommands} can be used to control the layout of
2589 repeats. Its value is a Scheme list of repeat commands, where each repeat
2590 command can be
2591
2592 @table @asis
2593 @item the symbol @code{start-repeat},
2594   which prints a @code{|:} bar line,
2595 @item the symbol @code{end-repeat},
2596   which prints a @code{:|} bar line,
2597 @item the list @code{(volta @var{text})},
2598   which prints a volta bracket saying @var{text}: The text can be specified as
2599 a text string or as a markup text, see @ref{Text markup}. Do not
2600 forget to change the font, as the default number font does not contain
2601 alphabetic characters. Or,
2602 @item the list @code{(volta #f)}, which 
2603   stops a running volta bracket
2604 @end table
2605
2606 @lilypond[quote,verbatim,fragment,relative=2]
2607 c4
2608   \set Score.repeatCommands = #'((volta "93") end-repeat)
2609 c4 c4
2610   \set Score.repeatCommands = #'((volta #f))
2611 c4 c4
2612 @end lilypond
2613
2614
2615 @seealso
2616
2617 Program reference: @internalsref{VoltaBracket}, @internalsref{RepeatedMusic},
2618 @internalsref{VoltaRepeatedMusic},
2619 @internalsref{UnfoldedRepeatedMusic}, and
2620 @internalsref{FoldedRepeatedMusic}.
2621
2622 @node Tremolo repeats
2623 @subsection Tremolo repeats
2624 @cindex tremolo beams
2625
2626 To place tremolo marks between notes, use @code{\repeat} with tremolo
2627 style
2628 @lilypond[quote,verbatim,raggedright]
2629 \score { 
2630   \context Voice \notes\relative c' {
2631     \repeat "tremolo" 8 { c16 d16 }
2632     \repeat "tremolo" 4 { c16 d16 }    
2633     \repeat "tremolo" 2 { c16 d16 }
2634   }
2635 }
2636 @end lilypond
2637
2638 Tremolo marks can also be put on a single note.  In this case, the
2639 note should not be surrounded by braces.
2640 @lilypond[quote,verbatim,raggedright]
2641 \repeat "tremolo" 4 c'16
2642 @end lilypond
2643
2644 A similar mechanism  is the tremolo subdivision, described in
2645 @ref{Tremolo subdivisions}.
2646
2647 @seealso
2648
2649 In this manual: @ref{Tremolo subdivisions}, @ref{Repeats}.
2650
2651 Program reference: tremolo beams are @internalsref{Beam} objects. Single stem
2652 tremolos are @internalsref{StemTremolo} objects.  The music expression is
2653 @internalsref{TremoloEvent}.
2654
2655 Example files: @inputfileref{input/regression,chord-tremolo.ly},
2656 @inputfileref{input/regression,stem-tremolo.ly}.
2657
2658 @node Tremolo subdivisions
2659 @subsection Tremolo subdivisions
2660 @cindex tremolo marks
2661 @cindex @code{tremoloFlags}
2662
2663 Tremolo marks can be printed on a single note by adding
2664 `@code{:}[@var{length}]' after the note.  The length must be at least
2665 8.  A @var{length} value of 8 gives one line across the note stem.  If
2666 the length is omitted, the last value (stored in @code{tremoloFlags})
2667 is used
2668
2669 @lilypond[quote,verbatim,fragment]
2670 c'2:8 c':32 | c': c': |
2671 @end lilypond
2672
2673 @c [TODO : stok is te kort bij 32en]
2674
2675 @refbugs
2676
2677 Tremolos entered in this way do not carry over into the MIDI output.
2678
2679 @seealso
2680
2681 In this manual: @ref{Tremolo repeats}.
2682
2683 Elsewhere: @internalsref{StemTremolo}, @internalsref{TremoloEvent}.
2684
2685 @node Measure repeats
2686 @subsection Measure repeats
2687
2688 @cindex percent repeats
2689 @cindex measure repeats
2690
2691 In the @code{percent} style, a note pattern can be repeated. It is
2692 printed once, and then the pattern is replaced with a special sign.
2693 Patterns of a one and two measures are replaced by percent-like signs,
2694 patterns that divide the measure length are replaced by slashes
2695
2696 @lilypond[quote,verbatim,raggedright]
2697 \repeat  "percent" 4  { c'4 }
2698 \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
2699 @end lilypond
2700
2701 @seealso
2702
2703 Program reference: @internalsref{RepeatSlash}, @internalsref{PercentRepeat},
2704 @internalsref{PercentRepeatedMusic}, and
2705 @internalsref{DoublePercentRepeat}.
2706
2707
2708
2709 @node Rhythmic music
2710 @section Rhythmic music
2711
2712
2713 @menu
2714 * Showing melody rhythms::      
2715 * Entering percussion::         
2716 * Percussion staves::           
2717 @end menu
2718
2719
2720 @node Showing melody rhythms
2721 @subsection Showing melody rhythms
2722
2723 Sometimes you might want to show only the rhythm of a melody.  This
2724 can be done with the rhythmic staff. All pitches of notes on such a
2725 staff are squashed, and the staff itself has a single line
2726
2727 @lilypond[quote,fragment,relative=1,verbatim]
2728 \context RhythmicStaff {
2729   \time 4/4
2730   c4 e8 f  g2 | r4 g r2 | g1:32 | r1 |
2731 }
2732 @end lilypond
2733
2734 @seealso
2735
2736 Program reference: @internalsref{RhythmicStaff}.
2737
2738 Examples: @inputfileref{input/regression,rhythmic-staff.ly}.
2739
2740
2741 @node Entering percussion
2742 @subsection Entering percussion
2743
2744 @cindex percussion
2745 @cindex drums
2746
2747
2748 Percussion notes may be entered in @code{\drums} mode, which is
2749 similar to @code{notes}.  Each piece of percussion has a full name and
2750 an abbreviated name, and both be used in input files
2751
2752 @example
2753   hihat hh bassdrum bd
2754 @end example
2755 @lilypond[quote,raggedright]
2756 \new DrumStaff \drums { hihat hh bassdrum bd }
2757 @end lilypond
2758
2759 The complete list of drum names is in the init file
2760 @file{ly/drumpitch-init.ly}.
2761 @c TODO: properly document this.
2762
2763 @seealso
2764
2765 Program reference: @internalsref{DrumNoteEvent}.
2766
2767 @node Percussion staves
2768 @subsection Percussion staves
2769 @cindex percussion
2770 @cindex drums
2771
2772 A percussion part for more than one instrument typically uses a
2773 multiline staff where each position in the staff refers to one piece
2774 of percussion.
2775
2776
2777 To typeset the music, the notes must be interpreted in a
2778 @internalsref{DrumStaff} and @internalsref{DrumVoice} contexts
2779
2780 @c
2781 @lilypond[quote,raggedright,verbatim]
2782 up = \drums { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2783 down = \drums { bassdrum4 snare8 bd r bd sn4 }
2784 \score {
2785   \new DrumStaff <<
2786     \new DrumVoice { \voiceOne \up } 
2787     \new DrumVoice { \voiceTwo \down } 
2788   >>
2789 }
2790 @end lilypond
2791
2792 The above example shows verbose polyphonic notation. The short
2793 polyphonic notation, described in @ref{Polyphony}, can also be used if
2794 the @internalsref{DrumVoices} are instantiated by hand first. For example, 
2795
2796 @lilypond[quote,fragment,verbatim] 
2797 \new DrumStaff <<
2798   \context DrumVoice = "1" {  s1 *2 }
2799   \context DrumVoice = "2" {  s1 *2 }
2800   \drums {
2801     bd4 sn4 bd4 sn4
2802     <<
2803       { \repeat unfold 16 hh16 }
2804       \\
2805       { bd4 sn4 bd4 sn4 }
2806     >>
2807   }   
2808 >>
2809 @end lilypond
2810
2811
2812 There are also other layout possibilities. To use these, set the
2813 property @code{drumStyleTable} in context @internalsref{DrumVoice}.
2814 The following variables have been predefined
2815
2816 @table @code
2817 @item drums-style
2818 is the default. It typesets a typical drum kit on a five-line staff
2819
2820 @lilypond[quote,noindent]
2821 nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
2822     bd sn ss tomh tommh tomml toml tomfh tomfl }
2823 mus = \drums  { cymc cyms cymr hh | hhc hho hhho hhp | \break cb hc
2824     bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
2825 \score {
2826     << \new DrumStaff\with {
2827             \remove Bar_engraver
2828             \remove Time_signature_engraver
2829             \override Stem #'transparent = ##t
2830             \override Stem #'Y-extent-callback = ##f
2831             minimumVerticalExtent = #'(-4.0 . 5.0)
2832     } \mus
2833         \context Lyrics \nam 
2834     >>
2835     \paper {
2836     %% need to do this, because of indented @itemize
2837     linewidth= 9 \cm 
2838     \context { \Score
2839     \override LyricText #'font-family = #'typewriter
2840     \override BarNumber #'transparent =##T
2841 }}}
2842 @end lilypond
2843
2844 The drum scheme supports six different toms.  When there fewer toms, simply
2845 select the toms that produce the desired result, i.e. to get toms on
2846 the three middle lines you use @code{tommh}, @code{tomml} and
2847 @code{tomfh}.
2848
2849 @item timbales-style
2850 to typeset timbales on a two line staff
2851
2852 @lilypond[quote,raggedright]
2853 nam = \lyrics { timh ssh timl ssl cb }
2854 mus = \drums  { timh ssh timl ssl cb s16 }
2855 \score {
2856     <<
2857         \context DrumStaff \with {
2858             \remove Bar_engraver
2859             \remove Time_signature_engraver
2860             \override Stem #'transparent = ##t
2861             \override Stem #'Y-extent-callback = ##f
2862             \override StaffSymbol #'line-count = #2
2863             \override StaffSymbol #'staff-space = #2
2864             minimumVerticalExtent = #'(-3.0 . 4.0)
2865             drumStyleTable = #timbales-style
2866         } \mus
2867         \context Lyrics {
2868             \override LyricText #'font-family = #'typewriter
2869
2870         \nam  }
2871     >>
2872 }
2873 @end lilypond
2874 @item congas-style
2875 to typeset congas on a two line staff
2876
2877 @lilypond[quote,raggedright]
2878 nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
2879 mus = \drums  { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
2880 \score {
2881     <<
2882         \context DrumStaff\with {
2883             \remove Bar_engraver
2884             \remove Time_signature_engraver
2885             drumStyleTable = #congas-style
2886             \override StaffSymbol #'line-count = #2
2887             
2888             %% this sucks; it will lengthen stems.
2889             \override StaffSymbol #'staff-space = #2
2890             \override Stem #'transparent = ##t
2891             \override Stem #'Y-extent-callback = ##f
2892         } \mus
2893         \context Lyrics {
2894                     \override LyricText #'font-family = #'typewriter
2895 \nam  }
2896     >>
2897 }
2898 @end lilypond
2899 @item bongos-style
2900 to typeset bongos on a two line staff
2901
2902 @lilypond[quote,raggedright]
2903 nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
2904 mus = \drums  { boh boho bohm ssh bol bolo bolm ssl s16 }
2905 \score {
2906     <<
2907         \context DrumStaff\with {
2908             \remove Bar_engraver
2909             \remove Time_signature_engraver
2910             \override StaffSymbol #'line-count = #2
2911             drumStyleTable = #bongos-style
2912            
2913             %% this sucks; it will lengthen stems.
2914             \override StaffSymbol #'staff-space = #2
2915             \override Stem #'transparent = ##t
2916             \override Stem #'Y-extent-callback = ##f
2917         } \mus
2918         \context Lyrics {
2919                     \override LyricText #'font-family = #'typewriter
2920 \nam  }
2921     >>
2922 }
2923 @end lilypond
2924
2925 @item percussion-style
2926 to typeset all kinds of simple percussion on one line staves
2927 @lilypond[quote,raggedright]
2928 nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
2929 mus = \drums  { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
2930 \score {
2931     <<
2932         \context DrumStaff\with{
2933             \remove Bar_engraver
2934             drumStyleTable = #percussion-style
2935             \override StaffSymbol #'line-count = #1
2936             \remove Time_signature_engraver
2937             \override Stem #'transparent = ##t
2938             \override Stem #'Y-extent-callback = ##f
2939         } \mus
2940         \context Lyrics {
2941         \nam
2942                     \override LyricText #'font-family = #'typewriter
2943 }
2944     >>
2945 }
2946 @end lilypond
2947 @end table
2948
2949 If you do not like any of the predefined lists you can define your own
2950 list at the top of your file
2951
2952 @lilypond[quote,raggedright,verbatim]
2953 #(define mydrums '(
2954         (bassdrum     default   #f        -1)
2955         (snare        default   #f        0)
2956         (hihat        cross     #f        1)
2957         (pedalhihat   xcircle   "stopped" 2)
2958         (lowtom       diamond   #f       3)))
2959 up = \drums { hh8 hh hh hh hhp4 hhp }
2960 down = \drums { bd4 sn bd toml8 toml }
2961 \score {
2962   \new DrumStaff <<
2963     \set DrumStaff.drumStyleTable
2964        = #(alist->hash-table mydrums)
2965     \new DrumVoice { \voiceOne \up }
2966     \new DrumVoice { \voiceTwo \down }
2967   >>
2968 }
2969 @end lilypond
2970
2971
2972 @seealso
2973
2974 Init files: @file{ly/drumpitch-init.ly}.
2975
2976 Program reference: @internalsref{DrumStaff}, @internalsref{DrumVoice}.
2977
2978 @refbugs
2979
2980 Because general MIDI does not contain rim shots, the sidestick is used
2981 for this purpose instead.
2982
2983 @node Piano music
2984 @section Piano music
2985
2986 Piano staves are two normal staves coupled with a brace.  The staves
2987 are largely independent, but sometimes voices can cross between the
2988 two staves.  The same notation is also used for harps and other key
2989 instruments.  The @internalsref{PianoStaff} is especially built to
2990 handle this cross-staffing behavior.  In this section we discuss the
2991 @internalsref{PianoStaff} and some other pianistic peculiarities.
2992
2993
2994 @menu
2995 * Automatic staff changes::     
2996 * Manual staff switches::       
2997 * Pedals::                      
2998 * Arpeggio::                    
2999 * Staff switch lines::          
3000 @end menu 
3001
3002 @refbugs
3003
3004 There is no support for putting chords across staves.  You can get
3005 this result by increasing the length of the stem in the lower stave so
3006 it reaches the stem in the upper stave, or vice versa. An example is
3007 included with the distribution as
3008 @inputfileref{input/test,stem-cross-staff.ly}.
3009
3010 Dynamics are not centered, but kludges do exist. See
3011 @inputfileref{input/template,piano-dynamics.ly}.
3012
3013 @cindex cross staff stem
3014 @cindex stem, cross staff
3015 @cindex distance between staves in piano music
3016
3017 The distance between the two staves is normally fixed across the
3018 entire score. It is possible to tune this per system, but it does
3019 require arcane command incantations. See
3020 @inputfileref{input/test,piano-staff-distance.ly}.
3021
3022
3023 @node Automatic staff changes
3024 @subsection Automatic staff changes
3025 @cindex Automatic staff changes
3026
3027 Voices can switch automatically between the top and the bottom
3028 staff. The syntax for this is
3029
3030 @quotation
3031 @example
3032 \autochange \context Voice @{ @dots{}@var{music}@dots{} @}
3033 @end example
3034 @end quotation
3035
3036 @noindent
3037 The two staves of the piano staff must be named @code{up} and
3038 @code{down}.
3039
3040 A @code{\relative} section that is outside of @code{\autochange} has
3041 no effect on the pitches of @var{music}, so, if necessary, put
3042 @code{\relative} inside @code{\autochange} like
3043
3044 @quotation
3045 @example
3046 \autochange \relative @dots{} \new Voice @dots{}
3047 @end example
3048 @end quotation
3049
3050
3051 The autochanger switches on basis of pitch (middle C is the turning
3052 point), and it looks ahead skipping over rests to switch in
3053 advance. Here is a practical example
3054         
3055 @lilypond[quote,verbatim,raggedright]
3056 \score { \notes \context PianoStaff <<
3057   \context Staff = "up" {
3058     \autochange \new Voice \relative c' {
3059        g4 a  b c d r4 a g } }
3060   \context Staff = "down" {
3061        \clef bass
3062        s1*2
3063 } >> }
3064 @end lilypond
3065
3066 @noindent
3067 In this example, spacer rests are used to prevent the bottom staff from
3068 terminating too soon.
3069
3070
3071 @seealso
3072
3073 In this manual: @ref{Manual staff switches}.
3074
3075 Program reference: @internalsref{AutoChangeMusic}.
3076
3077
3078
3079 @refbugs
3080
3081 The staff switches often do not end up in optimal places. For high
3082 quality output, staff switches should be specified manually.
3083
3084
3085 @code{\autochange} cannot be inside @code{\times}. 
3086
3087 Internally, the @code{\partcombine} interprets both arguments as
3088 @code{Voice}s named @code{one} and @code{two}, and then decides when
3089 the parts can be combined. Consequently, if the arguments switch to
3090 differently named @internalsref{Voice} contexts, the events in those
3091 will be ignored.
3092
3093
3094 @node Manual staff switches
3095 @subsection Manual staff switches
3096
3097 @cindex manual staff switches
3098 @cindex staff switch, manual
3099
3100 Voices can be switched between staves manually, using the following command
3101 @example
3102 \change Staff = @var{staffname} @var{music}
3103 @end example
3104
3105 @noindent
3106 The string @var{staffname} is the name of the staff. It switches the
3107 current voice from its current staff to the Staff called
3108 @var{staffname}. Typically @var{staffname} is @code{"up"} or
3109 @code{"down"}. The @context{Staff} referred to must already exist, so
3110 usually the setup for a score will start with a setup of the staves,
3111
3112 @example
3113   <<
3114   \context Staff = up @{
3115     \skip 1 * 10  %@emph{ keep staff alive}
3116     @}
3117   \context Staff = down @{
3118     \skip 1 * 10  %@emph{idem}
3119     @}
3120   >>
3121 @end example 
3122
3123
3124 and the @context{Voice} is inserted afterwards
3125
3126 @example
3127   \context Staff = down
3128     \new Voice @{ @dots{} \change Staff = up @dots{} @}
3129 @end example
3130
3131
3132 @node Pedals
3133 @subsection Pedals
3134 @cindex Pedals
3135
3136 Pianos have pedals that alter the way sound are produced. Generally, a
3137 piano has three pedals, sustain, una corda, and sostenuto.
3138
3139
3140 Piano pedal instruction can be expressed by attaching
3141 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
3142 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
3143 note or chord
3144
3145 @lilypond[quote,fragment,verbatim]
3146 c'4\sustainDown c'4\sustainUp
3147 @end lilypond
3148
3149 What is printed can be modified by setting @code{pedal@var{X}Strings},
3150 where @var{X} is one of the pedal types: @code{Sustain},
3151 @code{Sostenuto} or @code{UnaCorda}.  Refer to
3152 @internalsref{SustainPedal} in the program reference for more
3153 information.
3154
3155 Pedals can also be indicated by a sequence of brackets, by setting the 
3156 @code{pedalSustainStyle} property to @code{bracket} objects
3157
3158 @lilypond[quote,fragment,verbatim,relative=2]
3159 \set Staff.pedalSustainStyle = #'bracket
3160 c\sustainDown d e
3161 b\sustainUp\sustainDown
3162 b g \sustainUp a \sustainDown \bar "|."
3163 @end lilypond
3164
3165 A third style of pedal notation is a mixture of text and brackets,
3166 obtained by setting the @code{pedalSustainStyle} style property to
3167 @code{mixed}
3168
3169 @lilypond[quote,fragment,verbatim,relative=2]
3170 \set Staff.pedalSustainStyle = #'mixed
3171 c\sustainDown d e
3172 b\sustainUp\sustainDown
3173 b g \sustainUp a \sustainDown \bar "|."
3174 @end lilypond
3175
3176 The default `*Ped.' style for sustain and damper pedals corresponds to
3177 style @code{#'text}. The sostenuto pedal uses @code{mixed} style by
3178 default.
3179
3180 @lilypond[quote,fragment,verbatim,relative=2]
3181 c\sostenutoDown d e c, f g a\sostenutoUp
3182 @end lilypond
3183
3184 For fine-tuning of the appearance of a pedal bracket, the properties
3185 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
3186 @code{PianoPedalBracket} objects (see
3187 @internalsref{PianoPedalBracket} in the Program reference)  can be modified.  For example, the
3188 bracket may be extended to the end of the note head
3189
3190 @lilypond[quote,fragment,verbatim,relative=2]
3191 \override Staff.PianoPedalBracket  
3192    #'shorten-pair = #'(0 . -1.0)
3193 c\sostenutoDown d e c, f g a\sostenutoUp
3194 @end lilypond
3195
3196 @node Arpeggio
3197 @subsection Arpeggio
3198 @cindex Arpeggio
3199
3200 @cindex broken arpeggio
3201 @cindex @code{\arpeggio}
3202
3203 You can specify an arpeggio sign on a chord by attaching an
3204 @code{\arpeggio} to a chord
3205
3206
3207 @lilypond[quote,fragment,relative=1,verbatim]
3208 <c e g c>\arpeggio
3209 @end lilypond
3210
3211 When an arpeggio crosses staves, you attach an arpeggio to the chords
3212 in both staves, and set
3213 @internalsref{PianoStaff}.@code{connectArpeggios}
3214
3215 @lilypond[quote,fragment,relative=1,verbatim]
3216 \context PianoStaff <<
3217   \set PianoStaff.connectArpeggios = ##t
3218   \new Staff  { <c' e g c>\arpeggio }
3219   \new Staff { \clef bass  <c,, e g>\arpeggio }
3220 >>
3221 @end lilypond
3222
3223 The direction of the arpeggio is sometimes denoted by adding an
3224 arrowhead to the wiggly line
3225
3226 @lilypond[quote,fragment,relative=1,verbatim]
3227 \context Voice {
3228   \arpeggioUp
3229   <c e g c>\arpeggio
3230   \arpeggioDown
3231   <c e g c>\arpeggio
3232 }
3233 @end lilypond
3234
3235 A square bracket on the left indicates that the player should not
3236 arpeggiate the chord
3237
3238 @lilypond[quote,fragment,relative=1,verbatim]
3239 \arpeggioBracket
3240 <c' e g c>\arpeggio
3241 @end lilypond
3242
3243 @refcommands
3244
3245 @cindex @code{\arpeggio}
3246 @code{\arpeggio},
3247 @cindex @code{\arpeggioUp}
3248 @code{\arpeggioUp},
3249 @cindex @code{\arpeggioDown}
3250 @code{\arpeggioUp},
3251 @cindex @code{\arpeggioBoth}
3252 @code{\arpeggioBoth},
3253 @cindex @code{\arpeggioBracket}
3254 @code{\arpeggioBracket}.
3255
3256 @seealso
3257
3258 Program reference: @internalsref{ArpeggioEvent} music expressions lead to
3259 @internalsref{Arpeggio} objects.  Cross staff arpeggios are
3260 @internalsref{PianoStaff}.@internalsref{Arpeggio}.
3261
3262 @refbugs
3263
3264 It is not possible to mix connected arpeggios and unconnected
3265 arpeggios in one @internalsref{PianoStaff} at the same time.
3266
3267 @node Staff switch lines
3268 @subsection Staff switch lines
3269
3270
3271 @cindex follow voice
3272 @cindex staff switching
3273 @cindex cross staff
3274
3275 @cindex @code{followVoice}
3276
3277 Whenever a voice switches to another staff a line connecting the notes
3278 can be printed automatically. This is enabled if the property
3279 @code{PianoStaff.followVoice} is set to true
3280
3281 @lilypond[quote,fragment,relative=1,verbatim]
3282 \context PianoStaff <<
3283   \set PianoStaff.followVoice = ##t
3284   \context Staff \context Voice {
3285     c1
3286     \change Staff=two
3287     b2 a
3288   }
3289  \context Staff=two { \clef bass \skip 1*2 }
3290 >>  
3291 @end lilypond
3292
3293 @seealso
3294
3295 The associated object is @internalsref{VoiceFollower}.
3296
3297 @refcommands
3298
3299 @cindex @code{\showStaffSwitch}
3300 @code{\showStaffSwitch}, 
3301 @cindex @code{\hideStaffSwitch}
3302 @code{\hideStaffSwitch}.
3303
3304
3305 @node Vocal music
3306 @section Vocal music
3307
3308
3309 The easiest way to add lyrics to a melody, is by appending
3310
3311
3312 @cindex \newlyrics
3313 @example
3314   \newlyrics @{ @var{the lyrics} @} 
3315 @end example
3316
3317 to a melody. Here is an example,
3318
3319 @lilypond[raggedright]
3320   \relative { \time 3/4 c2 e4 g2. }
3321   \newlyrics { play the game } 
3322 @end lilypond
3323
3324 More stanzas can be added by adding more
3325 @code{\newlyrics} sections 
3326
3327 @lilypond[raggedright]
3328   \relative { \time 3/4 c2 e4 g2. }
3329   \newlyrics { play the game } 
3330   \newlyrics { speel het spel } 
3331   \newlyrics { joue le jeu } 
3332 @end lilypond
3333
3334 The @code{\newlyrics} keyword has three functions: it interprets the
3335 following words as texts instead of notes, it sets up a context for
3336 printing texts (the @code{Lyrics} context), and it couples the melody
3337 with the lyrics, so that the durations of both are aligned.
3338
3339 These three functions can be controlled separately, and that is what
3340 the following sections are about.
3341
3342 @menu
3343 * Easy lyrics entry
3344 * Entering lyrics::             
3345 * The Lyrics context::          
3346 * More stanzas::                
3347 * Ambitus::                     
3348 @end menu
3349
3350 @node Entering lyrics
3351 @subsection Entering lyrics
3352
3353
3354 @cindex lyrics
3355 @cindex @code{\lyrics}
3356 @cindex punctuation
3357
3358 Lyrics are entered in a special input mode. This mode is is introduced
3359 by the keyword @code{\lyrics}.  In this mode you can enter lyrics,
3360 with punctuation and accents without any hassle.  Syllables are
3361 entered like notes, but with pitches replaced by text.  For example,
3362 @example
3363   \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
3364 @end example
3365
3366 A word in Lyrics mode begins with: an alphabetic character, @code{_},
3367 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
3368 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
3369 any 8-bit character with ASCII code over 127, or a two-character
3370 combination of a backslash followed by one of @code{`}, @code{'},
3371 @code{"}, or @code{^}.
3372
3373 Subsequent characters of a word can be any character that is not a digit
3374 and not white space.  One important consequence of this is that a word
3375 can end with @code{@}}. The following example is usually a bug. The
3376 syllable includes a @code{@}}, and hence the opening brace is not balanced
3377 @example
3378   \lyrics @{ twinkle@}
3379 @end example
3380
3381 @cindex @code{\property}, in @code{\lyrics}
3382 Similarly, a period following a alphabetic sequence, is included in
3383 the resulting string. As a consequence, spaces must be inserted around
3384 property commands
3385 @example
3386   \override Score . LyricText #'font-shape = #'italic
3387 @end example
3388
3389 @cindex @code{_}
3390 @cindex spaces, in lyrics
3391 @cindex quotes, in lyrics
3392
3393 Any @code{_} character which appears in an unquoted word is converted
3394 to a space.  This provides a mechanism for introducing spaces into words
3395 without using quotes.  Quoted words can also be used in Lyrics mode to
3396 specify words that cannot be written with the above rules. The
3397 following example incorporates double quotes
3398
3399 @example
3400   \lyrics @{ He said: "\"Let" my peo ple "go\"" @}
3401 @end example
3402
3403 This example is slightly academic, since it gives better looking
3404 results to use matched single quotes, @code{``} and @code{''}
3405 @example
3406   \lyrics @{ He said: ``Let my peo ple go'' @}
3407 @end example
3408
3409 @cindex hyphens
3410
3411 Centered hyphens are entered as `@code{-}@code{-}' between syllables.
3412 The hyphen will have variable length depending on the space between
3413 the syllables and it will be centered between the syllables.
3414
3415 @cindex melisma
3416 @cindex extender
3417
3418 When a lyric is sung over many notes (this is called a melisma), this is
3419 indicated with a horizontal line centered between a syllable and the
3420 next one. Such a line is called an extender line, and it is entered as
3421 @code{__}.
3422
3423 @seealso
3424
3425 Program reference: events @internalsref{LyricEvent},
3426 @internalsref{HyphenEvent}, and @internalsref{ExtenderEvent}. Objects
3427 @internalsref{LyricHyphen}, @internalsref{LyricExtender} and
3428 @internalsref{LyricText}.
3429
3430 Examples: @inputfileref{input/test,lyric-hyphen-retain.ly}.
3431
3432 @refbugs
3433
3434 The definition of lyrics mode is too complex.
3435
3436
3437
3438 @node The Lyrics context
3439 @subsection  The Lyrics context
3440
3441
3442 @c TODO: document \newlyrics
3443
3444 Lyrics are printed by interpreting them in a @internalsref{Lyrics} context
3445 @example
3446  \context Lyrics \lyrics @dots{}
3447 @end example
3448
3449 @cindex automatic syllable durations
3450 @cindex @code{\lyricsto}
3451 @cindex lyrics and melodies
3452
3453 This will place the lyrics according to the durations that were
3454 entered. The lyrics can also be aligned under a given melody
3455 automatically.  In this case, it is no longer necessary to enter the
3456 correct duration for each syllable.  This is achieved by combining the
3457 melody and the lyrics with the @code{\lyricsto} expression
3458 @example
3459 \lyricsto @var{name} \new Lyrics \lyrics @dots{} 
3460 @end example
3461
3462 This aligns the lyrics to the
3463 @c
3464 notes of the @internalsref{Voice} context called @var{name}, which has
3465 to exist. Therefore, normally the @code{Voice} is specified first, and
3466 then the lyrics are specified with @code{\lyricsto}.
3467
3468 For different or more complex orderings, the best way is to setup the
3469 hierarchy of staves and lyrics first, e.g.
3470 @example
3471 \context ChoirStaff \notes <<
3472   \context Lyrics = sopranoLyrics @{ s1 @}
3473   \context Voice = soprano @{ @emph{music} @}
3474   \context Lyrics = tenorLyrics @{ s1 @}
3475   \context Voice = tenor @{ @emph{music} @}
3476 >>
3477 @end example
3478 and then combine the appropriate melodies and lyric lines
3479 @example
3480   \lyricsto "soprano" \context Lyrics = sopranoLyrics
3481      @emph{the lyrics}
3482 @end example
3483
3484 @noindent
3485 The final input would resemble
3486
3487 @example
3488   << \context ChoirStaff \notes << @emph{setup the music}  >>
3489      \lyricsto "soprano" @emph{etc}
3490      \lyricsto "alto" @emph{etc}
3491      @emph{etc}
3492   >>
3493 @end example 
3494
3495
3496 The @code{\lyricsto} command detects melismata: it only puts one
3497 syllable under a tied or slurred group of notes. If you want to force
3498 an unslurred group of notes to be a melisma, insert @code{\melisma}
3499 after the first note of the group, and @code{\melismaEnd} after the
3500 last one, e.g.
3501
3502 @lilypond[quote,relative=2,raggedright,fragment,verbatim]
3503 <<
3504   \context Voice = "lala" {
3505     \time 3/4
3506     f4 g8
3507     \melisma 
3508     f e f
3509     \melismaEnd
3510     e2
3511   }
3512   \lyricsto "lala" \new Lyrics \lyrics {
3513     la di __ daah 
3514   }
3515 >>
3516 @end lilypond
3517
3518 In addition, notes are considered a melisma if they are manually
3519 beamed, and automatic beaming (see @ref{Setting automatic beam
3520 behavior}) is switched off.  The criteria for deciding melismata can
3521 be tuned with the property @code{melismaBusyProperties}. See
3522 @internalsref{Melisma_translator} in the program reference for more
3523 information.
3524
3525 Lyrics can also be entered without @code{\lyricsto}. In this case the
3526 durations of each syllable must be entered explicitly, for example,
3527
3528 @verbatim
3529   play2 the4 game2.
3530   sink2 or4 swim2.  
3531 @end verbatim
3532
3533 Alignment to a melody can be specified with the @code{associatedVoice}
3534 property,
3535
3536 @verbatim
3537   \set associatedVoice = #"melody"
3538 @end verbatim 
3539
3540 Here is an example demonstrating manual lyric durations,
3541
3542 @lilypond[relative=1,verbatim,fragment]
3543 << \context Voice = melody {
3544      \time 3/4
3545      c2 e4 g2.
3546   } 
3547   \new Lyrics \lyrics {
3548     \set associatedVoice = #"melody"
3549     play2 the4 game2.
3550   }  >>
3551 @end lilypond
3552
3553
3554
3555
3556 When multiple stanzas are put on the same melody, it can happen that
3557 two stanzas have melismata in different locations. This can be
3558 remedied by switching off melismata for one
3559 @internalsref{Lyrics}. This is achieved by setting
3560 the @code{ignoreMelismata} property to @code{#t}. An example is shown
3561 in @inputfileref{input/regression,lyric-combine-new.ly}.
3562
3563 @cindex SATB
3564 @cindex choral score
3565
3566 A complete example of a SATB score setup is in the file
3567 @inputfileref{input/template,satb.ly}.
3568
3569
3570 @refcommands
3571
3572 @code{\melisma}, @code{\melismaEnd}
3573 @cindex @code{\melismaEnd}
3574 @cindex @code{\melisma}
3575
3576 @seealso
3577
3578 Program reference: Music expressions: @internalsref{LyricCombineMusic},
3579 Contexts: @internalsref{Lyrics}, @internalsref{Melisma_translator}.
3580
3581 Examples: @inputfileref{input/template,satb.ly},
3582 @inputfileref{input/regression,lyric-combine-new.ly}.
3583  
3584 @refbugs
3585
3586 Melismata are not detected automatically, and extender lines must be
3587 inserted by hand.
3588
3589
3590 For proper processing of extender lines, the
3591 @internalsref{Lyrics} and @internalsref{Voice} should be
3592 linked. This can be achieved either by using @code{\lyricsto} or by
3593 setting corresponding names for both contexts. The latter is explained
3594 in @ref{More stanzas}.
3595
3596 @c TODO: document \new Staff << Voice \lyricsto >> bug
3597
3598 @node More stanzas
3599 @subsection More stanzas
3600
3601 @cindex phrasing, in lyrics
3602
3603
3604 The lyrics should be aligned with the note heads of the melody. To
3605 achieve this, each line of lyrics should be marked to correspond with
3606 the melodic line. This is done automatically when @code{\lyricsto},
3607 but it can also be done manually. 
3608
3609 To this end, give the @internalsref{Voice} context an identity
3610 @example
3611 \context Voice = duet @{
3612      \time 3/4
3613      g2 e4 a2 f4 g2.  @}
3614 @end example
3615
3616 Then set the @internalsref{Lyrics} contexts to names starting with
3617 that identity followed by a dash.  In the preceding example, the
3618 @internalsref{Voice} identity is @code{duet}, so the identities of the
3619 @internalsref{Lyrics}s are marked @code{duet-1} and @code{duet-2}
3620 @example
3621   \context Lyrics = "duet-1" @{
3622     Hi, my name is Bert. @}
3623   \context Lyrics = "duet-2" @{
3624     Ooooo, ch\'e -- ri, je t'aime. @}
3625 @end example
3626
3627 The complete example is shown here
3628 @lilypond[quote,raggedright,verbatim]
3629 \score {
3630   <<
3631     \notes \relative c'' \context Voice = duet {
3632       \time 3/4
3633        g2 e4 a2 f4 g2. }
3634     <<
3635       \lyricsto "duet" \new Lyrics \lyrics {
3636         \set vocalName = "Bert"
3637         Hi, my name is Bert. }
3638       \lyricsto "duet" \new Lyrics \lyrics {
3639         \set vocalName = "Ernie"
3640         Ooooo, ch\'e -- ri, je t'aime. }
3641     >>
3642   >>
3643 }
3644 @end lilypond
3645
3646 @cindex stanza number
3647 @cindex singer's names
3648 @cindex name of singer 
3649
3650 Stanza numbers can be added by setting @code{stanza}, e.g.
3651
3652 @lilypond[quote,verbatim,relative=2]
3653 <<
3654   \context Voice = duet {
3655     \time 3/4 g2 e4 a2 f4 g2. }
3656     \lyricsto "duet" \new Lyrics \lyrics {
3657      \set stanza = "1. "
3658      Hi, my name is Bert. }
3659 >>
3660 @end lilypond
3661
3662 This example also demonstrates how names of the singers can be added
3663 using @code{vocalName} analogous to instrument annotations for staves.
3664 A short version may be entered as @code{vocNam}.
3665
3666 To make empty spaces in lyrics, use @code{\skip}.
3667
3668
3669 @seealso
3670
3671 Program reference: Layout objects @internalsref{LyricText} and
3672 @internalsref{VocalName}.  Music expressions
3673 @internalsref{LyricEvent}.
3674
3675 @refbugs
3676
3677 @cindex ambiguity
3678
3679 Input for lyrics introduces a syntactical ambiguity
3680  
3681 @example 
3682 foo = bar 
3683 @end example 
3684
3685 @noindent
3686 is interpreted as assigning a string identifier @code{\foo} such that
3687 it contains @code{"bar"}.  However, it could also be interpreted as
3688 making or a music identifier @code{\foo} containing the syllable
3689 `bar'.  The force the latter interpretation, use
3690 @example
3691 foo = \lyrics bar4
3692 @end example
3693
3694
3695 @node Ambitus
3696 @subsection Ambitus
3697 @cindex ambitus
3698
3699 The term @emph{ambitus} denotes a range of pitches for a given voice
3700 in a part of music.  It also may denote the pitch range that a musical
3701 instrument is capable of playing.  Ambituses are printed on vocal
3702 parts, so singers can easily determine if it meets his or her
3703 capabilities.
3704
3705 It denoted at the beginning of a piece near the initial clef.  The
3706 range is graphically specified by two note heads, that represent the
3707 minimum and maximum pitch.  To print such ambituses, add the
3708 @internalsref{Ambitus_engraver} to the @internalsref{Voice} context,
3709 for example,
3710
3711 @example
3712   \paper @{
3713     \context @{
3714       \Voice
3715       \consists Ambitus_engraver
3716     @}
3717   @}
3718 @end example
3719
3720 This results in the following output
3721
3722 @lilypond[quote,raggedright]
3723 \score {
3724   \context ChoirStaff 
3725   \notes \relative c' <<
3726     \new Staff {
3727       as'' c e2 cis,2
3728     }
3729     \new Staff  {
3730       es4 b c f as g
3731     }
3732   >>
3733   \paper {
3734     \context {
3735       \Staff
3736       \consists Ambitus_engraver
3737     }
3738   }
3739 }
3740 @end lilypond
3741
3742 If you have multiple voices in a single staff, and you want a single
3743 ambitus per staff rather than per each voice, add the
3744 @internalsref{Ambitus_engraver} to the @internalsref{Staff} context
3745 rather than to the @internalsref{Voice} context.
3746
3747 It is possible to tune individual ambituses for multiple voices on a
3748 single staff, for example by erasing or shifting them horizontally. An
3749 example is in @inputfileref{input/test,ambitus-mixed.ly}.
3750
3751 @seealso
3752
3753 Program reference: @internalsref{Ambitus}.
3754
3755 Examples:  @inputfileref{input/regression,ambitus.ly},
3756 @inputfileref{input/test,ambitus-mixed.ly}.
3757
3758 @refbugs
3759
3760 There is no collision handling in the case of multiple per-voice
3761 ambitus.
3762
3763 @node Tablatures
3764 @section Tablatures
3765
3766 Tablature notation is used for notating music for plucked string
3767 instruments.  It notates pitches not by using note heads, but by
3768 indicating on which string and fret a note must be played.  LilyPond
3769 offers limited support for tablature.
3770
3771 @menu
3772 * Tablatures basic::            
3773 * Non-guitar tablatures::       
3774 @end menu
3775
3776 @node Tablatures basic
3777 @subsection Tablatures basic
3778 @cindex Tablatures basic
3779
3780 The string number associated to a note is given as a backslash
3781 followed by a number, e.g. @code{c4\3} for a C quarter on the third
3782 string. By default, string 1 is the highest one, and the tuning
3783 defaults to the standard guitar tuning (with 6 strings).  The notes
3784 are printed as tablature, by using @internalsref{TabStaff} and
3785 @internalsref{TabVoice} contexts
3786
3787 @lilypond[quote,fragment,verbatim]
3788 \notes \context TabStaff {
3789   a,4\5 c'\2 a\3 e'\1
3790   e\4 c'\2 a\3 e'\1
3791 }
3792 @end lilypond
3793
3794 @cindex minimumFret
3795
3796 When no string is specified, the first string that does not give a
3797 fret number less than @code{minimumFret} is selected. The default
3798 value for @code{minimumFret} is 0
3799
3800
3801 @example
3802 e16 fis gis a b4
3803 \set TabStaff.minimumFret = #8
3804 e16 fis gis a b4
3805 @end example
3806 @lilypond[quote,noindent,raggedright]
3807 frag = \notes {
3808   \key e \major
3809   e16 fis gis a b4
3810   \set TabStaff.minimumFret = #8
3811   e16 fis gis a b4
3812 }
3813 \score {
3814   \context StaffGroup <<
3815     \context Staff { \clef "G_8" \frag }
3816     \context TabStaff { \frag }
3817   >>
3818 }
3819 @end lilypond
3820
3821 @seealso
3822
3823 Program reference: @internalsref{TabStaff}, @internalsref{TabVoice}, and
3824 @internalsref{StringNumberEvent}.
3825
3826 @refbugs
3827
3828 Chords are not handled in a special way, and hence the automatic
3829 string selector may easily select the same string to two notes in a
3830 chord.
3831
3832
3833 @node Non-guitar tablatures
3834 @subsection Non-guitar tablatures
3835 @cindex Non-guitar tablatures
3836
3837 You can change the number of strings, by setting the number of lines
3838 in the @internalsref{TabStaff}. 
3839
3840 You can change the tuning of the strings. A string tuning is given as
3841 a Scheme list with one integer number for each string, the number
3842 being the pitch (measured in semitones relative to middle C) of an
3843 open string.  The numbers specified for @code{stringTuning} are the
3844 numbers of semitones to subtract or add, starting the specified pitch
3845 by default middle C, in string order. Thus, the notes are e, a, d, and
3846 g
3847
3848 @lilypond[quote,fragment,verbatim]
3849   \context TabStaff <<
3850     \set TabStaff.stringTunings = #'(-5 -10 -15 -20)
3851     
3852     \notes {
3853       a,4 c' a e' e c' a e'
3854     }
3855   >> 
3856 @end lilypond
3857
3858 @refbugs
3859
3860 No guitar special effects have been implemented.
3861
3862 @seealso
3863
3864 Program reference: @internalsref{Tab_note_heads_engraver}.
3865
3866
3867 @node Chord names
3868 @section Chord names
3869 @cindex Chords
3870
3871 LilyPond has support for both printing chord names.  Chords may be
3872 entered in musical chord notation, i.e. @code{< .. >}, but they can
3873 also be entered by name. Internally, the chords are represented as a
3874 set of pitches, so they can be transposed
3875
3876
3877 @lilypond[quote,verbatim,raggedright]
3878 twoWays = \notes \transpose c c' {
3879   \chords {
3880     c1 f:sus4 bes/f
3881   }
3882   <c e g>
3883   <f bes c'>
3884   <f bes d'>
3885 }
3886
3887 \score {
3888   << \context ChordNames \twoWays
3889      \context Voice \twoWays >> }
3890 @end lilypond
3891
3892 This example also shows that the chord printing routines do not try to
3893 be intelligent. The last chord (@code{f bes d}) is not interpreted as
3894 an inversion.
3895
3896
3897 @menu
3898 * Chords mode::                 
3899 * Printing chord names::        
3900 @end menu
3901
3902
3903 @node Chords mode
3904 @subsection Chords mode
3905 @cindex Chords mode
3906
3907 Chord mode is a mode where you can input sets of pitches using common
3908 names.  It is introduced by the keyword @code{\chords}.
3909 In chords mode,  a  chord is entered by the root, which is entered
3910 like a common pitch
3911 @lilypond[quote,fragment,verbatim,relative=2]
3912 \chords { es4. d8 c2 }
3913 @end lilypond
3914 @cindex chord entry
3915 @cindex chord mode
3916
3917 Other chords may be entered by suffixing a colon, and introducing a
3918 modifier, and optionally, a number
3919 @c
3920 @lilypond[quote,fragment,verbatim]
3921 \chords { e1:m e1:7 e1:m7  }
3922 @end lilypond
3923 The first number following the root is taken to be the `type' of the
3924 chord, thirds are added to the root until it reaches the specified
3925 number
3926 @lilypond[quote,fragment,verbatim]
3927 \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
3928 @end lilypond
3929
3930 @cindex root of chord
3931 @cindex additions, in chords
3932 @cindex removals, in  chords
3933
3934 More complex chords may also be constructed  adding separate steps
3935 to a chord. Additions are added after the  number following
3936 the colon, and are separated by dots
3937 @c
3938 @lilypond[quote,verbatim,fragment]
3939 \chords { c:5.6 c:3.7.8 c:3.6.13 }
3940 @end lilypond
3941 Chord steps can be  altered by suffixing a @code{-} or @code{+} sign
3942 to the number
3943 @lilypond[quote,verbatim,fragment]
3944 \chords { c:7+ c:5+.3-  c:3-.5-.7- }
3945 @end lilypond
3946 Removals are specified similarly, and are introduced by a caret.  They
3947 must come after the additions
3948 @lilypond[quote,verbatim,fragment]
3949 \chords { c^3 c:7^5 c:9^3.5 }
3950 @end lilypond
3951
3952 Modifiers can be used to change pitches. The following modifiers are
3953 supported
3954 @table @code
3955 @item m
3956   is the minor chord. This modifier lowers the 3rd and (if present) the 7th step.
3957 @item dim
3958   is the   diminished chord. This modifier lowers the 3rd, 5th and (if present)
3959   the 7th step.
3960 @item aug
3961   is the augmented chord. This modifier raises the 5th step.
3962 @item maj
3963   is the major 7th chord. This modifier raises the 7th step if present.  
3964 @item sus
3965   is the suspended 4th or 2nd. This modifier removes the 3rd
3966 step. Append either @code{2} or @code{4} to add the 2nd or 4th step to
3967 the chord.
3968 @end table
3969 Modifiers can be mixed with additions
3970 @lilypond[quote,verbatim,fragment]
3971 \chords { c:sus4 c:7sus4 c:dim7 c:m6 } 
3972 @end lilypond
3973
3974 @cindex modifiers, in chords. 
3975 @cindex @code{aug}
3976 @cindex @code{dim}
3977 @cindex @code{maj}
3978 @cindex @code{sus}
3979 @cindex @code{m}
3980
3981 Since an unaltered 11 does not sound good when combined with an
3982 unaltered 3, the 11 is removed in this case (unless it is added
3983 explicitly)
3984 @c
3985 @lilypond[quote,fragment,verbatim]
3986 \chords { c:13 c:13.11 c:m13 }
3987 @end lilypond
3988
3989 @cindex @code{/}
3990
3991 An inversion (putting one pitch of the chord on the bottom), as well
3992 as bass notes, can be specified by appending
3993 @code{/}@var{pitch} to the chord
3994 @lilypond[quote,fragment,verbatim]
3995 \chords { c1 c/g c/f }
3996 @end lilypond
3997 @cindex @code{/+}
3998
3999 A bass note can be added instead of transposed out of the chord,
4000 by using  @code{/+}@var{pitch}.
4001
4002 @lilypond[quote,fragment,verbatim]
4003 \chords { c1 c/+g c/+f }
4004 @end lilypond
4005
4006 Chords is a mode similar to @code{\lyrics}, @code{\notes} etc.  Most
4007 of the commands continue to work, for example, @code{r} and
4008 @code{\skip} can be used to insert rests and spaces, and property
4009 commands may be used to change various settings.
4010
4011
4012
4013 @refbugs
4014
4015 Each step can only be present in a chord once.  The following
4016 simply produces the augmented chord, since @code{5+} is interpreted
4017 last
4018 @cindex clusters
4019 @lilypond[quote,verbatim,fragment]
4020 \chords { c:5.5-.5+ }
4021 @end lilypond
4022
4023
4024 @node Printing chord names
4025 @subsection Printing chord names
4026
4027 @cindex printing chord names
4028 @cindex chord names
4029 @cindex chords
4030
4031 For displaying printed chord names, use the @internalsref{ChordNames} context.
4032 The chords may be entered either using the notation
4033 described above, or directly using @code{<} and @code{>}
4034
4035 @lilypond[quote,verbatim,raggedright]
4036 scheme = \notes {
4037   \chords {a1 b c} <d' f' a'>  <e' g' b'>
4038 }
4039 \score {
4040   \notes <<
4041     \context ChordNames \scheme
4042     \context Staff \scheme
4043   >>
4044 }
4045 @end lilypond
4046
4047 You can make the chord changes stand out by setting
4048 @internalsref{ChordNames}.@code{chordChanges} to true.  This will only
4049 display chord names when there is a change in the chords scheme and at
4050 the start of a new line
4051
4052 @lilypond[quote,verbatim,linewidth=9\cm]
4053 scheme = \chords {
4054   c1:m c:m \break c:m c:m d
4055 }
4056 \score {
4057   \notes <<
4058     \context ChordNames {
4059       \set chordChanges = ##t
4060       \scheme }
4061     \context Staff \transpose c c' \scheme
4062   >>
4063 }
4064 @end lilypond
4065
4066 The default chord name layout is a system for Jazz music, proposed by
4067 Klaus Ignatzek (see @ref{Literature list}).  It can be tuned through the
4068 following properties
4069
4070 @table @code
4071 @cindex chordNameExceptions
4072 @item chordNameExceptions
4073 This is a list that contains the chords that have special formatting.
4074 For an example, see
4075 @inputfileref{input/regression,chord-name-exceptions.ly}.
4076 @cindex exceptions, chord names.
4077
4078
4079 @cindex majorSevenSymbol
4080 @item majorSevenSymbol
4081 This property contains the markup object used for the 7th step, when
4082 it is major. Predefined options are @code{whiteTriangleMarkup} and
4083 @code{blackTriangleMarkup}.  See
4084 @inputfileref{input/regression,chord-name-major7.ly} for an example.
4085
4086 @cindex chordNameSeparator
4087 @item chordNameSeparator
4088 Different parts of a chord name are normally separated by a
4089 slash. By setting @code{chordNameSeparator}, you can specify other
4090 separators, e.g.
4091 @lilypond[quote,fragment,verbatim]
4092 \context ChordNames \chords {
4093   c:7sus4
4094   \set chordNameSeparator
4095     = \markup { \typewriter "|" }
4096   c:7sus4
4097 }
4098 @end lilypond
4099
4100 @cindex chordRootNamer
4101 @item chordRootNamer
4102 The root of a chord is usually printed as a letter with an optional
4103 alteration. The transformation from pitch to letter is done by this
4104 function.  Special note names (for example, the German ``H'' for a
4105 B-chord) can be produced by storing a new function in this property.
4106
4107 The predefined variables @code{\germanChords},
4108 @code{\semiGermanChords} set these variables.
4109
4110
4111 @cindex chordNoteNamer
4112 @item chordNoteNamer
4113 The default is to print single pitch, e.g. the bass note, using the
4114 @code{chordRootNamer}.  The @code{chordNoteNamer} property can be set
4115 to a specialized function to change this behavior.  For example, the
4116 base can be printed in lower case.
4117
4118 @end table
4119
4120
4121 There are also two other chord name schemes implemented: an alternate
4122 Jazz chord notation, and a systematic scheme called Banter chords. The
4123 alternate jazz notation is also shown on the chart in @ref{Chord name
4124 chart}.  Turning on these styles is described in the input file
4125 @inputfileref{input/test,chord-names-jazz.ly}.
4126
4127 @cindex Banter
4128 @cindex jazz chords
4129 @cindex chords, jazz  
4130
4131
4132 @refcommands
4133
4134 @cindex @code{\germanChords}
4135 @code{\germanChords}, 
4136 @cindex @code{\semiGermanChords}
4137 @code{\semiGermanChords}.
4138
4139
4140
4141
4142 @seealso
4143
4144 Examples: @inputfileref{input/regression,chord-name-major7.ly},
4145 @inputfileref{input/regression,chord-name-exceptions.ly},
4146 @inputfileref{input/test,chord-names-jazz.ly},
4147 @inputfileref{input/test,chord-names-german.ly}.
4148
4149 Init files: @file{scm/chords-ignatzek.scm}, and @file{scm/chord-entry.scm}.
4150
4151
4152 @refbugs
4153
4154 Chord names are determined solely from the list of pitches. Chord
4155 inversions are not identified, and neither are added bass notes. This
4156 may result in strange chord names when chords are entered with the
4157 @code{< .. >} syntax.
4158
4159
4160
4161
4162 @node Orchestral music
4163 @section Orchestral music
4164
4165 @cindex  Writing parts
4166
4167 Orchestral music involves some special notation, both in the full
4168 score and the individual parts. This section explains how to tackle
4169 some common problems in orchestral music.
4170
4171
4172
4173 @menu
4174 * Multiple staff contexts::     
4175 * Rehearsal marks::             
4176 * Bar numbers::                 
4177 * Instrument names::            
4178 * Transpose::                   
4179 * Instrument transpositions::   
4180 * Multi measure rests::         
4181 * Automatic part combining::    
4182 * Hiding staves::               
4183 * Different editions from one source::  
4184 * Quoting other voices::        
4185 @end menu
4186
4187 @node Multiple staff contexts
4188 @subsection Multiple staff contexts
4189
4190 Polyphonic scores consist of many staves. These staves can be
4191 constructed in three different ways
4192 @itemize @bullet
4193 @item The group is started with a brace at the left, and bar lines are
4194 connected. This is done with the @internalsref{GrandStaff} context.
4195
4196 @item The group is started with a bracket, and bar lines are connected. This is done with the
4197 @internalsref{StaffGroup} context
4198
4199
4200 @item The group is  started with a vertical line. Bar lines are not
4201 connected.  This is the default for the score.
4202
4203 @end itemize
4204
4205 @cindex Staff, multiple
4206 @cindex bracket, vertical
4207 @cindex brace, vertical
4208 @cindex grand staff
4209 @cindex staff group
4210
4211
4212
4213
4214 @node Rehearsal marks
4215 @subsection Rehearsal marks
4216 @cindex Rehearsal marks
4217 @cindex mark
4218 @cindex @code{\mark}
4219
4220 To print a  rehearsal mark, use the @code{\mark} command
4221 @lilypond[quote,fragment,verbatim]
4222 \relative c'' {
4223   c1 \mark \default
4224   c1 \mark \default
4225   c1 \mark #8 
4226   c1 \mark \default
4227   c1 \mark \default
4228 }
4229 @end lilypond
4230
4231 @noindent
4232 (The letter I is skipped in accordance with engraving traditions.)
4233
4234 The mark is incremented automatically if you use @code{\mark
4235 \default}, but you can also use an integer argument to set the mark
4236 manually.  The value to use is stored in the property
4237 @code{rehearsalMark}.
4238
4239 The style is defined by the property @code{markFormatter}. It is a
4240 function taking the current mark (an integer) and the current context
4241 as argument. It should return a markup object. In the following
4242 example, @code{markFormatter} is set to a canned procedure. After a
4243 few measures, it is set to function that produces a boxed number. 
4244
4245 @lilypond[quote,verbatim,fragment,relative=2]
4246 \set Score.markFormatter = #format-mark-numbers 
4247 c1 \mark \default
4248 c1 \mark \default
4249 \set Score.markFormatter
4250    = #(lambda (mark  context)
4251        (make-bold-markup (make-box-markup (number->string mark))))
4252 c1 \mark \default
4253 c1 \mark \default
4254 @end lilypond
4255
4256 The file @file{scm/translation-functions.scm} contains the definitions
4257 of @code{format-mark-numbers} (the default format) and
4258 @code{format-mark-letters}. They can be used as inspiration for other
4259 formatting functions.
4260
4261
4262 @cindex coda on bar line
4263 @cindex segno on bar line
4264 @cindex fermata on bar line
4265 @cindex bar lines, symbols on
4266
4267 The @code{\mark} command can also be used to put signs like coda,
4268 segno and fermatas on a bar line. Use @code{\markup} to
4269 to access the appropriate symbol
4270
4271 @lilypond[quote,fragment,verbatim,relative=2]
4272 c1 \mark \markup { \musicglyph #"scripts-ufermata" }
4273 c1
4274 @end lilypond
4275
4276 In the case of a line break, marks must also be printed at the end of
4277 the line, and not at the beginning. Use the following to force that
4278 behavior
4279 @example
4280 \override Score.RehearsalMark  
4281   #'break-visibility = #begin-of-line-invisible
4282 @end example
4283
4284 @cindex fermatas
4285 @cindex coda
4286 @cindex segno
4287 @cindex bar lines, putting symbols on 
4288
4289 @seealso
4290
4291 Program reference: @internalsref{MarkEvent}, @internalsref{RehearsalMark}.
4292
4293 Init files: @file{scm/translation-functions.scm} contains the
4294 definition of @code{format-mark-numbers} and
4295 @code{format-mark-letters}. They can be used as inspiration for other
4296 formatting functions.
4297
4298 Examples: @inputfileref{input/regression,rehearsal-mark-letter.ly},
4299 @inputfileref{input/regression,rehearsal-mark-number.ly}.
4300
4301
4302 @node Bar numbers
4303 @subsection Bar numbers
4304
4305
4306 @cindex bar numbers
4307 @cindex measure numbers
4308 @cindex currentBarNumber
4309
4310 Bar numbers are printed by default at the start of the line.  The
4311 number itself is stored in the 
4312 @code{currentBarNumber} property,
4313 which is normally updated automatically for every measure.
4314
4315 Bar numbers can be typeset at regular intervals instead of at the
4316 beginning of each line. This is illustrated in the following example,
4317 whose source is available as
4318 @inputfileref{input/test,bar-number-regular-interval.ly}
4319
4320 @lilypondfile[quote]{bar-number-regular-interval.ly}
4321
4322 @seealso
4323
4324 Program reference: @internalsref{BarNumber}.
4325
4326 Examples: @inputfileref{input/test,bar-number-every-five-reset.ly},
4327 and @inputfileref{input/test,bar-number-regular-interval.ly}.
4328
4329 @refbugs
4330
4331 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
4332 there is one at the top. To solve this, the
4333 @code{padding} property of @internalsref{BarNumber} can be
4334 used to position the number correctly.
4335
4336 @node Instrument names
4337 @subsection Instrument names
4338
4339 In an orchestral score, instrument names are printed left side of the
4340 staves.
4341
4342 This can be achieved by setting @internalsref{Staff}.@code{instrument}
4343 and @internalsref{Staff}.@code{instr}. This will print a string before
4344 the start of the staff. For the first start, @code{instrument} is
4345 used, for the next ones @code{instr} is used.
4346
4347 @lilypond[quote,verbatim,raggedright,relative=1]
4348 \set Staff.instrument = "Ploink "
4349 \set Staff.instr = "Plk "
4350 c1
4351 \break
4352 c''
4353 @end lilypond
4354
4355 You can also use markup texts to construct more complicated instrument
4356 names, for example
4357
4358 @lilypond[quote,fragment,verbatim,raggedright]
4359 \notes {
4360   \set Staff.instrument = \markup {
4361     \column < "Clarinetti" { "in B"
4362       \smaller \flat } > }
4363    { c''1 }
4364 }
4365 @end lilypond
4366
4367 @seealso
4368
4369 Program reference: @internalsref{InstrumentName}.
4370
4371 @refbugs
4372
4373 When you put a name on a grand staff or piano staff the width of the
4374 brace is not taken into account. You must add extra spaces to the end of
4375 the name to avoid a collision.
4376
4377 @node Transpose
4378 @subsection Transpose
4379 @cindex Transpose
4380 @cindex transposition of pitches
4381 @cindex @code{\transpose}
4382
4383 A music expression can be transposed with @code{\transpose}.  The
4384 syntax is
4385 @example
4386 \transpose @var{from} @var{to} @var{musicexpr}
4387 @end example
4388
4389 This means that @var{musicexpr} is transposed by the interval between
4390 the pitches @var{from} and @var{to}: any note with pitch @code{from}
4391 is changed to @code{to}.
4392
4393
4394 For example, consider  a piece written in the key of  D major.  If
4395 this piece is a  little too low for its performer, it can be
4396 transposed up to E major with
4397 @example
4398 \transpose d e @dots{}
4399 @end example
4400
4401 Consider a part  written for violin (a C instrument). If
4402 this part is to be played on the A clarinet, the following
4403 transposition will produce the appropriate part
4404
4405 @example
4406 \transpose a c @dots{}
4407 @end example   
4408
4409 Since @var{from} and @var{to} are pitches, so @code{\transpose} must be
4410 inside a @code{\notes} section.  @code{\transpose} distinguishes
4411 between enharmonic pitches: both @code{\transpose c cis} or
4412 @code{\transpose c des} will transpose up half a tone.  The first
4413 version will print sharps and the second version will print flats
4414
4415 @lilypond[quote,raggedright,verbatim]
4416 mus =\notes { \key d \major cis d fis g }
4417 \score { \notes \context Staff {
4418   \clef "F" \mus
4419   \clef "G"
4420   \transpose c g' \mus
4421   \transpose c f' \mus
4422 }}
4423 @end lilypond
4424
4425
4426 @seealso
4427
4428 Program reference: @internalsref{TransposedMusic}, and
4429 @internalsref{UntransposableMusic}.
4430
4431 @refbugs
4432
4433 If you want to use both @code{\transpose} and @code{\relative},
4434 you must put @code{\transpose} outside of @code{\relative}, since
4435 @code{\relative} will have no effect music that appears inside a
4436 @code{\transpose}.
4437
4438 @node Instrument transpositions
4439 @subsection Instrument transpositions
4440
4441 The key of a transposing instrument can also be specified.  This
4442 applies to many wind instruments, for example, clarinets (B-flat, A and
4443 E-flat), horn (F) and trumpet (B-flat, C, D and E-flat).
4444
4445
4446 The transposition is entered after the keyword @code{\transposition}
4447
4448 @example
4449   \transposition bes   %%  B-flat clarinet
4450 @end example
4451
4452 This command sets the property @code{instrumentTransposition}. The value of
4453 this property is used for MIDI output and quotations.  It does not
4454 affect how notes are printed in the current staff.
4455
4456 @cindex transposition, MIDI
4457 @cindex transposition, instrument
4458
4459
4460 @node Multi measure rests
4461 @subsection Multi measure rests
4462 @cindex multi measure rests
4463 @cindex Rests, multi measure
4464
4465 @cindex @code{R}
4466
4467 Multi measure rests are entered using `@code{R}'. It is specifically
4468 meant for full bar rests and for entering parts: the rest can expand
4469 to fill a score with rests, or it can be printed as a single
4470 multimeasure rest. This expansion is controlled by the property
4471 @code{Score.skipBars}. If this is set to true, empty measures will not
4472 be expanded, and the appropriate number is added automatically
4473
4474 @lilypond[quote,fragment,verbatim]
4475  \time 4/4 r1 | R1 | R1*2
4476  \set Score.skipBars = ##t R1*17  R1*4
4477 @end lilypond
4478
4479 The @code{1} in @code{R1} is similar to the duration notation used for
4480 notes. Hence, for time signatures other than 4/4, you must enter other
4481 durations.  This can be done with augmentation dots or fractions
4482
4483 @lilypond[quote,fragment,verbatim]
4484 \set Score.skipBars = ##t
4485 \time 3/4
4486 R2. | R2.*2
4487 \time 13/8
4488 R1*13/8
4489 R1*13/8*12
4490 @end lilypond
4491
4492 An @code{R} spanning a single measure is printed as either a whole rest
4493 or a breve, centered in the measure regardless of the time signature.
4494
4495 @cindex text on multi-measure rest
4496 @cindex script on multi-measure rest
4497 @cindex fermata on multi-measure rest
4498
4499 Texts can be added to multi-measure rests by using the
4500 @var{note}-@code{markup} syntax (see @ref{Text markup}).  In this case, the number is
4501 replaced. If you need both texts and the number, you must add the
4502 number by hand. A variable (@code{\fermataMarkup}) is provided for
4503 adding fermatas
4504
4505
4506 @lilypond[quote,verbatim,fragment]
4507   \time 3/4
4508   R2._\markup { "Ad lib" }
4509   R2.^\fermataMarkup
4510 @end lilypond
4511
4512 If you want to have a text on the left end of a multi-measure rest,
4513 attach the text to a zero-length skip note, i.e.
4514
4515 @example
4516   s1*0^"Allegro"
4517   R1*4 
4518 @end example
4519
4520
4521 @cindex whole rests for a full measure 
4522
4523 @seealso
4524
4525 Program reference: @internalsref{MultiMeasureRestEvent},
4526 @internalsref{MultiMeasureTextEvent},
4527 @internalsref{MultiMeasureRestMusicGroup}, and
4528 @internalsref{MultiMeasureRest}.
4529
4530 The layout object @internalsref{MultiMeasureRestNumber} is for the
4531 default number, and @internalsref{MultiMeasureRestText} for user
4532 specified texts.
4533
4534 @refbugs
4535
4536 It is not possible to use fingerings (e.g. @code{R1-4}) to put numbers
4537 over multi-measure rests.
4538
4539 @cindex condensing rests
4540
4541 There is no way to automatically condense multiple rests into a single
4542 multimeasure rest. Multi measure rests do not take part in rest
4543 collisions.
4544
4545 Be careful when entering multimeasure rests followed by whole
4546 notes. The following will enter two notes lasting four measures each
4547 @example
4548  R1*4 cis cis 
4549 @end example
4550 When @code{skipBars} is set, the result will look OK, but the bar
4551 numbering will be off.
4552
4553 @node Automatic part combining
4554 @subsection Automatic part combining
4555 @cindex automatic part combining
4556 @cindex part combiner
4557
4558
4559 Automatic part combining is used to merge two parts of music onto a
4560 staff.  It is aimed at typesetting orchestral scores.  When the two
4561 parts are identical for a period of time, only one is shown.  In
4562 places where the two parts differ, they are typeset as separate
4563 voices, and stem directions are set automatically.  Also, solo and
4564 @emph{a due} parts are identified and can be marked.
4565
4566 The syntax for part combining is
4567
4568 @example
4569   \partcombine @var{musicexpr1} @var{musicexpr2}
4570 @end example
4571
4572 The music expressions will be interpreted as @internalsref{Voice}
4573 contexts. If using relative octaves, @code{\relative} should be
4574 specified for both music expressions, i.e.
4575
4576 @example
4577 \partcombine \relative @dots{}  @var{musicexpr1}
4578   \relative @dots{} @var{musicexpr2}
4579 @end example
4580
4581 @noindent
4582 A @code{\relative} section that is outside of @code{\partcombine} has
4583 no effect on the pitches of @var{musicexpr1} and @var{musicexpr2}.
4584
4585
4586 The following example demonstrates the basic functionality of the part
4587 combiner: putting parts on one staff, and setting stem directions and
4588 polyphony
4589
4590 @lilypond[quote,verbatim,raggedright,fragment]
4591 \new Staff \partcombine
4592   \relative g' { g g a( b) c c r r }
4593   \relative g' { g g r4 r e e g g }
4594 @end lilypond
4595
4596 The first @code{g} appears only once, although it was
4597 specified twice (once in each part).  Stem, slur and tie directions are
4598 set automatically, depending whether there is a solo or unisono. The
4599 first part (with context called @code{one}) always gets up stems, and
4600 `solo', while the second (called @code{two}) always gets down stems and
4601 `Solo II'.
4602
4603 If you just want the merging parts, and not the textual markings, you
4604 may set the property @code{soloADue} to false
4605
4606 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
4607 \new Staff <<
4608   \set Staff.soloADue = ##f
4609   \partcombine
4610     \relative g' { g a( b) r }
4611     \relative g' { g r4 r f }
4612 >>
4613 @end lilypond
4614
4615 @seealso
4616
4617 Program reference: @internalsref{PartCombineMusic},
4618 @internalsref{SoloOneEvent}, and
4619 @internalsref{SoloTwoEvent}, and
4620 @internalsref{UnisonoEvent}.
4621
4622 @refbugs
4623
4624 In @code{soloADue} mode, when the two voices play the same notes on and
4625 off, the part combiner may typeset @code{a2} more than once in a
4626 measure.
4627
4628 @code{\partcombine} cannot be inside @code{\times}. 
4629
4630 @code{\partcombine} cannot be inside @code{\relative}. 
4631
4632 Internally, the @code{\partcombine} interprets both arguments as
4633 @code{Voice}s named @code{one} and @code{two}, and then decides when
4634 the parts can be combined. Consequently, if the arguments switch to
4635 differently named @internalsref{Voice} contexts, the events in those
4636 will be ignored.
4637
4638 @node Hiding staves
4639 @subsection Hiding staves
4640
4641 @cindex Frenched scores
4642 @cindex Hiding staves
4643
4644 In orchestral scores, staff lines that only have rests are usually
4645 removed.  This saves some space. This style is called `French Score'.
4646 For @internalsref{Lyrics}, 
4647 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
4648 switched on by default.  When these line of these contexts turn out
4649 empty after the line-breaking process, they are removed.
4650
4651 For normal staves, a specialized @internalsref{Staff} context is
4652 available, which does the same: staves containing nothing (or only
4653 multi measure rests) are removed. The context definition is stored in
4654 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
4655 in this example disappears in the second line
4656
4657
4658 @lilypond[quote,verbatim]
4659 \score  {
4660   \notes \relative c' <<
4661     \new Staff { e4 f g a \break c1 }
4662     \new Staff { c4 d e f \break R1 }
4663   >>
4664   \paper {
4665     linewidth = 6.\cm 
4666     \context { \RemoveEmptyStaffContext }
4667   }
4668 }
4669 @end lilypond
4670
4671 The first page shows all staves in full. If empty staves should be
4672 removed from the first page too, set @code{remove-first} to false in
4673 @internalsref{RemoveEmptyVerticalGroup}.
4674
4675 Another application is making ossia sections, i.e. alternative
4676 melodies on a separate piece of staff, with help of a Frenched
4677 staff. See @inputfileref{input/test,ossia.ly} for an example.
4678
4679
4680 @node Different editions from one source
4681 @subsection Different editions from one source
4682
4683 The @code{\tag} command marks music expressions with a name. These
4684 tagged expressions can be filtered out later.  With this mechanism it
4685 is possible to make different versions of the same music source.
4686
4687 In the following example, we see two versions of a piece of music, one
4688 for the full score, and one with cue notes for the instrumental part
4689
4690 @example
4691   c1
4692   \relative c' <<
4693     \tag #'part <<
4694       R1 \\
4695       @{
4696         \set fontSize = #-1
4697         c4_"cue" f2 g4 @} 
4698     >>
4699     \tag #'score R1
4700   >>
4701   c1
4702 @end example
4703
4704 The same can be applied to articulations, texts, etc.: they are
4705 made by prepending
4706 @example
4707         -\tag #@var{your-tag} 
4708 @end example
4709 to an articulation, for example, 
4710 @example
4711     c1-\tag #'part ^4
4712 @end example
4713
4714 This defines a note with a conditional fingering indication.
4715
4716 By applying the @code{remove-tag} function, tagged expressions can be
4717 filtered. For example,
4718 @example
4719 \simultaneous @{
4720   @var{the music}
4721   \applymusic #(remove-tag 'score) @var{the music}
4722   \applymusic #(remove-tag 'part) @var{the music}
4723 @}
4724 @end example
4725 would yield
4726
4727 @lilypondfile[quote]{tag-filter.ly}
4728
4729 The argument of the @code{\tag} command should be a symbol, or a list
4730 of symbols, for example,
4731 @example
4732   \tag #'(original-part transposed-part) @dots{}
4733 @end example
4734
4735 @seealso
4736
4737 Examples: @inputfileref{input/regression,tag-filter.ly}.
4738
4739
4740 @node Quoting other voices
4741 @subsection Quoting other voices
4742
4743 With quotations, fragments of other parts can be inserted into a part
4744 directly. Before a part can be quoted, it must be marked especially as
4745 quotable. This is done with code @code{\addquote} command. The
4746 quotation may then be done with @code{\quote}
4747
4748 @example
4749 \addquote @var{name} @var{music}
4750 \quote @var{name} @var{duration}  
4751 @end example
4752
4753 @noindent
4754
4755 Here, @var{name} is an identifying string. The @var{music} is any kind
4756 of music.  This is an example of @code{\addquote}
4757
4758 @verbatim
4759 \addquote clarinet \notes\relative c' {
4760   f4 fis g gis
4761 }
4762 @end verbatim
4763
4764 During a part, a piece of music can be quoted with the @code{\quote}
4765 command. 
4766   
4767 @example
4768 \quote clarinet 2.
4769 @end example
4770
4771 This would cite 3 quarter notes (a dotted half note) of the previously
4772 added clarinet voice.
4773
4774 Quotations take into account the transposition both source and target
4775 instruments, if they are specified using the @code{\transposition} command.
4776
4777 @lilypond[quote,raggedright,verbatim]
4778 \addquote clarinet \notes\relative c' {
4779   \transposition bes
4780   f4 fis g gis
4781 }
4782 \score {
4783   \notes {
4784   e'8 f'8 \quote clarinet 2
4785 } }
4786 @end lilypond
4787
4788 @refbugs
4789
4790 Only the contents of the first @internalsref{Voice} occurring in an
4791 @code{\addquote} command will be considered for quotation, so
4792 @var{music} can not contain @code{\new} and @code{\context Voice}
4793 statements that would switch to a different Voice.
4794
4795
4796 @seealso
4797
4798 In this manual: @ref{Instrument transpositions}.
4799
4800 Examples: @inputfileref{input/regression,quote.ly}
4801 @inputfileref{input/regression,quote-transposition.ly}
4802
4803 Program reference: @internalsref{QuoteMusic}.
4804
4805 @node Ancient notation
4806 @section Ancient notation
4807
4808 @cindex Vaticana, Editio
4809 @cindex Medicaea, Editio
4810 @cindex hufnagel
4811 @cindex Petrucci
4812 @cindex mensural
4813
4814 Support for ancient notation includes features for mensural notation
4815 and Gregorian Chant notation.  There is also limited support for
4816 figured bass notation.
4817
4818 Many graphical objects provide a @code{style} property, see
4819 @ref{Ancient note heads}, @ref{Ancient accidentals}, @ref{Ancient
4820 rests}, @ref{Ancient clefs}, @ref{Ancient flags} and @ref{Ancient time
4821 signatures}.  By manipulating such a grob property, the typographical
4822 appearance of the affected graphical objects can be accommodated for a
4823 specific notation flavor without need for introducing any new
4824 notational concept.
4825
4826 Other aspects of ancient notation can not that easily be expressed as
4827 in terms of just changing a style property of a graphical object.
4828 Therefore, some notational concepts are introduced specifically for
4829 ancient notation, see @ref{Custodes}, @ref{Divisiones},
4830 @ref{Ligatures}, and @ref{Figured bass}.
4831
4832
4833 @menu
4834 * Ancient note heads::          
4835 * Ancient accidentals::         
4836 * Ancient rests::               
4837 * Ancient clefs::               
4838 * Ancient flags::               
4839 * Ancient time signatures::     
4840 * Custodes::                    
4841 * Divisiones::                  
4842 * Ligatures::                   
4843 * Figured bass::                
4844 * Vaticana style contexts::     
4845 @end menu
4846
4847 If this all is way too much of documentation for you, and you just
4848 want to dive into typesetting without worrying too much about the
4849 details on how to customize a context, you may have a look at the
4850 predefined contexts (see @ref{Vaticana style contexts}).  Use them to
4851 set up predefined style-specific voice and staff contexts, and
4852 directly go ahead with the note entry.
4853
4854 @refbugs
4855
4856 Ligatures need special spacing that has not yet been implemented.  As
4857 a result, there is too much space between ligatures most of the time,
4858 and line breaking often is unsatisfactory.  Also, lyrics do not
4859 correctly align with ligatures.
4860
4861 Accidentals must not be printed within a ligature, but instead need to
4862 be collected and printed in front of it.
4863
4864 Augmentum dots within ligatures are  not handled correctly.
4865
4866
4867 @node Ancient note heads
4868 @subsection Ancient note heads
4869
4870 @cindex note heads
4871
4872
4873 For ancient notation, a note head style other than the @code{default}
4874 style may be chosen.  This is accomplished by setting the @code{style}
4875 property of the NoteHead object to the desired value (@code{baroque},
4876 @code{neo_mensural} or @code{mensural}).  The @code{baroque} style
4877 differs from the @code{default} style only in using a square shape for
4878 @code{\breve} note heads.  The @code{neo_mensural} style differs from
4879 the @code{baroque} style in that it uses rhomboidal heads for whole
4880 notes and all smaller durations.  Stems are centered on the note
4881 heads.  This style is in particular useful when transcribing mensural
4882 music, e.g. for the incipit.  The @code{mensural} style finally
4883 produces note heads that mimic the look of note heads in historic
4884 printings of the 16th century.
4885
4886 The following example demonstrates the @code{neo_mensural} style
4887
4888 @lilypond[quote,fragment,raggedright,verbatim]
4889 \override NoteHead #'style = #'neo_mensural
4890 a'\longa a'\breve a'1 a'2 a'4 a'8 a'16
4891 @end lilypond
4892
4893 When typesetting a piece in Gregorian Chant notation, a Gregorian
4894 ligature engraver will automatically select the proper note heads,
4895 such there is no need to explicitly set the note head style.  Still,
4896 the note head style can be set e.g. to @code{vaticana_punctum} to
4897 produce punctum neumes.  Similarly, a mensural ligature engraver is
4898 used to automatically assemble mensural ligatures.  See
4899 @ref{Ligatures} for how ligature engravers work.
4900
4901 @seealso
4902
4903 In this manual
4904 @ref{Percussion staves} use note head styles of their own that are
4905 frequently used in contemporary music notation.
4906
4907 Examples: @inputfileref{input/regression,note-head-style.ly} gives an
4908 overview over all available note head styles.
4909
4910
4911 @node Ancient accidentals
4912 @subsection Ancient accidentals
4913
4914 @cindex accidentals
4915
4916
4917 Use the @code{style} property of grob @internalsref{Accidental} to
4918 select ancient accidentals.   Supported styles are
4919 @code{mensural}, @code{vaticana}, @code{hufnagel} and @code{medicaea}.
4920
4921 @lilypond[quote,raggedright,staffsize=26]
4922 \score {
4923     \notes {
4924         \fatText
4925         s
4926         ^\markup {
4927             \column <
4928                 "vaticana" 
4929                 { " " \musicglyph #"accidentals-vaticana-1"
4930                   " " \musicglyph #"accidentals-vaticana0" }
4931             >
4932             \column <
4933                 "medicaea"
4934                 { " " \musicglyph #"accidentals-medicaea-1" }
4935             >
4936             \column <
4937                 "hufnagel"
4938                 { " " \musicglyph #"accidentals-hufnagel-1" }
4939             >
4940             \column <
4941                 "mensural"
4942                 { " " \musicglyph #"accidentals-mensural-1"
4943                   " " \musicglyph #"accidentals-mensural1" }
4944             >
4945         }
4946     }
4947     \paper {
4948         raggedright = ##t 
4949         interscoreline = 1
4950         \context {
4951             \Score
4952             \remove "Bar_number_engraver"
4953         }
4954         \context{
4955             \Staff
4956             \remove "Clef_engraver"
4957             \remove "Key_engraver"
4958             \remove "Time_signature_engraver"
4959             \remove "Staff_symbol_engraver"
4960             minimumVerticalExtent = ##f
4961         }
4962     }
4963 }
4964 @end lilypond
4965
4966 As shown, not all accidentals are supported by each style.  When
4967 trying to access an unsupported accidental, LilyPond will switch to a
4968 different style, as demonstrated in
4969 @inputfileref{input/test,ancient-accidentals.ly}.
4970
4971 Similarly to local accidentals, the style of the key signature can be
4972 controlled by the @code{style} property of the
4973 @internalsref{KeySignature} grob.
4974
4975 @seealso
4976
4977 In this manual: @ref{Pitches}, @ref{Chromatic alterations} and
4978 @ref{Accidentals} give a general introduction into the use of
4979 accidentals.  @ref{Key signature} gives a general introduction into
4980 the use of key signatures.
4981
4982 Program reference: @internalsref{KeySignature}.
4983
4984 Examples: @inputfileref{input/test,ancient-accidentals.ly}.
4985
4986 @node Ancient rests
4987 @subsection Ancient rests
4988
4989 @cindex rests
4990
4991
4992 Use the @code{style} property of grob @internalsref{Rest} to select
4993 ancient accidentals.   Supported styles are @code{classical},
4994 @code{neo_mensural} and @code{mensural}.  @code{classical} differs
4995 from the @code{default} style only in that the quarter rest looks like
4996 a horizontally mirrored 8th rest.  The @code{neo_mensural} style suits
4997 well for e.g. the incipit of a transcribed mensural piece of music.
4998 The @code{mensural} style finally mimics the appearance of rests as
4999 in historic prints of the 16th century.
5000
5001 The following example demonstrates the @code{neo_mensural} style
5002
5003 @lilypond[quote,fragment,raggedright,verbatim]
5004 \override Rest #'style = #'neo_mensural
5005 r\longa r\breve r1 r2 r4 r8 r16
5006 @end lilypond
5007
5008 There are no 32th and 64th rests specifically for the mensural or
5009 neo-mensural style.  Instead, the rests from the default style will be
5010 taken.  See @inputfileref{input/test,rests.ly} for a chart of all
5011 rests.
5012
5013 There are no rests in Gregorian Chant notation; instead, it uses
5014 @ref{Divisiones}.
5015
5016 @seealso
5017
5018 In this manual: @ref{Rests} gives a general introduction into the use of rests.
5019
5020
5021 @node Ancient clefs
5022 @subsection Ancient clefs
5023
5024 @cindex clefs
5025
5026
5027 LilyPond supports a variety of clefs, many of them ancient.
5028
5029 The following table shows all ancient clefs that are supported via the
5030 @code{\clef} command.  Some of the clefs use the same glyph, but
5031 differ only with respect to the line they are printed on.  In such
5032 cases, a trailing number in the name is used to enumerate these clefs.
5033 Still, you can manually force a clef glyph to be typeset on an
5034 arbitrary line, as described in @ref{Clef}.  The note printed to the
5035 right side of each clef in the example column denotes the @code{c'}
5036 with respect to that clef.
5037
5038 @multitable @columnfractions  .3 .3 .3 .1
5039
5040 @item
5041 @b{Glyph Name} @tab
5042 @b{Description} @tab
5043 @b{Supported Clefs} @tab
5044 @b{Example}
5045
5046 @item
5047 @code{clefs-neo_mensural_c} @tab
5048 modern style mensural C clef @tab
5049 @code{neo_mensural_c1}, @code{neo_mensural_c2},
5050 @code{neo_mensural_c3}, @code{neo_mensural_c4} @tab
5051 @lilypond[quote,relative=1,notime]
5052 \override Staff.TimeSignature   #'transparent = ##t
5053 \clef "neo_mensural_c2" c
5054 @end lilypond
5055
5056 @item
5057 @code{clefs-petrucci_c1}
5058 @code{clefs-petrucci_c2}
5059 @code{clefs-petrucci_c3}
5060 @code{clefs-petrucci_c4}
5061 @code{clefs-petrucci_c5}
5062
5063 @tab
5064 petrucci style mensural C clefs, for use  on different  staff lines
5065 (the examples shows the 2nd staff line C clef).
5066
5067 @tab
5068 @code{petrucci_c1}
5069 @code{petrucci_c2}
5070 @code{petrucci_c3}
5071 @code{petrucci_c4}
5072 @code{petrucci_c5}
5073
5074 @tab
5075 @lilypond[quote,relative=1,notime]
5076 \override Staff.TimeSignature   #'transparent = ##t
5077 \clef "petrucci_c2" c
5078 @end lilypond
5079
5080 @item
5081 @code{clefs-petrucci_f} @tab
5082 petrucci style mensural F clef @tab
5083 @code{petrucci_f} @tab
5084 @lilypond[quote,relative=1,notime]
5085 \override Staff.TimeSignature   #'transparent = ##t
5086 \clef "petrucci_f" c
5087 @end lilypond
5088
5089 @item
5090 @code{clefs-petrucci_g} @tab
5091 petrucci style mensural G clef @tab
5092 @code{petrucci_g} @tab
5093 @lilypond[quote,relative=1,notime]
5094 \override Staff.TimeSignature   #'transparent = ##t
5095 \clef "petrucci_g" c
5096 @end lilypond
5097
5098 @item
5099 @code{clefs-mensural_c} @tab
5100 historic style mensural C clef @tab
5101 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
5102 @code{mensural_c4} @tab
5103 @lilypond[quote,relative=1,notime]
5104 \override Staff.TimeSignature   #'transparent = ##t
5105 \clef "mensural_c2" c
5106 @end lilypond
5107
5108 @item
5109 @code{clefs-mensural_f} @tab
5110 historic style mensural F clef @tab
5111 @code{mensural_f} @tab
5112 @lilypond[quote,relative=1,notime]
5113 \override Staff.TimeSignature   #'transparent = ##t
5114 \clef "mensural_f" c
5115 @end lilypond
5116
5117 @item
5118 @code{clefs-mensural_g} @tab
5119 historic style mensural G clef @tab
5120 @code{mensural_g} @tab
5121 @lilypond[quote,relative=1,notime]
5122 \override Staff.TimeSignature   #'transparent = ##t
5123 \clef "mensural_g" c
5124 @end lilypond
5125
5126 @item
5127 @code{clefs-vaticana_do} @tab
5128 Editio Vaticana style do clef @tab
5129 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
5130 @lilypond[quote,relative=1,notime]
5131     \override Staff.StaffSymbol   #'line-count = #4
5132 \override Staff.TimeSignature   #'transparent = ##t
5133 \clef "vaticana_do2" c
5134 @end lilypond
5135
5136 @item
5137 @code{clefs-vaticana_fa} @tab
5138 Editio Vaticana style fa clef @tab
5139 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
5140 @lilypond[quote,relative=1,notime]
5141     \override Staff.StaffSymbol   #'line-count = #4
5142 \override Staff.TimeSignature   #'transparent = ##t
5143 \clef "vaticana_fa2" c
5144 @end lilypond
5145
5146 @item
5147 @code{clefs-medicaea_do} @tab
5148 Editio Medicaea style do clef @tab
5149 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
5150 @lilypond[quote,relative=1,notime]
5151     \override Staff.StaffSymbol   #'line-count = #4
5152 \override Staff.TimeSignature   #'transparent = ##t
5153 \clef "medicaea_do2" c
5154 @end lilypond
5155
5156 @item
5157 @code{clefs-medicaea_fa} @tab
5158 Editio Medicaea style fa clef @tab
5159 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
5160 @lilypond[quote,relative=1,notime]
5161     \override Staff.StaffSymbol   #'line-count = #4
5162 \override Staff.TimeSignature   #'transparent = ##t
5163 \clef "medicaea_fa2" c
5164 @end lilypond
5165
5166 @item
5167 @code{clefs-hufnagel_do} @tab
5168 historic style hufnagel do clef @tab
5169 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
5170 @lilypond[quote,relative=1,notime]
5171     \override Staff.StaffSymbol   #'line-count = #4
5172 \override Staff.TimeSignature   #'transparent = ##t
5173 \clef "hufnagel_do2" c
5174 @end lilypond
5175
5176 @item
5177 @code{clefs-hufnagel_fa} @tab
5178 historic style hufnagel fa clef @tab
5179 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
5180 @lilypond[quote,relative=1,notime]
5181     \override Staff.StaffSymbol   #'line-count = #4
5182 \override Staff.TimeSignature   #'transparent = ##t
5183 \clef "hufnagel_fa2" c
5184 @end lilypond
5185
5186 @item
5187 @code{clefs-hufnagel_do_fa} @tab
5188 historic style hufnagel combined do/fa clef @tab
5189 @code{hufnagel_do_fa} @tab
5190 @lilypond[quote,relative=1,notime]
5191 \override Staff.TimeSignature   #'transparent = ##t
5192 \clef "hufnagel_do_fa" c
5193 @end lilypond
5194
5195 @end multitable
5196
5197
5198
5199 @emph{Modern style} means ``as is typeset in contemporary editions of
5200 transcribed mensural music''.
5201
5202 @emph{Petrucci style} means ``inspired by printings published by the
5203 famous engraver Petrucci (1466-1539)''.
5204
5205 @emph{Historic style} means ``as was typeset or written in historic
5206 editions (other than those of Petrucci)''.
5207
5208 @emph{Editio XXX style} means ``as is/was printed in Editio XXX''.
5209
5210 Petrucci used C clefs with differently balanced left-side vertical
5211 beams, depending on which staff line it is printed.
5212
5213 @seealso
5214
5215 In this manual: see @ref{Clef}.
5216
5217 @refbugs
5218
5219 The mensural g clef is mapped to the Petrucci g clef, until a new
5220 mensural g clef is implemented.
5221
5222
5223
5224 @node Ancient flags
5225 @subsection Ancient flags
5226
5227 @cindex flags
5228
5229
5230 Use the @code{flag-style} property of grob @internalsref{Stem} to
5231 select ancient flags.  Besides the @code{default} flag style,
5232  only @code{mensural} style is supported
5233
5234 @lilypond[quote,fragment,raggedright,verbatim]
5235 \override Stem #'flag-style = #'mensural
5236 \override Stem #'thickness = #1.0
5237 \override NoteHead #'style = #'mensural
5238 \autoBeamOff
5239 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
5240 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
5241 @end lilypond
5242
5243 Note that the innermost flare of each mensural flag always is
5244 vertically aligned with a staff line.  If you do not like this
5245 behavior, you can set the @code{adjust-if-on-staffline} property of
5246 grob @internalsref{Stem} to @code{##f}.  Then, the vertical position
5247 of the end of each flare is different between notes on staff lines and
5248 notes between staff lines
5249
5250 @lilypond[quote,fragment,raggedright]
5251 \override Stem #'flag-style = #'mensural
5252 \override Stem #'thickness = #1.0
5253 \override Stem #'adjust-if-on-staffline = ##f
5254 \override NoteHead #'style = #'mensural
5255 \autoBeamOff
5256 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
5257 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
5258 @end lilypond
5259
5260 There is no particular flag style for neo-mensural notation.  Hence,
5261 when typesetting e.g. the incipit of a transcribed piece of mensural
5262 music, the default flag style should be used.  There are no flags in
5263 Gregorian Chant notation.
5264
5265
5266 @node Ancient time signatures
5267 @subsection Ancient time signatures
5268
5269 @cindex time signatures
5270
5271
5272 There is limited support for mensural time signatures.   The
5273 glyphs are hard-wired to particular time fractions.  In other words,
5274 to get a particular mensural signature glyph with the @code{\time n/m}
5275 command, @code{n} and @code{m} have to be chosen according to the
5276 following table
5277
5278 @lilypond[quote]
5279 \score {
5280     \notes {
5281         \set Score.timing = ##f
5282         \set Score.barAlways = ##t
5283         s_\markup { "$\\backslash$time 4/4" }
5284          ^\markup { "       " \musicglyph #"timesig-neo_mensural4/4" }
5285         s
5286         s_\markup { "$\\backslash$time 2/2" }
5287          ^\markup { "       " \musicglyph #"timesig-neo_mensural2/2" }
5288         s
5289         s_\markup { "$\\backslash$time 6/4" }
5290          ^\markup { "       " \musicglyph #"timesig-neo_mensural6/4" }
5291         s
5292         s_\markup { "$\\backslash$time 6/8" }
5293          ^\markup { "       " \musicglyph #"timesig-neo_mensural6/8" }
5294         \break
5295         s_\markup { "$\\backslash$time 3/2" }
5296          ^\markup { "       " \musicglyph #"timesig-neo_mensural3/2" }
5297         s
5298         s_\markup { "$\\backslash$time 3/4" }
5299          ^\markup { "       " \musicglyph #"timesig-neo_mensural3/4" }
5300         s
5301         s_\markup { "$\\backslash$time 9/4" }
5302          ^\markup { "       " \musicglyph #"timesig-neo_mensural9/4" }
5303         s
5304         s_\markup { "$\\backslash$time 9/8" }
5305          ^\markup { "       " \musicglyph #"timesig-neo_mensural9/8" }
5306         \break
5307         s_\markup { "$\\backslash$time 4/8" }
5308          ^\markup { "       " \musicglyph #"timesig-neo_mensural4/8" }
5309         s
5310         s_\markup { "$\\backslash$time 2/4" }
5311          ^\markup { "       " \musicglyph #"timesig-neo_mensural2/4" }
5312         \break
5313     }
5314     \paper {
5315         indent = 0.0
5316         raggedright = ##t
5317         \context {
5318             \Staff
5319             \remove Staff_symbol_engraver
5320             \remove Clef_engraver
5321             \remove Time_signature_engraver
5322         }
5323     }
5324 }
5325 @end lilypond
5326
5327 Use the @code{style} property of grob @internalsref{TimeSignature} to
5328 select ancient time signatures.  Supported styles are
5329 @code{neo_mensural} and @code{mensural}.  The above table uses the
5330 @code{neo_mensural} style.  This style is appropriate e.g. for the
5331 incipit of transcriptions of mensural pieces.  The @code{mensural}
5332 style mimics the look of historical printings of the 16th century.
5333
5334 @inputfileref{input/test,time.ly} gives an overview over all available
5335 ancient and modern styles.
5336
5337 @seealso
5338
5339 Program reference: @ref{Time signature} gives a general introduction into the use of time
5340 signatures.
5341
5342 @refbugs
5343
5344 Mensural signature glyphs are mapped to time fractions in a hard-wired
5345 way.  This mapping is sensible, but still arbitrary: given a mensural
5346 time signature, the time fraction represents a modern meter that
5347 usually will be a good choice when transcribing a mensural piece of
5348 music.  For a particular piece of mensural music, however, the mapping
5349 may be unsatisfactory.  In particular, the mapping assumes a fixed
5350 transcription of durations (e.g. brevis = half note in 2/2, i.e. 4:1).
5351 Some glyphs (such as the alternate glyph for 6/8 meter) are not at all
5352 accessible through the @code{\time} command.
5353
5354 Mensural time signatures are supported typographically, but not yet
5355 musically.  The internal representation of durations is 
5356 based on a purely binary system; a ternary division such as 1 brevis =
5357 3 semibrevis (tempus perfectum) or 1 semibrevis = 3 minima (cum
5358 prolatione maiori) is not correctly handled: event times in ternary
5359 modes will be badly computed, resulting e.g. in horizontally
5360 misaligned note heads, and bar checks are likely to erroneously fail.
5361
5362 The syntax and semantics of the @code{\time} command for mensural
5363 music is subject to change.
5364
5365 @node Custodes
5366 @subsection Custodes
5367
5368 @cindex custos
5369 @cindex custodes
5370
5371 A @emph{custos} (plural: @emph{custodes}; Latin word for `guard') is a
5372 symbol that appears at the end of a staff.  It anticipates the pitch
5373 of the first note(s) of the following line and thus helps the player
5374 or singer to manage line breaks during performance, thus enhancing
5375 readability of a score.
5376
5377 Custodes were frequently used in music notation until the 17th
5378 century.  Nowadays, they have survived only in a few particular forms
5379 of musical notation such as contemporary editions of Gregorian chant
5380 like the @emph{editio vaticana}.  There are different custos glyphs
5381 used in different flavors of notational style.
5382
5383 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
5384 @internalsref{Staff} context when declaring the @code{\paper} block,
5385 as shown in the following example
5386
5387 @example
5388 \paper @{
5389   \context @{
5390      \Staff
5391      \consists Custos_engraver
5392      Custos \override #'style = #'mensural
5393   @}
5394 @}
5395 @end example
5396
5397 The result looks like this
5398
5399 @lilypond[quote,raggedright]
5400 \score {
5401     \notes {
5402         a'1
5403         \override Staff.Custos #'style = #'mensural
5404         \break
5405         g'
5406     }
5407     \paper {
5408         \context {
5409             \Staff
5410             \consists Custos_engraver
5411         }
5412     }
5413 }
5414 @end lilypond
5415
5416 The custos glyph is selected by the @code{style} property. The styles
5417 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
5418 @code{mensural}.  They are demonstrated in the following fragment
5419
5420 @lilypond[quote]
5421 \score {
5422        \new Lyrics    \lyrics {
5423         \markup {
5424             \column <
5425                 "vaticana" 
5426                 { " " \musicglyph #"custodes-vaticana-u0" }
5427             > }
5428         \markup {    \column <
5429                 "medicaea"
5430                 { " " \musicglyph #"custodes-medicaea-u0" }
5431             >}
5432             \markup {
5433             \column <
5434                 "hufnagel"
5435                 { " " \musicglyph #"custodes-hufnagel-u0" }
5436             >}
5437             \markup {
5438             \column <
5439                 "mensural"
5440                 { " " \musicglyph #"custodes-mensural-u0" }
5441             >}
5442         }
5443     
5444     \paper {
5445         raggedright = ##t 
5446         }      
5447 }
5448 @end lilypond
5449
5450 @seealso
5451
5452 Program reference: @internalsref{Custos}.
5453
5454 Examples: @inputfileref{input/regression,custos.ly}.
5455
5456
5457 @node Divisiones
5458 @subsection Divisiones
5459
5460 @cindex divisio
5461 @cindex divisiones
5462 @cindex finalis
5463
5464 A @emph{divisio} (plural: @emph{divisiones}; Latin word for
5465 `division') is a staff context symbol that is used to structure
5466 Gregorian music into phrases and sections.  The musical meaning of
5467 @emph{divisio minima}, @emph{divisio maior} and @emph{divisio maxima}
5468 can be characterized as short, medium and long pause, somewhat like
5469 @ref{Breath marks}.  The @emph{finalis} sign not only marks the end of
5470 a chant, but is also frequently used within a single
5471 antiphonal/responsorial chant to mark the end of each section.
5472
5473
5474 To use divisiones, include the file @code{gregorian-init.ly}.  It
5475 contains definitions that you can apply by just inserting
5476 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
5477 and @code{\finalis} at proper places in the input.  Some editions use
5478 @emph{virgula} or @emph{caesura} instead of divisio minima.
5479 Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and
5480 @code{\caesura}
5481
5482 @lilypondfile[quote,raggedright]{divisiones.ly}
5483
5484 @refcommands
5485
5486 @cindex @code{\virgula}
5487 @code{\virgula},
5488 @cindex @code{\caesura}
5489 @code{\caesura},
5490 @cindex @code{\divisioMinima}
5491 @code{\divisioMinima},
5492 @cindex @code{\divisioMaior}
5493 @code{\divisioMaior},
5494 @cindex @code{\divisioMaxima}
5495 @code{\divisioMaxima},
5496 @cindex @code{\finalis}
5497 @code{\finalis}.
5498
5499 @seealso
5500
5501 In this manual: @ref{Breath marks}.
5502
5503 Program reference: @internalsref{BreathingSign}, @internalsref{BreathingSignEvent}.
5504
5505 Examples: @inputfileref{input/test,divisiones.ly}.
5506
5507 @node Ligatures
5508 @subsection Ligatures
5509
5510 @cindex Ligatures
5511
5512 @c TODO: Should double check if I recalled things correctly when I wrote
5513 @c down the following paragraph by heart.
5514
5515 A ligature is a coherent graphical symbol that represents at least two
5516 distinct notes.  Ligatures originally appeared in the manuscripts of
5517 Gregorian chant notation roughly since the 9th century to denote
5518 ascending or descending sequences of notes.  
5519
5520 Ligatures are entered by enclosing them in @code{\[} and @code{\]}.
5521 Some ligature styles may need additional input syntax specific for
5522 this particular type of ligature.  By default, the
5523 @internalsref{LigatureBracket} engraver just puts a square bracket
5524 above the ligature
5525
5526 @lilypond[quote,raggedright,verbatim]
5527 \score {
5528   \notes \transpose c c' {
5529     \[ g c a f d' \]
5530     a g f
5531     \[ e f a g \]
5532   }
5533 }
5534 @end lilypond
5535
5536 To select a specific style of ligatures, a proper ligature engraver
5537 has to be added to the @internalsref{Voice} context, as explained in
5538 the following subsections.   Only white mensural ligatures
5539 are supported with certain limitations.
5540
5541 @menu
5542 * White mensural ligatures::    
5543 * Gregorian square neumes ligatures::  
5544 @end menu
5545
5546 @node White mensural ligatures
5547 @subsubsection White mensural ligatures
5548
5549 @cindex Mensural ligatures
5550 @cindex White mensural ligatures
5551
5552 There is limited support for white mensural ligatures.  
5553
5554 To engrave white mensural ligatures, in the paper block the
5555 @internalsref{Mensural_ligature_engraver} has to be put into the
5556 @internalsref{Voice} context, and remove the
5557 @internalsref{Ligature_bracket_engraver}
5558
5559 @example
5560     \paper @{
5561         \context @{
5562             \Voice
5563             \remove Ligature_bracket_engraver
5564             \consists Mensural_ligature_engraver
5565         @}
5566     @}
5567 @end example
5568
5569 There is no additional input language to describe the shape of a
5570 white mensural ligature.  The shape is rather determined solely from
5571 the pitch and duration of the enclosed notes.  While this approach may
5572 take a new user a while to get accustomed, it has the great advantage
5573 that the full musical information of the ligature is known internally.
5574 This is not only required for correct MIDI output, but also allows for
5575 automatic transcription of the ligatures.
5576
5577 For example,
5578
5579 @example
5580         \set Score.timing = ##f
5581         \set Score.defaultBarType = "empty"
5582         \override NoteHead #'style = #'neo_mensural
5583         \override Staff.TimeSignature   #'style = #'neo_mensural
5584         \clef "petrucci_g"
5585         \[ g\longa c\breve a\breve f\breve d'\longa \]
5586         s4
5587         \[ e1 f1 a\breve g\longa \]
5588 @end example
5589 @lilypond[quote,raggedright]
5590 \score {
5591     \notes \transpose c c' {
5592         \set Score.timing = ##f
5593         \set Score.defaultBarType = "empty"
5594         \override NoteHead #'style = #'neo_mensural
5595         \override Staff.TimeSignature   #'style = #'neo_mensural
5596         \clef "petrucci_g"
5597         \[ g\longa c\breve a\breve f\breve d'\longa \]
5598         s4
5599         \[ e1 f1 a\breve g\longa \]
5600     }
5601     \paper {
5602         \context {
5603             \Voice
5604             \remove Ligature_bracket_engraver
5605             \consists Mensural_ligature_engraver
5606         }
5607     }
5608 }
5609 @end lilypond
5610
5611 Without replacing @internalsref{Ligature_bracket_engraver} with
5612 @internalsref{Mensural_ligature_engraver}, the same music transcribes
5613 to the following
5614
5615 @lilypond[quote,raggedright]
5616 \score {
5617     \notes \transpose c c' {
5618         \set Score.timing = ##f
5619         \set Score.defaultBarType = "empty"
5620         \override NoteHead #'style = #'neo_mensural
5621         \override Staff.TimeSignature   #'style = #'neo_mensural
5622         \clef "petrucci_g"
5623         \[ g\longa c\breve a\breve f\breve d'\longa \]
5624         s4
5625         \[ e1 f1 a\breve g\longa \]
5626     }
5627 }
5628 @end lilypond
5629
5630 @refbugs
5631
5632 The implementation is experimental; it may output strange warnings or
5633 even crash in some cases or produce weird results on more complex
5634 ligatures.
5635
5636 @node Gregorian square neumes ligatures
5637 @subsubsection Gregorian square neumes ligatures
5638
5639 @cindex Square neumes ligatures
5640 @cindex Gregorian square neumes ligatures
5641
5642 Gregorian square neumes notation (following the style of the Editio
5643 Vaticana) is under heavy development, but not yet really usable for
5644 production purposes.  Core ligatures can already be typeset, but
5645 essential issues for serious typesetting are still under development,
5646 such as (among others) horizontal alignment of multiple ligatures,
5647 lyrics alignment and proper accidentals handling.  Still, this section
5648 gives a sneak preview of what Gregorian chant may look like once it
5649 will work.
5650
5651 The following table contains the extended neumes table of the 2nd
5652 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
5653 1983 by the monks of Solesmes.
5654
5655 @multitable @columnfractions .4 .2 .2 .2
5656
5657 @item
5658 @b{Neuma aut@*Neumarum Elementa} @tab
5659 @b{Figurae@*Rectae} @tab
5660 @b{Figurae@*Liquescentes Auctae} @tab
5661 @b{Figurae@*Liquescentes Deminutae}
5662
5663 @c TODO: \paper block is identical in all of the below examples.
5664 @c Therefore, it should somehow be included rather than duplicated all
5665 @c the time. --jr
5666
5667 @c why not make identifiers in ly/engraver-init.ly? --hwn
5668
5669 @c Because it's just used to typeset plain notes without
5670 @c a staff for demonstration purposes rather than something
5671 @c special of Gregorian chant notation. --jr
5672
5673 @item
5674 @code{1. Punctum}
5675 @tab
5676 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.5\cm]
5677 \include "gregorian-init.ly"
5678 \score {
5679     \notes \transpose c c' {
5680         % Punctum
5681         \[ b \]
5682         \noBreak s^\markup {"a"} \noBreak
5683
5684         % Punctum Inclinatum
5685         \[ \inclinatum b \]
5686         \noBreak s^\markup {"b"}
5687     }
5688     \paper {
5689         interscoreline = 1
5690         \context {
5691             \Score
5692             \remove "Bar_number_engraver"
5693         }
5694         \context {
5695             \Staff
5696             \remove "Clef_engraver"
5697             \remove "Key_engraver"
5698             \override StaffSymbol #'transparent = ##t
5699             \remove "Time_signature_engraver"
5700             \remove "Bar_engraver"
5701             minimumVerticalExtent = ##f
5702         }
5703         \context {
5704             \Voice
5705             \remove Ligature_bracket_engraver
5706             \consists Vaticana_ligature_engraver
5707             \override NoteHead #'style = #'vaticana_punctum
5708             \override Stem #'transparent = ##t
5709         }
5710     }
5711 }
5712 @end lilypond
5713 @tab
5714 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.5\cm]
5715 \include "gregorian-init.ly"
5716 \score {
5717     \notes \transpose c c' {
5718         % Punctum Auctum Ascendens
5719         \[ \auctum \ascendens b \]
5720         \noBreak s^\markup {"c"} \noBreak
5721
5722         % Punctum Auctum Descendens
5723         \[ \auctum \descendens b \]
5724         \noBreak s^\markup {"d"} \noBreak
5725
5726         % Punctum Inclinatum Auctum
5727         \[ \inclinatum \auctum b \]
5728         \noBreak s^\markup {"e"}
5729     }
5730     \paper {
5731         interscoreline = 1
5732         \context {
5733             \Score
5734             \remove "Bar_number_engraver"
5735         }
5736         \context {
5737             \Staff
5738             \remove "Clef_engraver"
5739             \remove "Key_engraver"
5740             \override StaffSymbol #'transparent = ##t
5741             \remove "Time_signature_engraver"
5742             \remove "Bar_engraver"
5743             minimumVerticalExtent = ##f
5744         }
5745         \context {
5746             \Voice
5747             \remove Ligature_bracket_engraver
5748             \consists Vaticana_ligature_engraver
5749             \override NoteHead #'style = #'vaticana_punctum
5750             \override Stem #'transparent = ##t
5751         }
5752     }
5753 }
5754 @end lilypond
5755 @tab
5756 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
5757 \include "gregorian-init.ly"
5758 \score {
5759     \notes \transpose c c' {
5760         % Punctum Inclinatum Parvum
5761         \[ \inclinatum \deminutum b \]
5762         \noBreak s^\markup {"f"}
5763     }
5764     \paper {
5765         interscoreline = 1
5766         \context {
5767             \Score
5768             \remove "Bar_number_engraver"
5769         }
5770         \context {
5771             \Staff
5772             \remove "Clef_engraver"
5773             \remove "Key_engraver"
5774             \override StaffSymbol #'transparent = ##t
5775             \remove "Time_signature_engraver"
5776             \remove "Bar_engraver"
5777             minimumVerticalExtent = ##f
5778         }
5779         \context {
5780             \Voice
5781             \remove Ligature_bracket_engraver
5782             \consists Vaticana_ligature_engraver
5783             \override NoteHead #'style = #'vaticana_punctum
5784             \override Stem #'transparent = ##t
5785         }
5786     }
5787 }
5788 @end lilypond
5789
5790 @item
5791 @code{2. Virga}
5792 @tab
5793 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
5794 \include "gregorian-init.ly"
5795 \score {
5796     \notes \transpose c c' {
5797         % Virga
5798         \[ \virga b \]
5799         \noBreak s^\markup {"g"}
5800     }
5801     \paper {
5802         interscoreline = 1
5803         \context {
5804             \Score
5805             \remove "Bar_number_engraver"
5806         }
5807         \context {
5808             \Staff
5809             \remove "Clef_engraver"
5810             \remove "Key_engraver"
5811             \override StaffSymbol #'transparent = ##t
5812             \remove "Time_signature_engraver"
5813             \remove "Bar_engraver"
5814             minimumVerticalExtent = ##f
5815         }
5816         \context {
5817             \Voice
5818             \remove Ligature_bracket_engraver
5819             \consists Vaticana_ligature_engraver
5820             \override NoteHead #'style = #'vaticana_punctum
5821             \override Stem #'transparent = ##t
5822         }
5823     }
5824 }
5825 @end lilypond
5826 @tab
5827 @tab
5828
5829 @item
5830 @code{3. Apostropha vel Stropha}
5831 @tab
5832 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
5833 \include "gregorian-init.ly"
5834 \score {
5835     \notes \transpose c c' {
5836         % Stropha
5837         \[ \stropha b \]
5838         \noBreak s^\markup {"h"}
5839     }
5840     \paper {
5841         interscoreline = 1
5842         \context {
5843             \Score
5844             \remove "Bar_number_engraver"
5845         }
5846         \context {
5847             \Staff
5848             \remove "Clef_engraver"
5849             \remove "Key_engraver"
5850             \override StaffSymbol #'transparent = ##t
5851             \remove "Time_signature_engraver"
5852             \remove "Bar_engraver"
5853             minimumVerticalExtent = ##f
5854         }
5855         \context {
5856             \Voice
5857             \remove Ligature_bracket_engraver
5858             \consists Vaticana_ligature_engraver
5859             \override NoteHead #'style = #'vaticana_punctum
5860             \override Stem #'transparent = ##t
5861         }
5862     }
5863 }
5864 @end lilypond
5865 @tab
5866 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
5867 \include "gregorian-init.ly"
5868 \score {
5869     \notes \transpose c c' {
5870         % Stropha Aucta
5871         \[ \stropha \auctum b \]
5872         \noBreak s^\markup {"i"}
5873     }
5874     \paper {
5875         interscoreline = 1
5876         \context {
5877             \Score
5878             \remove "Bar_number_engraver"
5879         }
5880         \context {
5881             \Staff
5882             \remove "Clef_engraver"
5883             \remove "Key_engraver"
5884             \override StaffSymbol #'transparent = ##t
5885             \remove "Time_signature_engraver"
5886             \remove "Bar_engraver"
5887             minimumVerticalExtent = ##f
5888         }
5889         \context {
5890             \Voice
5891             \remove Ligature_bracket_engraver
5892             \consists Vaticana_ligature_engraver
5893             \override NoteHead #'style = #'vaticana_punctum
5894             \override Stem #'transparent = ##t
5895         }
5896     }
5897 }
5898 @end lilypond
5899 @tab
5900
5901 @item
5902 @code{4. Oriscus}
5903 @tab
5904 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
5905 \include "gregorian-init.ly"
5906 \score {
5907     \notes \transpose c c' {
5908         % Oriscus
5909         \[ \oriscus b \]
5910         \noBreak s^\markup {"j"}
5911     }
5912     \paper {
5913         interscoreline = 1
5914         \context {
5915             \Score
5916             \remove "Bar_number_engraver"
5917         }
5918         \context {
5919             \Staff
5920             \remove "Clef_engraver"
5921             \remove "Key_engraver"
5922             \override StaffSymbol #'transparent = ##t
5923             \remove "Time_signature_engraver"
5924             \remove "Bar_engraver"
5925             minimumVerticalExtent = ##f
5926         }
5927         \context {
5928             \Voice
5929             \remove Ligature_bracket_engraver
5930             \consists Vaticana_ligature_engraver
5931             \override NoteHead #'style = #'vaticana_punctum
5932             \override Stem #'transparent = ##t
5933         }
5934     }
5935 }
5936 @end lilypond
5937 @tab
5938 @tab
5939
5940 @item
5941 @code{5. Clivis vel Flexa}
5942 @tab
5943 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
5944 \include "gregorian-init.ly"
5945 \score {
5946     \notes \transpose c c' {
5947         % Clivis vel Flexa
5948         \[ b \flexa g \]
5949         s^\markup {"k"}
5950     }
5951     \paper {
5952         interscoreline = 1
5953         \context {
5954             \Score
5955             \remove "Bar_number_engraver"
5956         }
5957         \context {
5958             \Staff
5959             \remove "Clef_engraver"
5960             \remove "Key_engraver"
5961             \override StaffSymbol #'transparent = ##t
5962             \remove "Time_signature_engraver"
5963             \remove "Bar_engraver"
5964             minimumVerticalExtent = ##f
5965         }
5966         \context {
5967             \Voice
5968             \remove Ligature_bracket_engraver
5969             \consists Vaticana_ligature_engraver
5970             \override NoteHead #'style = #'vaticana_punctum
5971             \override Stem #'transparent = ##t
5972         }
5973     }
5974 }
5975 @end lilypond
5976 @tab
5977 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.0\cm]
5978 \include "gregorian-init.ly"
5979 \score {
5980     \notes \transpose c c' {
5981         % Clivis Aucta Descendens
5982         \[ b \flexa \auctum \descendens g \]
5983         \noBreak s^\markup {"l"} \noBreak
5984
5985         % Clivis Aucta Ascendens
5986         \[ b \flexa \auctum \ascendens g \]
5987         \noBreak s^\markup {"m"}
5988     }
5989     \paper {
5990         interscoreline = 1
5991         \context {
5992             \Score
5993             \remove "Bar_number_engraver"
5994         }
5995         \context {
5996             \Staff
5997             \remove "Clef_engraver"
5998             \remove "Key_engraver"
5999             \override StaffSymbol #'transparent = ##t
6000             \remove "Time_signature_engraver"
6001             \remove "Bar_engraver"
6002             minimumVerticalExtent = ##f
6003         }
6004         \context {
6005             \Voice
6006             \remove Ligature_bracket_engraver
6007             \consists Vaticana_ligature_engraver
6008             \override NoteHead #'style = #'vaticana_punctum
6009             \override Stem #'transparent = ##t
6010         }
6011     }
6012 }
6013 @end lilypond
6014 @tab
6015 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6016 \include "gregorian-init.ly"
6017 \score {
6018     \notes \transpose c c' {
6019         % Cephalicus
6020         \[ b \flexa \deminutum g \]
6021         s^\markup {"n"}
6022     }
6023     \paper {
6024         interscoreline = 1
6025         \context {
6026             \Score
6027             \remove "Bar_number_engraver"
6028         }
6029         \context {
6030             \Staff
6031             \remove "Clef_engraver"
6032             \remove "Key_engraver"
6033             \override StaffSymbol #'transparent = ##t
6034             \remove "Time_signature_engraver"
6035             \remove "Bar_engraver"
6036             minimumVerticalExtent = ##f
6037         }
6038         \context {
6039             \Voice
6040             \remove Ligature_bracket_engraver
6041             \consists Vaticana_ligature_engraver
6042             \override NoteHead #'style = #'vaticana_punctum
6043             \override Stem #'transparent = ##t
6044         }
6045     }
6046 }
6047 @end lilypond
6048
6049 @item
6050 @code{6. Podatus vel Pes}
6051 @tab
6052 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6053 \include "gregorian-init.ly"
6054 \score {
6055     \notes \transpose c c' {
6056         % Podatus vel Pes
6057         \[ g \pes b \]
6058         s^\markup {"o"}
6059     }
6060     \paper {
6061         interscoreline = 1
6062         \context {
6063             \Score
6064             \remove "Bar_number_engraver"
6065         }
6066         \context {
6067             \Staff
6068             \remove "Clef_engraver"
6069             \remove "Key_engraver"
6070             \override StaffSymbol #'transparent = ##t
6071             \remove "Time_signature_engraver"
6072             \remove "Bar_engraver"
6073             minimumVerticalExtent = ##f
6074         }
6075         \context {
6076             \Voice
6077             \remove Ligature_bracket_engraver
6078             \consists Vaticana_ligature_engraver
6079             \override NoteHead #'style = #'vaticana_punctum
6080             \override Stem #'transparent = ##t
6081         }
6082     }
6083 }
6084 @end lilypond
6085 @tab
6086 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.0\cm]
6087 \include "gregorian-init.ly"
6088 \score {
6089     \notes \transpose c c' {
6090         % Pes Auctus Descendens
6091         \[ g \pes \auctum \descendens b \]
6092         \noBreak s^\markup {"p"} \noBreak
6093
6094         % Pes Auctus Ascendens
6095         \[ g \pes \auctum \ascendens b \]
6096         \noBreak s^\markup {"q"}
6097     }
6098     \paper {
6099         interscoreline = 1
6100         \context {
6101             \Score
6102             \remove "Bar_number_engraver"
6103         }
6104         \context {
6105             \Staff
6106             \remove "Clef_engraver"
6107             \remove "Key_engraver"
6108             \override StaffSymbol #'transparent = ##t
6109             \remove "Time_signature_engraver"
6110             \remove "Bar_engraver"
6111             minimumVerticalExtent = ##f
6112         }
6113         \context {
6114             \Voice
6115             \remove Ligature_bracket_engraver
6116             \consists Vaticana_ligature_engraver
6117             \override NoteHead #'style = #'vaticana_punctum
6118             \override Stem #'transparent = ##t
6119         }
6120     }
6121 }
6122 @end lilypond
6123 @tab
6124 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6125 \include "gregorian-init.ly"
6126 \score {
6127     \notes \transpose c c' {
6128         % Epiphonus
6129         \[ g \pes \deminutum b \]
6130         s^\markup {"r"}
6131     }
6132     \paper {
6133         interscoreline = 1
6134         \context {
6135             \Score
6136             \remove "Bar_number_engraver"
6137         }
6138         \context {
6139             \Staff
6140             \remove "Clef_engraver"
6141             \remove "Key_engraver"
6142             \override StaffSymbol #'transparent = ##t
6143             \remove "Time_signature_engraver"
6144             \remove "Bar_engraver"
6145             minimumVerticalExtent = ##f
6146         }
6147         \context {
6148             \Voice
6149             \remove Ligature_bracket_engraver
6150             \consists Vaticana_ligature_engraver
6151             \override NoteHead #'style = #'vaticana_punctum
6152             \override Stem #'transparent = ##t
6153         }
6154     }
6155 }
6156 @end lilypond
6157
6158 @item
6159 @code{7. Pes Quassus}
6160 @tab
6161 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6162 \include "gregorian-init.ly"
6163 \score {
6164     \notes \transpose c c' {
6165         % Pes Quassus
6166         \[ \oriscus g \pes \virga b \]
6167         s^\markup {"s"}
6168     }
6169     \paper {
6170         interscoreline = 1
6171         \context {
6172             \Score
6173             \remove "Bar_number_engraver"
6174         }
6175         \context {
6176             \Staff
6177             \remove "Clef_engraver"
6178             \remove "Key_engraver"
6179             \override StaffSymbol #'transparent = ##t
6180             \remove "Time_signature_engraver"
6181             \remove "Bar_engraver"
6182             minimumVerticalExtent = ##f
6183         }
6184         \context {
6185             \Voice
6186             \remove Ligature_bracket_engraver
6187             \consists Vaticana_ligature_engraver
6188             \override NoteHead #'style = #'vaticana_punctum
6189             \override Stem #'transparent = ##t
6190         }
6191     }
6192 }
6193 @end lilypond
6194 @tab
6195 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6196 \include "gregorian-init.ly"
6197 \score {
6198     \notes \transpose c c' {
6199         % Pes Quassus Auctus Descendens
6200         \[ \oriscus g \pes \auctum \descendens b \]
6201         s^\markup {"t"}
6202     }
6203     \paper {
6204         interscoreline = 1
6205         \context {
6206             \Score
6207             \remove "Bar_number_engraver"
6208         }
6209         \context {
6210             \Staff
6211             \remove "Clef_engraver"
6212             \remove "Key_engraver"
6213             \override StaffSymbol #'transparent = ##t
6214             \remove "Time_signature_engraver"
6215             \remove "Bar_engraver"
6216             minimumVerticalExtent = ##f
6217         }
6218         \context {
6219             \Voice
6220             \remove Ligature_bracket_engraver
6221             \consists Vaticana_ligature_engraver
6222             \override NoteHead #'style = #'vaticana_punctum
6223             \override Stem #'transparent = ##t
6224         }
6225     }
6226 }
6227 @end lilypond
6228 @tab
6229
6230 @item
6231 @code{8. Quilisma Pes}
6232 @tab
6233 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6234 \include "gregorian-init.ly"
6235 \score {
6236     \notes \transpose c c' {
6237         % Quilisma Pes
6238         \[ \quilisma g \pes b \]
6239         s^\markup {"u"}
6240     }
6241     \paper {
6242         interscoreline = 1
6243         \context {
6244             \Score
6245             \remove "Bar_number_engraver"
6246         }
6247         \context {
6248             \Staff
6249             \remove "Clef_engraver"
6250             \remove "Key_engraver"
6251             \override StaffSymbol #'transparent = ##t
6252             \remove "Time_signature_engraver"
6253             \remove "Bar_engraver"
6254             minimumVerticalExtent = ##f
6255         }
6256         \context {
6257             \Voice
6258             \remove Ligature_bracket_engraver
6259             \consists Vaticana_ligature_engraver
6260             \override NoteHead #'style = #'vaticana_punctum
6261             \override Stem #'transparent = ##t
6262         }
6263     }
6264 }
6265 @end lilypond
6266 @tab
6267 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6268 \include "gregorian-init.ly"
6269 \score {
6270     \notes \transpose c c' {
6271         % Quilisma Pes Auctus Descendens
6272         \[ \quilisma g \pes \auctum \descendens b \]
6273         s^\markup {"v"}
6274     }
6275     \paper {
6276         interscoreline = 1
6277         \context {
6278             \Score
6279             \remove "Bar_number_engraver"
6280         }
6281         \context {
6282             \Staff
6283             \remove "Clef_engraver"
6284             \remove "Key_engraver"
6285             \override StaffSymbol #'transparent = ##t
6286             \remove "Time_signature_engraver"
6287             \remove "Bar_engraver"
6288             minimumVerticalExtent = ##f
6289         }
6290         \context {
6291             \Voice
6292             \remove Ligature_bracket_engraver
6293             \consists Vaticana_ligature_engraver
6294             \override NoteHead #'style = #'vaticana_punctum
6295             \override Stem #'transparent = ##t
6296         }
6297     }
6298 }
6299 @end lilypond
6300 @tab
6301
6302 @item
6303 @code{9. Podatus Initio Debilis}
6304 @tab
6305 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6306 \include "gregorian-init.ly"
6307 \score {
6308     \notes \transpose c c' {
6309         % Pes Initio Debilis
6310         \[ \deminutum g \pes b \]
6311         s^\markup {"w"}
6312     }
6313     \paper {
6314         interscoreline = 1
6315         \context {
6316             \Score
6317             \remove "Bar_number_engraver"
6318         }
6319         \context {
6320             \Staff
6321             \remove "Clef_engraver"
6322             \remove "Key_engraver"
6323             \override StaffSymbol #'transparent = ##t
6324             \remove "Time_signature_engraver"
6325             \remove "Bar_engraver"
6326             minimumVerticalExtent = ##f
6327         }
6328         \context {
6329             \Voice
6330             \remove Ligature_bracket_engraver
6331             \consists Vaticana_ligature_engraver
6332             \override NoteHead #'style = #'vaticana_punctum
6333             \override Stem #'transparent = ##t
6334         }
6335     }
6336 }
6337 @end lilypond
6338 @tab
6339 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6340 \include "gregorian-init.ly"
6341 \score {
6342     \notes \transpose c c' {
6343         % Pes Auctus Descendens Initio Debilis
6344         \[ \deminutum g \pes \auctum \descendens b \]
6345         s^\markup {"x"}
6346     }
6347     \paper {
6348         interscoreline = 1
6349         \context {
6350             \Score
6351             \remove "Bar_number_engraver"
6352         }
6353         \context {
6354             \Staff
6355             \remove "Clef_engraver"
6356             \remove "Key_engraver"
6357             \override StaffSymbol #'transparent = ##t
6358             \remove "Time_signature_engraver"
6359             \remove "Bar_engraver"
6360             minimumVerticalExtent = ##f
6361         }
6362         \context {
6363             \Voice
6364             \remove Ligature_bracket_engraver
6365             \consists Vaticana_ligature_engraver
6366             \override NoteHead #'style = #'vaticana_punctum
6367             \override Stem #'transparent = ##t
6368         }
6369     }
6370 }
6371 @end lilypond
6372 @tab
6373
6374 @item
6375 @code{10. Torculus}
6376 @tab
6377 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6378 \include "gregorian-init.ly"
6379 \score {
6380     \notes \transpose c c' {
6381         % Torculus
6382         \[ a \pes b \flexa g \]
6383         s^\markup {"y"}
6384     }
6385     \paper {
6386         interscoreline = 1
6387         \context {
6388             \Score
6389             \remove "Bar_number_engraver"
6390         }
6391         \context {
6392             \Staff
6393             \remove "Clef_engraver"
6394             \remove "Key_engraver"
6395             \override StaffSymbol #'transparent = ##t
6396             \remove "Time_signature_engraver"
6397             \remove "Bar_engraver"
6398             minimumVerticalExtent = ##f
6399         }
6400         \context {
6401             \Voice
6402             \remove Ligature_bracket_engraver
6403             \consists Vaticana_ligature_engraver
6404             \override NoteHead #'style = #'vaticana_punctum
6405             \override Stem #'transparent = ##t
6406         }
6407     }
6408 }
6409 @end lilypond
6410 @tab
6411 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6412 \include "gregorian-init.ly"
6413 \score {
6414     \notes \transpose c c' {
6415         % Torculus Auctus Descendens
6416         \[ a \pes b \flexa \auctum \descendens g \]
6417         s^\markup {"z"}
6418     }
6419     \paper {
6420         interscoreline = 1
6421         \context {
6422             \Score
6423             \remove "Bar_number_engraver"
6424         }
6425         \context {
6426             \Staff
6427             \remove "Clef_engraver"
6428             \remove "Key_engraver"
6429             \override StaffSymbol #'transparent = ##t
6430             \remove "Time_signature_engraver"
6431             \remove "Bar_engraver"
6432             minimumVerticalExtent = ##f
6433         }
6434         \context {
6435             \Voice
6436             \remove Ligature_bracket_engraver
6437             \consists Vaticana_ligature_engraver
6438             \override NoteHead #'style = #'vaticana_punctum
6439             \override Stem #'transparent = ##t
6440         }
6441     }
6442 }
6443 @end lilypond
6444 @tab
6445 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6446 \include "gregorian-init.ly"
6447 \score {
6448     \notes \transpose c c' {
6449         % Torculus Deminutus
6450         \[ a \pes b \flexa \deminutum g \]
6451         s^\markup {"A"}
6452     }
6453     \paper {
6454         interscoreline = 1
6455         \context {
6456             \Score
6457             \remove "Bar_number_engraver"
6458         }
6459         \context {
6460             \Staff
6461             \remove "Clef_engraver"
6462             \remove "Key_engraver"
6463             \override StaffSymbol #'transparent = ##t
6464             \remove "Time_signature_engraver"
6465             \remove "Bar_engraver"
6466             minimumVerticalExtent = ##f
6467         }
6468         \context {
6469             \Voice
6470             \remove Ligature_bracket_engraver
6471             \consists Vaticana_ligature_engraver
6472             \override NoteHead #'style = #'vaticana_punctum
6473             \override Stem #'transparent = ##t
6474         }
6475     }
6476 }
6477 @end lilypond
6478
6479 @item
6480 @code{11. Torculus Initio Debilis}
6481 @tab
6482 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6483 \include "gregorian-init.ly"
6484 \score {
6485     \notes \transpose c c' {
6486         % Torculus Initio Debilis
6487         \[ \deminutum a \pes b \flexa g \]
6488         s^\markup {"B"}
6489     }
6490     \paper {
6491         interscoreline = 1
6492         \context {
6493             \Score
6494             \remove "Bar_number_engraver"
6495         }
6496         \context {
6497             \Staff
6498             \remove "Clef_engraver"
6499             \remove "Key_engraver"
6500             \override StaffSymbol #'transparent = ##t
6501             \remove "Time_signature_engraver"
6502             \remove "Bar_engraver"
6503             minimumVerticalExtent = ##f
6504         }
6505         \context {
6506             \Voice
6507             \remove Ligature_bracket_engraver
6508             \consists Vaticana_ligature_engraver
6509             \override NoteHead #'style = #'vaticana_punctum
6510             \override Stem #'transparent = ##t
6511         }
6512     }
6513 }
6514 @end lilypond
6515 @tab
6516 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6517 \include "gregorian-init.ly"
6518 \score {
6519     \notes \transpose c c' {
6520         % Torculus Auctus Descendens Initio Debilis
6521         \[ \deminutum a \pes b \flexa \auctum \descendens g \]
6522         s^\markup {"C"}
6523     }
6524     \paper {
6525         interscoreline = 1
6526         \context {
6527             \Score
6528             \remove "Bar_number_engraver"
6529         }
6530         \context {
6531             \Staff
6532             \remove "Clef_engraver"
6533             \remove "Key_engraver"
6534             \override StaffSymbol #'transparent = ##t
6535             \remove "Time_signature_engraver"
6536             \remove "Bar_engraver"
6537             minimumVerticalExtent = ##f
6538         }
6539         \context {
6540             \Voice
6541             \remove Ligature_bracket_engraver
6542             \consists Vaticana_ligature_engraver
6543             \override NoteHead #'style = #'vaticana_punctum
6544             \override Stem #'transparent = ##t
6545         }
6546     }
6547 }
6548 @end lilypond
6549 @tab
6550 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6551 \include "gregorian-init.ly"
6552 \score {
6553     \notes \transpose c c' {
6554         % Torculus Deminutus Initio Debilis
6555         \[ \deminutum a \pes b \flexa \deminutum g \]
6556         s^\markup {"D"}
6557     }
6558     \paper {
6559         interscoreline = 1
6560         \context {
6561             \Score
6562             \remove "Bar_number_engraver"
6563         }
6564         \context {
6565             \Staff
6566             \remove "Clef_engraver"
6567             \remove "Key_engraver"
6568             \override StaffSymbol #'transparent = ##t
6569             \remove "Time_signature_engraver"
6570             \remove "Bar_engraver"
6571             minimumVerticalExtent = ##f
6572         }
6573         \context {
6574             \Voice
6575             \remove Ligature_bracket_engraver
6576             \consists Vaticana_ligature_engraver
6577             \override NoteHead #'style = #'vaticana_punctum
6578             \override Stem #'transparent = ##t
6579         }
6580     }
6581 }
6582 @end lilypond
6583
6584 @item
6585 @code{12. Porrectus}
6586 @tab
6587 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6588 \include "gregorian-init.ly"
6589 \score {
6590     \notes \transpose c c' {
6591         % Porrectus
6592         \[ a \flexa g \pes b \]
6593         s^\markup {"E"}
6594     }
6595     \paper {
6596         interscoreline = 1
6597         \context {
6598             \Score
6599             \remove "Bar_number_engraver"
6600         }
6601         \context {
6602             \Staff
6603             \remove "Clef_engraver"
6604             \remove "Key_engraver"
6605             \override StaffSymbol #'transparent = ##t
6606             \remove "Time_signature_engraver"
6607             \remove "Bar_engraver"
6608             minimumVerticalExtent = ##f
6609         }
6610         \context {
6611             \Voice
6612             \remove Ligature_bracket_engraver
6613             \consists Vaticana_ligature_engraver
6614             \override NoteHead #'style = #'vaticana_punctum
6615             \override Stem #'transparent = ##t
6616         }
6617     }
6618 }
6619 @end lilypond
6620 @tab
6621 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6622 \include "gregorian-init.ly"
6623 \score {
6624     \notes \transpose c c' {
6625         % Porrectus Auctus Descendens
6626         \[ a \flexa g \pes \auctum \descendens b \]
6627         s^\markup {"F"}
6628     }
6629     \paper {
6630         interscoreline = 1
6631         \context {
6632             \Score
6633             \remove "Bar_number_engraver"
6634         }
6635         \context {
6636             \Staff
6637             \remove "Clef_engraver"
6638             \remove "Key_engraver"
6639             \override StaffSymbol #'transparent = ##t
6640             \remove "Time_signature_engraver"
6641             \remove "Bar_engraver"
6642             minimumVerticalExtent = ##f
6643         }
6644         \context {
6645             \Voice
6646             \remove Ligature_bracket_engraver
6647             \consists Vaticana_ligature_engraver
6648             \override NoteHead #'style = #'vaticana_punctum
6649             \override Stem #'transparent = ##t
6650         }
6651     }
6652 }
6653 @end lilypond
6654 @tab
6655 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6656 \include "gregorian-init.ly"
6657 \score {
6658     \notes \transpose c c' {
6659         % Porrectus Deminutus
6660         \[ a \flexa g \pes \deminutum b \]
6661         s^\markup {"G"}
6662     }
6663     \paper {
6664         interscoreline = 1
6665         \context {
6666             \Score
6667             \remove "Bar_number_engraver"
6668         }
6669         \context {
6670             \Staff
6671             \remove "Clef_engraver"
6672             \remove "Key_engraver"
6673             \override StaffSymbol #'transparent = ##t
6674             \remove "Time_signature_engraver"
6675             \remove "Bar_engraver"
6676             minimumVerticalExtent = ##f
6677         }
6678         \context {
6679             \Voice
6680             \remove Ligature_bracket_engraver
6681             \consists Vaticana_ligature_engraver
6682             \override NoteHead #'style = #'vaticana_punctum
6683             \override Stem #'transparent = ##t
6684         }
6685     }
6686 }
6687 @end lilypond
6688
6689 @item
6690 @code{13. Climacus}
6691 @tab
6692 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6693 \include "gregorian-init.ly"
6694 \score {
6695     \notes \transpose c c' {
6696         % Climacus
6697         \[ \virga b \inclinatum a \inclinatum g \]
6698         s^\markup {"H"}
6699     }
6700     \paper {
6701         interscoreline = 1
6702         \context {
6703             \Score
6704             \remove "Bar_number_engraver"
6705         }
6706         \context {
6707             \Staff
6708             \remove "Clef_engraver"
6709             \remove "Key_engraver"
6710             \override StaffSymbol #'transparent = ##t
6711             \remove "Time_signature_engraver"
6712             \remove "Bar_engraver"
6713             minimumVerticalExtent = ##f
6714         }
6715         \context {
6716             \Voice
6717             \remove Ligature_bracket_engraver
6718             \consists Vaticana_ligature_engraver
6719             \override NoteHead #'style = #'vaticana_punctum
6720             \override Stem #'transparent = ##t
6721         }
6722     }
6723 }
6724 @end lilypond
6725 @tab
6726 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6727 \include "gregorian-init.ly"
6728 \score {
6729     \notes \transpose c c' {
6730         % Climacus Auctus
6731         \[ \virga b \inclinatum a \inclinatum \auctum g \]
6732         s^\markup {"I"}
6733     }
6734     \paper {
6735         interscoreline = 1
6736         \context {
6737             \Score
6738             \remove "Bar_number_engraver"
6739         }
6740         \context {
6741             \Staff
6742             \remove "Clef_engraver"
6743             \remove "Key_engraver"
6744             \override StaffSymbol #'transparent = ##t
6745             \remove "Time_signature_engraver"
6746             \remove "Bar_engraver"
6747             minimumVerticalExtent = ##f
6748         }
6749         \context {
6750             \Voice
6751             \remove Ligature_bracket_engraver
6752             \consists Vaticana_ligature_engraver
6753             \override NoteHead #'style = #'vaticana_punctum
6754             \override Stem #'transparent = ##t
6755         }
6756     }
6757 }
6758 @end lilypond
6759 @tab
6760 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6761 \include "gregorian-init.ly"
6762 \score {
6763     \notes \transpose c c' {
6764         % Climacus Deminutus
6765         \[ \virga b \inclinatum a \inclinatum \deminutum g \]
6766         s^\markup {"J"}
6767     }
6768     \paper {
6769         interscoreline = 1
6770         \context {
6771             \Score
6772             \remove "Bar_number_engraver"
6773         }
6774         \context {
6775             \Staff
6776             \remove "Clef_engraver"
6777             \remove "Key_engraver"
6778             \override StaffSymbol #'transparent = ##t
6779             \remove "Time_signature_engraver"
6780             \remove "Bar_engraver"
6781             minimumVerticalExtent = ##f
6782         }
6783         \context {
6784             \Voice
6785             \remove Ligature_bracket_engraver
6786             \consists Vaticana_ligature_engraver
6787             \override NoteHead #'style = #'vaticana_punctum
6788             \override Stem #'transparent = ##t
6789         }
6790     }
6791 }
6792 @end lilypond
6793
6794 @item
6795 @code{14. Scandicus}
6796 @tab
6797 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6798 \include "gregorian-init.ly"
6799 \score {
6800     \notes \transpose c c' {
6801         % Scandicus
6802         \[ g \pes a \virga b \]
6803         s^\markup {"K"}
6804     }
6805     \paper {
6806         interscoreline = 1
6807         \context {
6808             \Score
6809             \remove "Bar_number_engraver"
6810         }
6811         \context {
6812             \Staff
6813             \remove "Clef_engraver"
6814             \remove "Key_engraver"
6815             \override StaffSymbol #'transparent = ##t
6816             \remove "Time_signature_engraver"
6817             \remove "Bar_engraver"
6818             minimumVerticalExtent = ##f
6819         }
6820         \context {
6821             \Voice
6822             \remove Ligature_bracket_engraver
6823             \consists Vaticana_ligature_engraver
6824             \override NoteHead #'style = #'vaticana_punctum
6825             \override Stem #'transparent = ##t
6826         }
6827     }
6828 }
6829 @end lilypond
6830 @tab
6831 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6832 \include "gregorian-init.ly"
6833 \score {
6834     \notes \transpose c c' {
6835         % Scandicus Auctus Descendens
6836         \[ g \pes a \pes \auctum \descendens b \]
6837         s^\markup {"L"}
6838     }
6839     \paper {
6840         interscoreline = 1
6841         \context {
6842             \Score
6843             \remove "Bar_number_engraver"
6844         }
6845         \context {
6846             \Staff
6847             \remove "Clef_engraver"
6848             \remove "Key_engraver"
6849             \override StaffSymbol #'transparent = ##t
6850             \remove "Time_signature_engraver"
6851             \remove "Bar_engraver"
6852             minimumVerticalExtent = ##f
6853         }
6854         \context {
6855             \Voice
6856             \remove Ligature_bracket_engraver
6857             \consists Vaticana_ligature_engraver
6858             \override NoteHead #'style = #'vaticana_punctum
6859             \override Stem #'transparent = ##t
6860         }
6861     }
6862 }
6863 @end lilypond
6864 @tab
6865 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6866 \include "gregorian-init.ly"
6867 \score {
6868     \notes \transpose c c' {
6869         % Scandicus Deminutus
6870         \[ g \pes a \pes \deminutum b \]
6871         s^\markup {"M"}
6872     }
6873     \paper {
6874         interscoreline = 1
6875         \context {
6876             \Score
6877             \remove "Bar_number_engraver"
6878         }
6879         \context {
6880             \Staff
6881             \remove "Clef_engraver"
6882             \remove "Key_engraver"
6883             \override StaffSymbol #'transparent = ##t
6884             \remove "Time_signature_engraver"
6885             \remove "Bar_engraver"
6886             minimumVerticalExtent = ##f
6887         }
6888         \context {
6889             \Voice
6890             \remove Ligature_bracket_engraver
6891             \consists Vaticana_ligature_engraver
6892             \override NoteHead #'style = #'vaticana_punctum
6893             \override Stem #'transparent = ##t
6894         }
6895     }
6896 }
6897 @end lilypond
6898
6899 @item
6900 @code{15. Salicus}
6901 @tab
6902 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6903 \include "gregorian-init.ly"
6904 \score {
6905     \notes \transpose c c' {
6906         % Salicus
6907         \[ g \oriscus a \pes \virga b \]
6908         s^\markup {"N"}
6909     }
6910     \paper {
6911         interscoreline = 1
6912         \context {
6913             \Score
6914             \remove "Bar_number_engraver"
6915         }
6916         \context {
6917             \Staff
6918             \remove "Clef_engraver"
6919             \remove "Key_engraver"
6920             \override StaffSymbol #'transparent = ##t
6921             \remove "Time_signature_engraver"
6922             \remove "Bar_engraver"
6923             minimumVerticalExtent = ##f
6924         }
6925         \context {
6926             \Voice
6927             \remove Ligature_bracket_engraver
6928             \consists Vaticana_ligature_engraver
6929             \override NoteHead #'style = #'vaticana_punctum
6930             \override Stem #'transparent = ##t
6931         }
6932     }
6933 }
6934 @end lilypond
6935 @tab
6936 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6937 \include "gregorian-init.ly"
6938 \score {
6939     \notes \transpose c c' {
6940         % Salicus Auctus Descendens
6941         \[ g \oriscus a \pes \auctum \descendens b \]
6942         s^\markup {"O"}
6943     }
6944     \paper {
6945         interscoreline = 1
6946         \context {
6947             \Score
6948             \remove "Bar_number_engraver"
6949         }
6950         \context {
6951             \Staff
6952             \remove "Clef_engraver"
6953             \remove "Key_engraver"
6954             \override StaffSymbol #'transparent = ##t
6955             \remove "Time_signature_engraver"
6956             \remove "Bar_engraver"
6957             minimumVerticalExtent = ##f
6958         }
6959         \context {
6960             \Voice
6961             \remove Ligature_bracket_engraver
6962             \consists Vaticana_ligature_engraver
6963             \override NoteHead #'style = #'vaticana_punctum
6964             \override Stem #'transparent = ##t
6965         }
6966     }
6967 }
6968 @end lilypond
6969 @tab
6970
6971 @item
6972 @code{16. Trigonus}
6973 @tab
6974 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6975 \include "gregorian-init.ly"
6976 \score {
6977   \notes \transpose c c' {
6978     % Trigonus
6979     \[ \stropha b \stropha b \stropha a \]
6980     s^\markup {"P"}
6981   }
6982   \paper {
6983     interscoreline = 1
6984     \context {
6985       \Score
6986       \remove "Bar_number_engraver"
6987     }
6988     \context {
6989       \Staff
6990       \remove "Clef_engraver"
6991       \remove "Key_engraver"
6992       \override StaffSymbol #'transparent = ##t
6993       \remove "Time_signature_engraver"
6994       \remove "Bar_engraver"
6995       minimumVerticalExtent = ##f
6996     }
6997     \context {
6998       \Voice
6999       \remove Ligature_bracket_engraver
7000       \consists Vaticana_ligature_engraver
7001       \override NoteHead #'style = #'vaticana_punctum
7002       \override Stem #'transparent = ##t
7003     }
7004   }
7005 }
7006 @end lilypond
7007 @tab
7008 @tab
7009
7010 @end multitable
7011
7012
7013 Unlike most other neumes notation systems, the input language for
7014 neumes does not necessarily reflect directly the typographical
7015 appearance, but is designed to solely focuse on musical meaning.  For
7016 example, @code{\[ a \pes b \flexa g \]} produces a Torculus consisting
7017 of three Punctum heads, while @code{\[ a \flexa g \pes b \]} produces
7018 a Porrectus with a curved flexa shape and only a single Punctum head.
7019 There is no command to explicitly typeset the curved flexa shape; the
7020 decision of when to typeset a curved flexa shape is purely taken from
7021 the musical input.  The idea of this approach is to separate the
7022 musical aspects of the input from the notation style of the output.
7023 This way, the same input can be reused to typeset the same music in a
7024 different style of Gregorian chant notation.
7025
7026 The following table shows the code fragments that produce the
7027 ligatures in the above neumes table.  The letter in the first column
7028 in each line of the below table indicates to which ligature in the
7029 above table it refers.  The second column gives the name of the
7030 ligature.  The third column shows the code fragment that produces this
7031 ligature, using @code{g}, @code{a} and @code{b} as example pitches.
7032
7033 @multitable @columnfractions .1 .4 .5
7034
7035 @item
7036 @b{#} @tab
7037 @b{Name} @tab
7038 @b{Input Language}
7039
7040 @item
7041 a @tab
7042 Punctum @tab
7043 @code{\[ b \]}
7044
7045 @item
7046 b @tab
7047 Punctum Inclinatum @tab
7048 @code{\[ \inclinatum b \]}
7049
7050 @item
7051 c @tab
7052 Punctum Auctum Ascendens @tab
7053 @code{\[ \auctum \ascendens b \]}
7054
7055 @item
7056 d @tab
7057 Punctum Auctum Descendens @tab
7058 @code{\[ \auctum \descendens b \]}
7059
7060 @item
7061 e @tab
7062 Punctum Inclinatum Auctum @tab
7063 @code{\[ \inclinatum \auctum b \]}
7064
7065 @item
7066 f @tab
7067 Punctum Inclinatum Parvum @tab
7068 @code{\[ \inclinatum \deminutum b \]}
7069
7070 @item
7071 g @tab
7072 Virga @tab
7073 @code{\[ \virga b \]}
7074
7075 @item
7076 h @tab
7077 Stropha @tab
7078 @code{\[ \stropha b \]}
7079
7080 @item
7081 i @tab
7082 Stropha Aucta @tab
7083 @code{\[ \stropha \auctum b \]}
7084
7085 @item
7086 j @tab
7087 Oriscus @tab
7088 @code{\[ \oriscus b \]}
7089
7090 @item
7091 k @tab
7092 Clivis vel Flexa @tab
7093 @code{\[ b \flexa g \]}
7094
7095 @item
7096 l @tab
7097 Clivis Aucta Descendens @tab
7098 @code{\[ b \flexa \auctum \descendens g \]}
7099
7100 @item
7101 m @tab
7102 Clivis Aucta Ascendens @tab
7103 @code{\[ b \flexa \auctum \ascendens g \]}
7104
7105 @item
7106 n @tab
7107 Cephalicus @tab
7108 @code{\[ b \flexa \deminutum g \]}
7109
7110 @item
7111 o @tab
7112 Podatus vel Pes @tab
7113 @code{\[ g \pes b \]}
7114
7115 @item
7116 p @tab
7117 Pes Auctus Descendens @tab
7118 @code{\[ g \pes \auctum \descendens b \]}
7119
7120 @item
7121 q @tab
7122 Pes Auctus Ascendens @tab
7123 @code{\[ g \pes \auctum \ascendens b \]}
7124
7125 @item
7126 r @tab
7127 Epiphonus @tab
7128 @code{\[ g \pes \deminutum b \]}
7129
7130 @item
7131 s @tab
7132 Pes Quassus @tab
7133 @code{\[ \oriscus g \pes \virga b \]}
7134
7135 @item
7136 t @tab
7137 Pes Quassus Auctus Descendens @tab
7138 @code{\[ \oriscus g \pes \auctum \descendens b \]}
7139
7140 @item
7141 u @tab
7142 Quilisma Pes @tab
7143 @code{\[ \quilisma g \pes b \]}
7144
7145 @item
7146 v @tab
7147 Quilisma Pes Auctus Descendens @tab
7148 @code{\[ \quilisma g \pes \auctum \descendens b \]}
7149
7150 @item
7151 w @tab
7152 Pes Initio Debilis @tab
7153 @code{\[ \deminutum g \pes b \]}
7154
7155 @item
7156 x @tab
7157 Pes Auctus Descendens Initio Debilis @tab
7158 @code{\[ \deminutum g \pes \auctum \descendens b \]}
7159
7160 @item
7161 y @tab
7162 Torculus @tab
7163 @code{\[ a \pes b \flexa g \]}
7164
7165 @item
7166 z @tab
7167 Torculus Auctus Descendens @tab
7168 @code{\[ a \pes b \flexa \auctum \descendens g \]}
7169
7170 @item
7171 A @tab
7172 Torculus Deminutus @tab
7173 @code{\[ a \pes b \flexa \deminutum g \]}
7174
7175 @item
7176 B @tab
7177 Torculus Initio Debilis @tab
7178 @code{\[ \deminutum a \pes b \flexa g \]}
7179
7180 @item
7181 C @tab
7182 Torculus Auctus Descendens Initio Debilis @tab
7183 @code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}
7184
7185 @item
7186 D @tab
7187 Torculus Deminutus Initio Debilis @tab
7188 @code{\[ \deminutum a \pes b \flexa \deminutum g \]}
7189
7190 @item
7191 E @tab
7192 Porrectus @tab
7193 @code{\[ a \flexa g \pes b \]}
7194
7195 @item
7196 F @tab
7197 Porrectus Auctus Descendens @tab
7198 @code{\[ a \flexa g \pes \auctum \descendens b \]}
7199
7200 @item
7201 G @tab
7202 Porrectus Deminutus @tab
7203 @code{\[ a \flexa g \pes \deminutum b \]}
7204
7205 @item
7206 H @tab
7207 Climacus @tab
7208 @code{\[ \virga b \inclinatum a \inclinatum g \]}
7209
7210 @item
7211 I @tab
7212 Climacus Auctus @tab
7213 @code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}
7214
7215 @item
7216 J @tab
7217 Climacus Deminutus @tab
7218 @code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}
7219
7220 @item
7221 K @tab
7222 Scandicus @tab
7223 @code{\[ g \pes a \virga b \]}
7224
7225 @item
7226 L @tab
7227 Scandicus Auctus Descendens @tab
7228 @code{\[ g \pes a \pes \auctum \descendens b \]}
7229
7230 @item
7231 M @tab
7232 Scandicus Deminutus @tab
7233 @code{\[ g \pes a \pes \deminutum b \]}
7234
7235 @item
7236 N @tab
7237 Salicus @tab
7238 @code{\[ g \oriscus a \pes \virga b \]}
7239
7240 @item
7241 O @tab
7242 Salicus Auctus Descendens @tab
7243 @code{\[ g \oriscus a \pes \auctum \descendens b \]}
7244
7245 @item
7246 P @tab
7247 Trigonus @tab
7248 @code{\[ \stropha b \stropha b \stropha a \]}
7249
7250 @end multitable
7251
7252 @refcommands
7253
7254 The following head prefixes are supported
7255
7256 @cindex @code{\virga}
7257 @code{\virga},
7258 @cindex @code{\stropha}
7259 @code{\stropha},
7260 @cindex @code{\inclinatum}
7261 @code{\inclinatum},
7262 @cindex @code{\auctum}
7263 @code{\auctum},
7264 @cindex @code{\descendens}
7265 @code{\descendens},
7266 @cindex @code{\ascendens}
7267 @code{\ascendens},
7268 @cindex @code{\oriscus}
7269 @code{\oriscus},
7270 @cindex @code{\quilisma}
7271 @code{\quilisma},
7272 @cindex @code{\deminutum}
7273 @code{\deminutum}.
7274
7275 Head prefixes can be accumulated, though restrictions apply.  For
7276 example, either @code{\descendens} or @code{\ascendens} can be applied
7277 to a head, but not both to the same head.
7278
7279 @cindex @code{\pes}
7280 @cindex @code{\flexa}
7281 Two adjacent heads can be tied together with the @code{\pes} and
7282 @code{\flexa} infix commands for a rising and falling line of melody,
7283 respectively.
7284
7285
7286
7287 @node Vaticana style contexts
7288 @subsection Vaticana style contexts
7289
7290 @cindex VaticanaVoiceContext
7291 @cindex VaticanaStaffContext
7292
7293 The predefined @code{VaticanaVoiceContext} and
7294 @code{VaticanaStaffContext} can be used to easily engrave a piece of
7295 Gregorian Chant in the style of the Editio Vaticana.  These contexts
7296 initialize all relevant context properties and grob properties to
7297 proper values.  With these contexts, you can immediately go ahead
7298 entering the chant, as the following short excerpt demonstrates
7299
7300 @lilypond[quote,raggedright,verbatim,noindent]
7301 \include "gregorian-init.ly"
7302 \score {
7303   <<
7304     \context VaticanaVoice = "cantus" {
7305       \override Score.BarNumber #'transparent = ##t
7306       \notes {
7307         \[ c'\melisma c' \flexa a \]
7308         \[ a \flexa \deminutum g\melismaEnd \]
7309         f \divisioMinima
7310         \[ f\melisma \pes a c' c' \pes d'\melismaEnd \]
7311         c' \divisioMinima \break
7312         \[ c'\melisma c' \flexa a \]
7313         \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima
7314       }
7315     }
7316     \lyricsto "cantus" \new Lyrics \lyrics {
7317       San- ctus, San- ctus, San- ctus
7318     }
7319   >>
7320 }
7321 @end lilypond
7322
7323 @node Figured bass
7324 @subsection Figured bass
7325
7326 @cindex Basso continuo
7327
7328 @c TODO: musicological blurb about FB
7329
7330
7331 LilyPond has limited support for figured bass
7332
7333 @lilypond[quote,verbatim,fragment]
7334 <<
7335   \context Voice \notes { \clef bass dis4  c d ais }
7336   \context FiguredBass \figures {
7337     < 6 >4 < 7 >8 < 6+ [_!] >
7338     < 6 >4 <6 5 [3+] >
7339   }
7340 >>
7341 @end lilypond
7342
7343 The support for figured bass consists of two parts: there is an input
7344 mode, introduced by @code{\figures}, where you can enter bass figures
7345 as numbers, and there is a context called @internalsref{FiguredBass} that
7346 takes care of making @internalsref{BassFigure} objects.
7347
7348 In figures input mode, a group of bass figures is delimited by
7349 @code{<} and @code{>}. The duration is entered after the @code{>>}
7350 @example
7351 <4 6>
7352 @end example
7353 @lilypond[quote,fragment]
7354 \context FiguredBass
7355 \figures { <4 6> }
7356 @end lilypond
7357
7358 Accidentals are added when you append @code{-}, @code{!}  and @code{+}
7359 to the numbers
7360
7361 @example
7362 <4- 6+ 7!>
7363 @end example
7364 @lilypond[quote,fragment]
7365 \context FiguredBass
7366 \figures { <4- 6+ 7!> }
7367 @end lilypond
7368
7369 Spaces or dashes may be inserted by using @code{_}. Brackets are
7370 introduced with @code{[} and @code{]}
7371
7372 @example
7373 < [4 6] 8 [_! 12]>
7374 @end example
7375 @lilypond[quote,fragment]
7376 \context FiguredBass
7377 \figures { < [4 6] 8 [_! 12]> }
7378 @end lilypond
7379
7380 Although the support for figured bass may superficially resemble chord
7381 support, it works much simpler.  The @code{\figures} mode simply
7382 stores the numbers , and @internalsref{FiguredBass} context prints
7383 them as entered. There is no conversion to pitches, and no
7384 realizations of the bass are played in the MIDI file.
7385
7386 Internally, the code produces markup texts. You can use any of the
7387 markup text properties to override formatting. For example, the
7388 vertical spacing of the figures may be set with @code{baseline-skip}.
7389
7390 @seealso
7391
7392 Program reference: @internalsref{BassFigureEvent} music, @internalsref{BassFigure} object, 
7393 and @internalsref{FiguredBass} context.
7394
7395 @refbugs
7396
7397 Slash notation for alterations is not supported.
7398
7399 @node Contemporary notation
7400 @section Contemporary notation
7401
7402 In the 20th century, composers have greatly expanded the musical
7403 vocabulary. With this expansion, many innovations in musical notation
7404 have been tried. The book by Stone (1980) gives a comprehensive
7405 overview (see @ref{Literature list}). In general, the use of new,
7406 innovative notation makes a piece harder to understand and perform and
7407 its use should therefore be avoided if possible.  For this reason,
7408 support for contemporary notation in LilyPond is limited.
7409
7410
7411 @menu
7412 * Clusters::                    
7413 * Fermatas::                    
7414 @end menu
7415
7416 @node Clusters
7417 @subsection Clusters
7418
7419 @cindex cluster
7420
7421 A cluster indicates a continuous range of pitches to be played.  They
7422 can be denoted as the envelope of a set of notes.  They are entered by
7423 applying the function @code{notes-to-clusters} to a sequence of
7424 chords, e.g.
7425 @c
7426 @lilypond[quote,relative=2,verbatim]
7427 \applymusic #notes-to-clusters {  <c e > <b f'>  }
7428 @end lilypond
7429
7430 The following example (from
7431 @inputfileref{input/regression,cluster.ly}) shows what the result
7432 looks like
7433
7434 @lilypondfile[quote]{cluster.ly}
7435
7436 Ordinary notes and clusters can be put together in the same staff,
7437 even simultaneously.  In such a case no attempt is made to
7438 automatically avoid collisions between ordinary notes and clusters.
7439
7440 @seealso
7441
7442 Program reference: @internalsref{ClusterSpanner},
7443 @internalsref{ClusterSpannerBeacon},
7444 @internalsref{Cluster_spanner_engraver}, and
7445 @internalsref{ClusterNoteEvent}.
7446
7447 Examples: @inputfileref{input/regression,cluster.ly}.
7448
7449 @refbugs
7450
7451 Music expressions like @code{<< @{ g8 e8 @} a4 >>} are not printed
7452 accurately.  Use @code{<g a>8 <e a>8} instead.
7453
7454
7455
7456 @node Fermatas
7457 @subsection Fermatas
7458
7459 @cindex fermatas
7460
7461
7462
7463 Contemporary music notation frequently uses special fermata symbols to
7464 indicate fermatas of differing lengths.  The following fermatas are
7465 supported
7466
7467 @lilypond[quote,raggedright]
7468 \score {
7469   <<
7470     \addlyrics \notes {
7471       b'
7472       ^\shortfermata
7473       _\shortfermata
7474       r
7475       b'
7476       ^\fermata
7477       _\fermata
7478
7479       r
7480       b'
7481       ^\longfermata
7482       _\longfermata
7483
7484       r
7485       b'
7486       ^\verylongfermata
7487       _\verylongfermata
7488     r
7489     }
7490     \context Lyrics \lyrics {
7491       \override LyricText #'font-family = #'typewriter
7492       "shortfermata" "fermata"  "longfermata" "verylongfermata"
7493     }
7494   >>
7495 }
7496 @end lilypond
7497
7498 See @ref{Articulations} for general instructions how to apply scripts
7499 such as fermatas to a @code{\notes@{@}} block.
7500
7501
7502 @node Special notation
7503 @section Special notation
7504
7505 @menu
7506 * Balloon help::                
7507 * Easy Notation note heads::    
7508 @end menu
7509
7510 @node Balloon help
7511 @subsection Balloon help
7512
7513 Elements of notation can be marked and named with the help of a square
7514 balloon.  The primary purpose of this feature is to explain notation.
7515
7516 The following example demonstrates its use.
7517
7518 @lilypond[quote,verbatim,fragment,raggedright,relative=2]
7519 \context Voice
7520 \applyoutput
7521    #(add-balloon-text 'NoteHead "heads, or tails?"
7522     '(1 . -3))
7523 c8
7524 @end lilypond
7525
7526 @noindent
7527 The function @code{add-balloon-text} takes the name of a grob, the
7528 label to print and where to put the label relative to the object. In
7529 the above example, the text ``heads or tails?'' ends 3 spaces below
7530 the `balloon.' 
7531
7532 @cindex balloon
7533 @cindex notation, explaining
7534
7535 @seealso
7536
7537 Program reference: @internalsref{text-balloon-interface}.
7538
7539 Examples: @inputfileref{input/regression,balloon.ly}.
7540
7541 @node Easy Notation note heads
7542 @subsection Easy Notation note heads
7543
7544 @cindex easy notation
7545 @cindex Hal Leonard
7546
7547 The `easy play' note head includes a  name inside the head.  It is
7548 used in music for beginners
7549
7550 @lilypond[quote,raggedright,verbatim,staffsize=26]
7551 \setEasyHeads
7552 c'2 e'4 f' | g'1
7553 @end lilypond
7554
7555 The command @code{\setEasyHeads} overrides settings for the
7556 @internalsref{NoteHead} object.  To make the letters readable, it has
7557 to be printed in a large font size.  To print with a larger font, see
7558 @ref{Setting global staff size}.
7559
7560 @cindex Xdvi
7561 @cindex ghostscript
7562
7563 If you view the result with Xdvi, staff lines may show through the
7564 letters.  Printing the PostScript file obtained does produce the
7565 correct result.
7566
7567 @refcommands
7568
7569 @cindex \setEasyHeads
7570 @code{\setEasyHeads}
7571
7572 @node Sound
7573 @section Sound
7574 @cindex Sound
7575
7576 Entered music can also be converted to MIDI output.  The performance
7577 is intended for proof-hearing the music for errors.
7578
7579 Ties, dynamics and tempo changes are interpreted.  Dynamic marks,
7580 crescendi and decrescendi translate into MIDI volume levels.  Dynamic
7581 marks translate to a fixed fraction of the available MIDI volume
7582 range, crescendi and decrescendi make the volume vary linearly between
7583 their two extremities.  The fractions can be adjusted by
7584 @code{dynamicAbsoluteVolumeFunction} in @internalsref{Voice} context.
7585 For each type of MIDI instrument, a volume range can be defined.  This
7586 gives a basic equalizer control, which can enhance the quality of
7587 the MIDI output remarkably.  The equalizer can be controlled by
7588 setting @code{instrumentEqualizer}.
7589
7590 @refbugs
7591
7592 Many musically interesting effects, such as swing, articulation,
7593 slurring, etc., are not translated to MIDI.
7594
7595 The MIDI output allocates a channel for each Staff, and one for global
7596 settings.  Hence, the MIDI file should not have more than 15 staves
7597 (or 14 if you do not use drums). Other staves will remain silent.
7598
7599
7600 @menu
7601 * MIDI block::                  
7602 * MIDI instrument names::       
7603 @end menu
7604
7605
7606 @node MIDI block
7607 @subsection MIDI block
7608 @cindex MIDI block
7609
7610
7611 The MIDI block is analogous to the paper block, but it is somewhat
7612 simpler.  The @code{\midi} block can contain
7613 @cindex MIDI block
7614
7615 @itemize @bullet
7616   @item a @code{\tempo} definition, and
7617   @item context definitions.
7618 @end itemize
7619
7620 A number followed by a period is interpreted as a real number, so
7621 for setting the tempo for dotted notes, an extra space should be
7622 inserted, for example
7623
7624 @example
7625   \midi @{ \tempo 4 . = 120 @} 
7626 @end example
7627
7628
7629 @cindex context definition
7630
7631 Context definitions follow precisely the same syntax as within the
7632 \paper block.  Translation modules for sound are called performers.
7633 The contexts for MIDI output are defined in @file{ly/performer-init.ly}.
7634
7635
7636 @node MIDI instrument names
7637 @subsection MIDI instrument names
7638
7639 @cindex instrument names
7640 @cindex @code{Staff.midiInstrument}
7641
7642 The MIDI instrument name is set by the @code{Staff.midiInstrument}
7643 property.  The instrument name should be chosen from the list in
7644 @ref{MIDI instruments}.
7645
7646 @refbugs
7647
7648 If the selected string does not exactly match, the default is used,
7649 which is the Grand Piano.