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