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