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