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