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