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