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