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