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