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