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