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