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