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