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