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