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