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