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