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