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