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