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