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