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