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