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