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