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