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