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