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