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