]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/refman.itely
remove spaces from Index.
[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; in the following example there are two ways of 
407 notating 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} context.  
533 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 which will make long notes tied in the following 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. Argument @var{clefname} 
875 must 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, they 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 Property @code{whichBar} can also be set directly, using @code{\property} 
1087 or @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 merged:
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 an upstem 8th or a 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. Furthermore,
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 once 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, you 
2352 must set properties for the @internalsref{DynamicLineSpanner} object.
2353
2354
2355 @node Repeats
2356 @section Repeats
2357
2358
2359 @cindex repeats
2360 @cindex @code{\repeat}
2361
2362
2363 Repetition is a central concept in music, and multiple notations exist
2364 for repetitions. In LilyPond, most of these notations can be captured
2365 in a uniform syntax. One of the advantages is, all these repetitions
2366 can be rendered in MIDI accurately.
2367
2368 The following types of repetition are supported:
2369
2370 @table @code
2371 @item unfold
2372 Repeated music is fully written (played) out.  Useful for MIDI
2373 output, and entering repetitive music.
2374
2375 @item volta
2376 This is the normal notation: Repeats are not written out, but
2377 alternative endings (voltas) are printed, left to right.
2378
2379 @ignore
2380 @item fold
2381 Alternative endings are written stacked. This has limited use but may be
2382 used to typeset two lines of lyrics in songs with repeats, see
2383 @inputfileref{input,star-spangled-banner.ly}.
2384 @end ignore
2385
2386 @item tremolo
2387 Make tremolo beams.
2388
2389 @item percent
2390 Make beat or measure repeats. These look like percent signs.
2391
2392 @end table  
2393
2394 @menu
2395 * Repeat syntax::               
2396 * Repeats and MIDI::            
2397 * Manual repeat commands::      
2398 * Tremolo repeats::             
2399 * Tremolo subdivisions::        
2400 * Measure repeats::             
2401 @end menu
2402
2403 @node Repeat syntax
2404 @subsection Repeat syntax
2405
2406 @syntax
2407
2408 LilyPond has one syntactic construct for specifying different types of
2409 repeats.  The syntax is
2410
2411 @example
2412   \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2413 @end example
2414
2415 If you have alternative endings, you may add
2416 @cindex @code{\alternative}
2417 @example
2418  \alternative @code{@{} @var{alternative1}
2419             @var{alternative2}
2420             @var{alternative3} @dots{} @code{@}}
2421 @end example
2422 where each @var{alternative} is a music expression.  If you do not
2423 give enough alternatives for all of the repeats, then the first
2424 alternative is assumed to be played more than once.
2425
2426 Normal notation repeats are used like this:
2427 @lilypond[fragment,verbatim]
2428   c'1
2429   \repeat volta 2 { c'4 d' e' f' }
2430   \repeat volta 2 { f' e' d' c' }
2431 @end lilypond
2432
2433 With alternative endings:
2434 @lilypond[fragment,verbatim]
2435   c'1
2436   \repeat volta 2 {c'4 d' e' f'} 
2437   \alternative { {d'2 d'} {f' f} }
2438 @end lilypond
2439
2440
2441 @lilypond[fragment,verbatim]
2442 \context Staff {
2443   \relative c' {
2444     \partial 4
2445     \repeat volta 4 { e | c2 d2 | e2 f2 | }
2446     \alternative { { g4 g g } { a | a a a a | b2. } }
2447   }
2448 }
2449 @end lilypond
2450
2451 @refbugs
2452
2453 If you do a nested repeat like
2454
2455 @example 
2456 \repeat @dots{}
2457 \repeat @dots{}
2458 \alternative 
2459 @end example 
2460
2461 @noindent
2462 then it is ambiguous to which @code{\repeat} the @code{\alternative}
2463 belongs. This ambiguity is resolved by always having the
2464 @code{\alternative} belong to the inner @code{\repeat}.  For clarity,
2465 it is advisable to use braces in such situations.
2466 @cindex ambiguity
2467
2468 @node Repeats and MIDI
2469 @subsection Repeats and MIDI
2470
2471 @cindex expanding repeats
2472
2473 For instructions on how to unfold repeats for MIDI output, see the
2474 example file @inputfileref{input/test,unfold-all-repeats.ly}.
2475
2476
2477 @refbugs
2478
2479 Timing information is not remembered at the start of an alternative,
2480 so after a repeat timing information must be reset by hand, for
2481 example by setting @code{Score.measurePosition} or entering
2482 @code{\partial}.  Similarly, slurs or ties are also not repeated.
2483
2484
2485 @node Manual repeat commands
2486 @subsection Manual repeat commands
2487
2488 @cindex @code{repeatCommands}
2489
2490 The property @code{repeatCommands} can be used to control the layout of
2491 repeats. Its value is a Scheme list of repeat commands, where each repeat
2492 command can be
2493
2494 @table @asis
2495 @item the symbol @code{start-repeat},
2496   which prints a @code{|:} bar line,
2497 @item the symbol @code{end-repeat},
2498   which prints a @code{:|} bar line,
2499 @item the list @code{(volta @var{text})},
2500   which prints a volta bracket saying @var{text}: The text can be specified as
2501 a text string or as a markup text, see @ref{Text markup}. Do not
2502 forget to change the font, as the default number font does not contain
2503 alphabetic characters. Or,
2504 @item the list @code{(volta #f)}, which 
2505   stops a running volta bracket:
2506 @end table
2507
2508 @lilypond[verbatim, fragment]
2509  c''4
2510     \property Score.repeatCommands = #'((volta "93") end-repeat)
2511  c''4 c''4
2512     \property Score.repeatCommands = #'((volta #f))
2513  c''4 c''4
2514 @end lilypond
2515
2516
2517 @seealso
2518
2519 @internalsref{VoltaBracket}, @internalsref{RepeatedMusic},
2520 @internalsref{VoltaRepeatedMusic},
2521 @internalsref{UnfoldedRepeatedMusic},
2522 @internalsref{FoldedRepeatedMusic}.
2523
2524 @node Tremolo repeats
2525 @subsection Tremolo repeats
2526 @cindex tremolo beams
2527
2528 To place tremolo marks between notes, use @code{\repeat} with tremolo
2529 style:
2530 @lilypond[verbatim,center,singleline]
2531 \score { 
2532   \context Voice \notes\relative c' {
2533     \repeat "tremolo" 8 { c16 d16 }
2534     \repeat "tremolo" 4 { c16 d16 }    
2535     \repeat "tremolo" 2 { c16 d16 }
2536     \repeat "tremolo" 4 c16
2537   }
2538 }
2539 @end lilypond
2540
2541 @seealso
2542
2543 Tremolo beams are @internalsref{Beam} objects. Single stem tremolos
2544 are @internalsref{StemTremolo}s.  The music expression is
2545 @internalsref{TremoloEvent}.
2546
2547
2548 @refbugs
2549
2550 The single stem tremolo must be entered without @code{@{} and
2551 @code{@}}.
2552
2553 @node Tremolo subdivisions
2554 @subsection Tremolo subdivisions
2555 @cindex tremolo marks
2556 @cindex @code{tremoloFlags}
2557
2558 Tremolo marks can be printed on a single note by adding
2559 `@code{:}[@var{length}]' after the note.  The length must be at least 8.
2560 A @var{length} value of 8 gives one line across the note stem.  If the
2561 length is omitted, then then the last value (stored in
2562 @code{Voice.tremoloFlags}) is used:
2563
2564 @lilypond[verbatim,fragment,center]
2565   c'2:8 c':32 | c': c': |
2566 @end lilypond
2567
2568 @c [TODO : stok is te kort bij 32en]
2569
2570 @refbugs
2571
2572 Tremolos in this style do not carry over into the MIDI output.
2573
2574
2575 @node Measure repeats
2576 @subsection Measure repeats
2577
2578 @cindex percent repeats
2579 @cindex measure repeats
2580
2581 In the @code{percent} style, a note pattern can be repeated. It is
2582 printed once, and then the pattern is replaced with a special sign.
2583 Patterns of a one and two measures are replaced by percent-like signs,
2584 patterns that divide the measure length are replaced by slashes:
2585
2586 @lilypond[verbatim,singleline]
2587  \context Voice { \repeat  "percent" 4  { c'4 }
2588     \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
2589 }
2590 @end lilypond   
2591
2592 @seealso
2593
2594 @internalsref{RepeatSlash}, @internalsref{PercentRepeat},
2595 @internalsref{PercentRepeatedMusic}, and
2596 @internalsref{DoublePercentRepeat}.
2597
2598
2599
2600 @node Rhythmic music
2601 @section Rhythmic music
2602
2603 Sometimes you might want to show only the rhythm of a melody.  This
2604 can be done with the rhythmic staff. All pitches of notes on such a
2605 staff are squashed, and the staff itself has a single line:
2606
2607 @lilypond[fragment,relative,verbatim]
2608   \context RhythmicStaff {
2609       \time 4/4
2610       c4 e8 f  g2 | r4 g r2 | g1:32 | r1 |
2611   }
2612 @end lilypond
2613
2614 @menu
2615 * Percussion staves::           
2616 * Percussion MIDI output::      
2617 @end menu
2618
2619 @node Percussion staves
2620 @subsection Percussion staves
2621 @cindex percussion
2622 @cindex drums
2623
2624 A percussion part for more than one instrument typically uses a
2625 multiline staff where each position in the staff refers to one piece
2626 of percussion.
2627
2628 @syntax
2629
2630 Percussion staves are typeset with help of a set of Scheme
2631 functions. The system is based on the general MIDI drum-pitches.
2632 Include @file{drumpitch-init.ly} to use drum pitches. This file
2633 defines the pitches from the Scheme variable @code{drum-pitch-names},
2634 the definition of which can be read in @file{scm/drums.scm}.  Each
2635 piece of percussion has a full name and an abbreviated name, and both
2636 the full name or the abbreviation may be used in input files.
2637
2638 to typeset the music on a staff apply the function @code{drums->paper}
2639 to the percussion music. This function takes a list of percussion
2640 instrument names, notehead scripts and staff positions (that is:
2641 pitches relative to the C-clef) and transforms the input
2642 music by moving the pitch, changing the notehead and (optionally)
2643 adding a script:
2644 @c
2645 @lilypond[singleline,verbatim,quote]
2646 \include "drumpitch-init.ly"
2647 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2648 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2649 \score {
2650     \apply #(drums->paper 'drums) \context Staff <
2651         \clef percussion
2652         \context Voice = up { \voiceOne \up }
2653         \context Voice = down { \voiceTwo \down }
2654     >
2655 }
2656
2657 @end lilypond
2658 In the above example the music was transformed using the list @code{'drums}.
2659 Currently the following lists are defined in @file{scm/drums.scm}:
2660 @table @code
2661 @item 'drums
2662 to typeset a typical drum kit on a five-line staff:
2663
2664 @lilypond[noindent]
2665 \include "drumpitch-init.ly"
2666 nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
2667     bd sn ss tomh tommh tomml toml tomfh tomfl }
2668 mus = \notes  { cymc cyms cymr hh hhc hho hhho hhp cb hc
2669     bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
2670 \score {
2671     <
2672         \apply #(drums->paper 'drums) \context Staff <
2673             \clef percussion
2674             \mus
2675         >
2676         \context Lyrics \nam 
2677     >
2678     \paper {
2679         linewidth = 100.0\mm
2680         \translator {
2681             \StaffContext
2682             \remove Bar_engraver
2683             \remove Time_signature_engraver
2684             minimumVerticalExtent = #'(-4.0 . 5.0)
2685         }
2686         \translator {
2687             \VoiceContext
2688             \remove Stem_engraver
2689         }
2690    }   
2691 }
2692 @end lilypond
2693
2694 The drum scheme supports six different toms.  When there fewer toms, simply
2695 select the toms that produce the desired result, i.e. to get toms on
2696 the three middle lines you use @code{tommh}, @code{tomml} and
2697 @code{tomfh}.
2698
2699 Because general MIDI does not contain rimshots the sidestick is used
2700 for this purpose instead.
2701 @item 'timbales
2702 to typeset timbales on a two line staff:
2703
2704 @lilypond[singleline]
2705 \include "drumpitch-init.ly"
2706 nam = \lyrics { timh ssh timl ssl cb }
2707 mus = \notes  { timh ssh timl ssl cb s16 }
2708 \score {
2709     <
2710         \apply #(drums->paper 'timbales) \context Staff <
2711             \clef percussion
2712             \mus
2713         >
2714         \context Lyrics \nam 
2715     >
2716     \paper {
2717         \translator {
2718             \StaffContext
2719             \remove Bar_engraver
2720             \remove Time_signature_engraver
2721             StaffSymbol \override #'line-count = #2
2722             StaffSymbol \override #'staff-space = #2
2723             minimumVerticalExtent = #'(-3.0 . 4.0)
2724         }
2725         \translator {
2726             \VoiceContext
2727             \remove Stem_engraver
2728         }
2729
2730     }   
2731 }
2732 @end lilypond
2733 @item 'congas
2734 to typeset congas on a two line staff:
2735
2736 @lilypond[singleline]
2737 \include "drumpitch-init.ly"
2738 nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
2739 mus = \notes  { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
2740 \score {
2741     <
2742         \apply #(drums->paper 'congas) \context Staff <
2743             \clef percussion
2744             \mus
2745         >
2746         \context Lyrics \nam 
2747     >
2748     \paper {
2749         \translator {
2750             \StaffContext
2751             \remove Bar_engraver
2752             \remove Time_signature_engraver
2753             StaffSymbol \override #'line-count = #2
2754             StaffSymbol \override #'staff-space = #2
2755             minimumVerticalExtent = #'(-3.0 . 4.0)
2756         }
2757         \translator {
2758             \VoiceContext
2759             \remove Stem_engraver
2760         }
2761     }   
2762 }
2763 @end lilypond
2764 @item 'bongos
2765 to typeset bongos on a two line staff:
2766
2767 @lilypond[singleline]
2768 \include "drumpitch-init.ly"
2769 nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
2770 mus = \notes  { boh boho bohm ssh bol bolo bolm ssl s16 }
2771 \score {
2772     <
2773         \apply #(drums->paper 'bongos) \context Staff <
2774             \clef percussion
2775             \mus
2776         >
2777         \context Lyrics \nam 
2778     >
2779     \paper {
2780         \translator {
2781             \StaffContext
2782             \remove Bar_engraver
2783             \remove Time_signature_engraver
2784             StaffSymbol \override #'line-count = #2
2785             StaffSymbol \override #'staff-space = #2
2786             minimumVerticalExtent = #'(-3.0 . 4.0)
2787         }
2788         \translator {
2789             \VoiceContext
2790             \remove Stem_engraver
2791         }
2792     }   
2793 }
2794 @end lilypond
2795 @item 'percussion
2796 to typeset all kinds of simple percussion on one line staves:
2797 @lilypond[singleline]
2798 \include "drumpitch-init.ly"
2799 nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
2800 mus = \notes  { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
2801 \score {
2802     <
2803         \apply #(drums->paper 'percussion) \context Staff <
2804             \clef percussion
2805             \mus
2806         >
2807         \context Lyrics \nam 
2808     >
2809     \paper {
2810         \translator {
2811             \StaffContext
2812             \remove Bar_engraver
2813             \remove Time_signature_engraver
2814             StaffSymbol \override #'line-count = #1
2815             minimumVerticalExtent = #'(-2.0 . 3.0)
2816         }
2817         \translator {
2818             \VoiceContext
2819             \remove Stem_engraver
2820         }
2821     }   
2822 }
2823 @end lilypond
2824 @end table
2825
2826 If you do not like any of the predefined lists you can define your own
2827 list at the top of your file:
2828
2829 @lilypond[singleline, verbatim]
2830 #(set-drum-kit 'mydrums `(
2831         (bassdrum     default   #f        ,(ly:make-pitch -1 2 0))
2832         (snare        default   #f        ,(ly:make-pitch 0 1 0))
2833         (hihat        cross     #f        ,(ly:make-pitch 0 5 0))
2834         (pedalhihat   xcircle   "stopped" ,(ly:make-pitch 0 5 0))
2835         (lowtom       diamond   #f        ,(ly:make-pitch -1 6 0))
2836 ))
2837 \include "drumpitch-init.ly"
2838 up = \notes { hh8 hh hh hh hhp4 hhp }
2839 down = \notes { bd4 sn bd toml8 toml }
2840 \score {    
2841     \apply #(drums->paper 'mydrums) \context Staff <
2842         \clef percussion
2843         \context Voice = up { \voiceOne \up }
2844         \context Voice = down { \voiceTwo \down }
2845     >
2846 }
2847 @end lilypond
2848
2849 To use a modified existing list, one can prepend modifications to the
2850 the existing list:
2851
2852 @example
2853 #(set-drum-kit mydrums (append `(
2854    (bassdrum default #f ,(ly:make-pitch -1 2 0))
2855    (lowtom   diamond #f ,(ly:make-pitch -1 6 0))
2856 ) (get-drum-kit 'drums)))
2857 @end example
2858
2859 The file @file{drumpitch-init.ly} replaces the normal pitch names, so
2860 you have to reinclude @file{nederlands.ly} after the
2861 drum-pattern-definitions to enter normal notes:
2862 @c
2863 @lilypond[singleline,verbatim]
2864 \include "drumpitch-init.ly"
2865 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2866 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2867 \include "nederlands.ly"
2868 bass = \notes \transpose c c,, { a4. e8 r e g e }
2869 \score {
2870     <
2871         \apply #(drums->paper 'drums) \context Staff = drums <
2872             \clef percussion
2873             \context Voice = up { \voiceOne \up }
2874             \context Voice = down { \voiceTwo \down }
2875         >
2876         \context Staff = bass { \clef "F_8" \bass }
2877     >
2878 }
2879 @end lilypond
2880
2881 @node Percussion MIDI output
2882 @subsection Percussion MIDI output
2883
2884 In order to produce correct MIDI output you need to produce two score
2885 blocks---one for the paper and one for the MIDI output.  To use the
2886 percussion channel you set the property @code{instrument} to
2887 @code{'drums}. Because the drum-pitches themselves are similar to the
2888 general MIDI pitches all you have to do is to insert the voices with
2889 none of the scheme functions to get the correct MIDI output:
2890
2891 @example
2892 \score @{    
2893     \apply #(drums->paper 'mydrums) \context Staff <
2894         \clef percussion
2895         @{ \up @}  \\
2896         @{ \down @}
2897     >
2898     \paper@{@}
2899 @}
2900 \score @{    
2901     \context Staff <
2902         \property Staff.instrument = #'drums
2903         \up \down
2904     >
2905     \midi@{@}
2906 @}
2907 @end example
2908
2909 @refbugs
2910
2911 This scheme is a temporary implementation.
2912
2913
2914 @node Piano music
2915 @section Piano music
2916
2917 Piano staves are two normal staves coupled with a brace.  The staves
2918 are largely independent, but sometimes voices can cross between the
2919 two staves.  The same notation is also used for harps and other key
2920 instruments.  The @internalsref{PianoStaff} is especially built to
2921 handle this cross-staffing behavior.  In this section we discuss the
2922 @internalsref{PianoStaff} and some other pianistic peculiarities.
2923
2924
2925 @menu
2926 * Automatic staff changes::     
2927 * Manual staff switches::       
2928 * Pedals::                      
2929 * Arpeggio::                    
2930 * Staff switch lines::          
2931 @end menu 
2932
2933 @refbugs
2934
2935 There is no support for putting chords across staves.  You can get
2936 this result by increasing the length of the stem in the lower stave so
2937 it reaches the stem in the upper stave, or vice versa. An example is
2938 included with the distribution as @inputfileref{input/test,stem-cross-staff.ly}.
2939
2940 Dynamics are not centered, but kludges do exist. See
2941 @inputfileref{input/templates,piano-dynamics.ly}.
2942
2943 @cindex cross staff stem
2944 @cindex stem, cross staff
2945
2946
2947 @c fixme: should have hyperlinks as well.
2948
2949
2950
2951
2952
2953 @node Automatic staff changes
2954 @subsection Automatic staff changes
2955 @cindex Automatic staff changes
2956
2957 Voices can switch automatically between the top and the bottom
2958 staff. The syntax for this is
2959 @example
2960   \autochange Staff \context Voice @{ @dots{}@var{music}@dots{} @}
2961 @end example        
2962 The autochanger switches on basis of pitch (central C is the turning
2963 point), and it looks ahead skipping over rests to switch in
2964 advance. Here is a practical example:
2965         
2966 @lilypond[verbatim,singleline,quote]
2967 \score { \notes \context PianoStaff <
2968   \context Staff = "up" {
2969     \autochange Staff \context Voice = VA < \relative c' {
2970        g4 a  b c d r4 a g } > }
2971   \context Staff = "down" {
2972        \clef bass
2973        s1*2
2974 } > }
2975 @end lilypond
2976
2977 @noindent
2978 In this example, spacer rests are used to prevent the bottom staff from
2979 terminating too soon.
2980
2981
2982 @seealso
2983
2984 @internalsref{AutoChangeMusic}
2985
2986 @refbugs
2987
2988 The staff switches often do not end up in optimal places. For high
2989 quality output staff switches should be specified manually.
2990
2991  
2992
2993 @node Manual staff switches
2994 @subsection Manual staff switches
2995
2996 @cindex manual staff switches
2997 @cindex staff switch, manual
2998
2999 Voices can be switched between staves manually, using the following command:
3000 @example
3001   \translator Staff = @var{staffname} @var{music}
3002 @end example
3003
3004 @noindent
3005 The string @var{staffname} is the name of the staff. It switches the
3006 current voice from its current staff to the Staff called
3007 @var{staffname}. Typically @var{staffname} is @code{"up"} or
3008 @code{"down"}.
3009
3010
3011 @node Pedals
3012 @subsection Pedals
3013 @cindex Pedals
3014
3015 Pianos have pedals that alter the way sound are produced. Generally, a
3016 piano has three pedals, sustain, una corda, and sostenuto.
3017
3018 @syntax
3019
3020 Piano pedal instruction can be expressed by attaching
3021 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
3022 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
3023 note or chord:
3024
3025 @lilypond[fragment,verbatim]
3026   c'4-\sustainDown c'4-\sustainUp
3027 @end lilypond
3028
3029 What is printed can be modified by setting @code{pedal@var{X}Strings},
3030 where @var{X} is one of the pedal types: @code{Sustain},
3031 @code{Sostenuto} or @code{UnaCorda}.  Refer to the generated
3032 documentation of @internalsref{SustainPedal} for more information.
3033
3034 Pedals can also be indicated by a sequence of brackets, by setting the 
3035 @code{pedalSustainStyle} property to @code{bracket} objects: 
3036
3037 @lilypond[fragment,verbatim]
3038  \property Staff.pedalSustainStyle = #'bracket
3039  c''4-\sustainDown d''4 e''4
3040  a'4-\sustainUp-\sustainDown
3041  f'4 g'4 a'4-\sustainUp
3042 @end lilypond
3043
3044 A third style of pedal notation is a mixture of text and brackets,
3045 obtained by setting @code{pedal-type} to @code{mixed}:
3046
3047 @lilypond[fragment,verbatim]
3048  \property Staff.pedalSustainStyle = #'mixed
3049 c''4-\sustainDown d''4 e''4
3050 c'4-\sustainUp-\sustainDown
3051  f'4 g'4 a'4-\sustainUp
3052 @end lilypond
3053
3054 The default `*Ped' style for sustain and damper pedals corresponds to
3055 @code{\pedal-type = #'text}. However, @code{mixed} is the default style
3056 for a sostenuto pedal:
3057
3058 @lilypond[fragment,verbatim]
3059 c''4-\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4-\sostenutoUp
3060 @end lilypond
3061
3062 For fine-tuning of the appearance of a pedal bracket, the properties
3063 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
3064 @code{PianoPedalBracket} objects (, see the detailed documentation of
3065 @internalsref{PianoPedalBracket},) can be modified.  For example, the bracket
3066 may be extended to the end of the note head:
3067
3068 @lilypond[fragment,verbatim]
3069 \property Staff.PianoPedalBracket \override
3070    #'shorten-pair = #'(0 . -1.0)
3071 c''4-\sostenutoDown d''4 e''4 c'4
3072 f'4 g'4 a'4-\sostenutoUp
3073 @end lilypond
3074
3075 @node Arpeggio
3076 @subsection Arpeggio
3077 @cindex Arpeggio
3078
3079 @cindex broken arpeggio
3080 @cindex @code{\arpeggio}
3081
3082 You can specify an arpeggio sign on a chord by attaching an
3083 @code{\arpeggio} to a chord:
3084
3085
3086 @lilypond[fragment,relative,verbatim]
3087   <<c e g c>>-\arpeggio
3088 @end lilypond
3089
3090 When an arpeggio crosses staves, you attach an arpeggio to the chords
3091 in both staves, and set
3092 @internalsref{PianoStaff}.@code{connectArpeggios}:
3093
3094 @lilypond[fragment,relative,verbatim]
3095   \context PianoStaff <
3096     \property PianoStaff.connectArpeggios = ##t
3097     \context Voice = one  { <<c' e g c>>-\arpeggio }
3098     \context Voice = other { \clef bass  <<c,, e g>>-\arpeggio }
3099   >
3100 @end lilypond
3101
3102 The direction of the arpeggio is sometimes denoted by adding an
3103 arrowhead to the wiggly line.  This can be typeset by setting
3104 @code{arpeggio-direction}:
3105
3106 @lilypond[fragment,relative,verbatim]
3107   \context Voice {
3108      \property Voice.Arpeggio \set #'arpeggio-direction = #1
3109      <<c e g c>>-\arpeggio
3110      \property Voice.Arpeggio \set #'arpeggio-direction = #-1
3111      <<c e g c>>-\arpeggio
3112   }
3113 @end lilypond
3114
3115 A square bracket on the left indicates that the player should not
3116 arpeggiate the chord. To draw these brackets, set the
3117 @code{molecule-callback} property of @code{Arpeggio} or
3118 @code{PianoStaff.Arpeggio} objects to @code{\arpeggioBracket}, and use
3119 @code{\arpeggio} statements within the chords as before:
3120
3121 @lilypond[fragment,relative,verbatim]
3122     \property PianoStaff.Arpeggio \override
3123         #'molecule-callback = \arpeggioBracket
3124        <<c' e g c>>-\arpeggio
3125 @end lilypond
3126
3127 @refcommands
3128
3129 @cindex @code{\arpeggioBracket}
3130 @code{\arpeggioBracket}, 
3131 @cindex @code{\arpeggio}
3132 @code{\arpeggio}.
3133
3134 @seealso
3135
3136 @internalsref{ArpeggioEvent} expression lead to
3137 @internalsref{Arpeggio} objects.  Cross staff arpeggios are
3138 @internalsref{PianoStaff}.@internalsref{Arpeggio}.
3139
3140 @refbugs
3141
3142 It is not possible to mix connected arpeggios and unconnected
3143 arpeggios in one @internalsref{PianoStaff} at the same time.
3144
3145 @node  Staff switch lines
3146 @subsection Staff switch lines
3147
3148
3149 @cindex follow voice
3150 @cindex staff switching
3151 @cindex cross staff
3152
3153 @cindex @code{followVoice}
3154
3155 Whenever a voice switches to another staff a line connecting the notes
3156 can be printed automatically. This is enabled if the property
3157 @code{PianoStaff.followVoice} is set to true:
3158
3159 @lilypond[fragment,relative,verbatim]
3160   \context PianoStaff <
3161     \property PianoStaff.followVoice = ##t
3162     \context Staff \context Voice {
3163       c1
3164       \translator Staff=two
3165       b2 a
3166     }
3167     \context Staff=two { \clef bass \skip 1*2 }
3168   >  
3169 @end lilypond
3170
3171 The associated object is @internalsref{VoiceFollower}.
3172
3173 @refcommands
3174
3175 @cindex @code{\showStaffSwitch}
3176 @code{\showStaffSwitch}, 
3177 @cindex @code{\hideStaffSwitch}
3178 @code{\hideStaffSwitch}.
3179
3180
3181 @node Vocal music
3182 @section Vocal music
3183
3184 This section discusses how to enter and print lyrics.
3185
3186 @menu
3187 * Entering lyrics::             
3188 * The Lyrics context::          
3189 * More stanzas::                
3190 * Ambitus::                     
3191 @end menu
3192
3193 @node Entering lyrics
3194 @subsection Entering lyrics
3195
3196
3197 @cindex lyrics
3198 @cindex @code{\lyrics}
3199 @cindex punctuation
3200
3201 Lyrics are entered in a special input mode. This mode is is introduced
3202 by the keyword @code{\lyrics}.  In this mode you can enter lyrics, with
3203 punctuation and accents without any hassle.  Syllables are entered like
3204 notes, but with pitches replaced by text.  For example,
3205 @example
3206   \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
3207 @end example
3208
3209 A word in Lyrics mode begins with: an alphabetic character, @code{_},
3210 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
3211 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
3212 any 8-bit character with ASCII code over 127, or a two-character
3213 combination of a backslash followed by one of @code{`}, @code{'},
3214 @code{"}, or @code{^}.
3215
3216 Subsequent characters of a word can be any character that is not a digit
3217 and not white space.  One important consequence of this is that a word
3218 can end with @code{@}}. The following example is usually a bug. The
3219 syllable includes a @code{@}}, and hence the opening brace is not balanced:
3220 @example
3221   \lyrics @{ twinkle@}
3222 @end example
3223
3224 @cindex @code{\property}, in @code{\lyrics}
3225 Similarly, a  period following a alphabetic sequence, is included in the
3226 resulting string. As a consequence, spaces must be inserted around
3227 @code{\property} commands:
3228 @example
3229   \property Lyrics . LyricText \set #'font-shape = #'italic
3230 @end example
3231
3232 @cindex @code{_}
3233 @cindex spaces, in lyrics
3234 @cindex quotes, in lyrics
3235
3236 Any @code{_} character which appears in an unquoted word is converted
3237 to a space.  This provides a mechanism for introducing spaces into words
3238 without using quotes.  Quoted words can also be used in Lyrics mode to
3239 specify words that cannot be written with the above rules:
3240
3241 @example
3242   \lyrics @{ He said: "\"Let" my peo ple "go\"" @}
3243 @end example
3244
3245 @cindex hyphens
3246 Hyphens can be entered as ordinary hyphens at the end of a syllable, i.e.
3247 @example
3248         soft- ware
3249 @end example
3250
3251 These will be attached to the end of the first syllable.
3252
3253 Centered hyphens are entered using the special `@code{-}@code{-}' lyric
3254 as a separate word between syllables.  The hyphen will have variable
3255 length depending on the space between the syllables and it will be
3256 centered between the syllables.
3257
3258 @cindex melisma
3259 @cindex extender
3260
3261 When a lyric is sung over many notes (this is called a melisma), this is
3262 indicated with a horizontal line centered between a syllable and the
3263 next one. Such a line is called an extender line, and it is entered as
3264 @code{__}.
3265
3266 @seealso
3267
3268 @internalsref{LyricEvent}, @internalsref{HyphenEvent},
3269 @internalsref{ExtenderEvent}.
3270
3271 @refbugs
3272
3273 The definition of lyrics mode is too complex. 
3274
3275 @node The Lyrics context
3276 @subsection  The Lyrics context
3277
3278 Lyrics are printed by interpreting them in @internalsref{Lyrics} context:
3279 @example
3280  \context Lyrics \lyrics @dots{}
3281 @end example
3282
3283 @cindex automatic syllable durations
3284 @cindex @code{\addlyrics}
3285 @cindex lyrics and melodies
3286
3287 This will place the lyrics according to the durations that were
3288 entered. The lyrics can also be aligned under a given melody
3289 automatically.  In this case, it is no longer necessary to enter the
3290 correct duration for each syllable.  This is achieved by combining the
3291 melody and the lyrics with the @code{\addlyrics} expression:
3292 @example
3293 \addlyrics
3294   \notes @dots{}
3295   \context Lyrics @dots{} 
3296 @end example
3297
3298 @cindex staff order, with @code{\addlyrics}
3299
3300 Normally, this will put the lyrics below the staff. For different or
3301 more complex orderings, the best way is to setup the hierarchy of
3302 staffs and lyrics first, e.g.
3303 @example
3304 \context ChoirStaff \notes <
3305   \context Lyrics = LA @{ s1 @}
3306   \context Staff = SA @{ s1 @}
3307   \context Lyrics = LB @{ s1 @}
3308   \context Staff = SB @{ s1 @}
3309 >
3310 @end example
3311 and then combine the appropriate melodies and lyric lines:
3312 @example
3313   \addlyrics
3314     \context Staff = SA @emph{the music}
3315     \context Lyrics = LA @emph{the lyrics}
3316 @end example
3317
3318 putting both together, you would get
3319 @example
3320 \context ChoirStaff \notes <
3321   \context Lyrics = LA @dots{}
3322   \context Staff = SB @dots{}
3323   \addlyrics @dots{}
3324 >
3325 @end example
3326
3327 @cindex SATB
3328 @cindex choral score
3329
3330 A complete example of a SATB score setup is in the file
3331 @inputfileref{input/template,satb}.
3332
3333 @seealso
3334
3335 @internalsref{LyricCombineMusic}, @internalsref{Lyrics},
3336 @inputfileref{input/template,satb}.
3337
3338 @refbugs
3339
3340 @code{\addlyrics} is not automatic enough: melismata are not detected
3341 automatically, and melismata are not stopped when they hit a rest.  A
3342 melisma on the last note in a melody is not printed.
3343
3344
3345 @node More stanzas
3346 @subsection More stanzas
3347
3348
3349 @cindex phrasing, in lyrics
3350
3351 When multiple stanzas are printed underneath each other, the vertical
3352 groups of syllables should be aligned around punctuation.  This can be
3353 done automatically when corresponding lyric lines and melodies are
3354 marked.
3355
3356 To this end, give the @internalsref{Voice} context an identity:
3357 @example
3358 \context Voice = duet @{
3359      \time 3/4
3360      g2 e4 a2 f4 g2.  @}
3361 @end example
3362
3363 Then set the @internalsref{LyricsVoice} contexts to names starting with
3364 that identity followed by a dash.  In the preceding example, the
3365 @internalsref{Voice} identity is @code{duet}, so the identities of the
3366 @internalsref{LyricsVoices} are marked @code{duet-1} and @code{duet-2}:
3367 @example
3368   \context LyricsVoice = "duet-1" @{
3369     Hi, my name is bert. @}
3370   \context LyricsVoice = "duet-2" @{
3371     Ooooo, ch\'e -- ri, je t'aime. @}
3372 @end example
3373 The convention for naming @internalsref{LyricsVoice} and
3374 @internalsref{Voice} must also be used to get melismata correct in
3375 conjunction with rests.
3376
3377 The complete example is shown here:
3378 @lilypond[singleline,verbatim]
3379 \score {
3380 \addlyrics
3381   \notes \relative c'' \context Voice = duet { \time 3/4
3382      g2 e4 a2 f4 g2.  }
3383   \lyrics \context Lyrics <
3384   \context LyricsVoice = "duet-1" {
3385     \property LyricsVoice . stanza = "Bert"
3386     Hi, my name is bert.    }
3387   \context LyricsVoice = "duet-2" {
3388     \property LyricsVoice . stanza = "Ernie" 
3389     Ooooo, ch\'e -- ri, je t'aime. }
3390   >
3391 }
3392 @end lilypond
3393
3394 Stanza numbers, or the names of the singers can be added by setting
3395 @code{LyricsVoice.Stanza} (for the first system) and
3396 @code{LyricsVoice.stz} for the following systems.  Notice how dots are
3397 surrounded with spaces in @code{\lyrics} mode:
3398
3399 @example
3400     \property LyricsVoice . stanza = "Bert"
3401     @dots{}
3402     \property LyricsVoice . stanza = "Ernie" 
3403 @end example
3404
3405 To make empty spaces in lyrics, use @code{\skip}.
3406
3407
3408
3409 @refbugs
3410
3411 @cindex ambiguity
3412
3413 Input for lyrics introduces a syntactical ambiguity:
3414  
3415 @example 
3416 foo = bar 
3417 @end example 
3418
3419 @noindent
3420 is interpreted as assigning a string identifier @code{\foo} such that
3421 it contains @code{"bar"}.  However, it could also be interpreted as
3422 making or a music identifier @code{\foo} containing the syllable
3423 `bar'.  The force the latter interpretation, use
3424 @example
3425   foo = \lyrics bar4
3426 @end example
3427
3428
3429 @node Ambitus
3430 @subsection Ambitus
3431 @cindex ambitus
3432
3433 The term @emph{ambitus} denotes a range of pitches for a given voice in
3434 a part of music.  It also may denote the pitch range that a musical
3435 instrument is capable of playing.  Most musical instruments have their
3436 ambitus standardized (or at least there is agreement upon the minimal
3437 ambitus of a particular type of instrument), such that a composer or
3438 arranger of a piece of music can easily meet the ambitus constraints of
3439 the targeted instrument.  However, the ambitus of the human voice
3440 depends on individual physiological state, including education and
3441 training of the voice.  Therefore, a singer potentially has to check for
3442 each piece of music if the ambitus of that piece meets his individual
3443 capabilities.  This is why the ambitus of a piece may be of particular
3444 value to vocal performers.
3445
3446 The ambitus is typically notated on a per-voice basis at the very
3447 beginning of a piece, e.g. nearby the initial clef or time signature of
3448 each staff.  The range is graphically specified by two noteheads, that
3449 represent the minimum and maximum pitch.  Some publishers use a textual
3450 notation: they put the range in words in front of the corresponding
3451 staff.  Lilypond currently only supports the graphical ambitus notation.
3452
3453 To apply, add the @internalsref{Ambitus_engraver} to the
3454 @internalsref{Voice} context, i.e.
3455
3456 @example
3457   \paper @{ \translator @{
3458       \VoiceContext
3459       \consists Ambitus_engraver
3460     @} @}
3461 @end example
3462
3463 For example,
3464
3465 @lilypond[singleline]
3466 upper = \notes \relative c {
3467   \clef "treble"
3468   \key c \minor
3469   as'' c e2 bes f cis d4 e f2 g
3470 }
3471 lower = \notes \relative c {
3472   \clef "treble"
3473   \key e \major
3474   e'4 b g a c es fis a cis b a g f e d2
3475 }
3476 \score {
3477   \context ChoirStaff {
3478     <
3479       \context Staff = one { \upper }
3480       \context Staff = three { \lower }
3481     >
3482   }
3483   \paper {
3484     \translator {
3485       \VoiceContext
3486       \consists Ambitus_engraver
3487     }
3488   }
3489 }
3490 @end lilypond
3491
3492
3493 @seealso
3494
3495 @internalsref{Ambitus}, @inputfileref{input/regression,ambitus.ly}.
3496
3497 @node Tablatures
3498 @section Tablatures
3499
3500 Tablature notation is used for notating music for plucked string
3501 instruments.  It notates pitches not by using note heads, but by
3502 indicating on which string and fret a note must be played.  LilyPond
3503 offers limited support for tablature.
3504
3505 @menu
3506 * Tablatures basic::            
3507 * Non-guitar tablatures::       
3508 @end menu
3509
3510 @node Tablatures basic
3511 @subsection Tablatures basic
3512 @cindex Tablatures basic
3513
3514 The string number associated to a note is given as a backslash
3515 followed by a number, e.g. @code{c4\3} for a C quarter on the third
3516 string. By default, string 1 is the highest one, and the tuning
3517 defaults to the standard guitar tuning (with 6 strings).  The notes
3518 are printed as tablature, by using @internalsref{TabStaff} and
3519 @internalsref{TabVoice} contexts:
3520
3521 @lilypond[fragment,verbatim]
3522 \notes \context TabStaff  {
3523  a,4\5 c'\2 a\3 e'\1
3524  e\4 c'\2 a\3 e'\1
3525 }
3526 @end lilypond
3527
3528 When no string is specified, the first string that does not give a
3529 fret number less than @code{minimumFret} is selected. The default
3530 value for @code{minimumFret} is 0:
3531
3532
3533 @example
3534 e8 fis gis a b cis' dis' e'
3535 \property TabStaff.minimumFret = #8
3536 e8 fis gis a b cis' dis' e'
3537 @end example
3538 @lilypond[noindent]
3539 frag = \notes {
3540     \key e \major
3541     e8 fis gis a b cis' dis' e'
3542     \property TabStaff.minimumFret = #8
3543     e8 fis gis a b cis' dis' e'
3544 }
3545 \score {
3546   \context StaffGroup <
3547     \context Staff { \clef "G_8" \frag }
3548     \context TabStaff { \frag }
3549   >
3550 }
3551 @end lilypond
3552
3553 @seealso
3554
3555 @internalsref{TabStaff}, @internalsref{TabVoice}, and
3556 @internalsref{StringNumberEvent}.
3557
3558 @refbugs
3559
3560 Chords are not handled in a special way, and hence the automatic
3561 string selector may easily select the same string to two notes in a
3562 chord.
3563
3564
3565 @node Non-guitar tablatures
3566 @subsection Non-guitar tablatures
3567 @cindex Non-guitar tablatures
3568
3569 You can change the number of strings, by setting the number of lines
3570 in the @internalsref{TabStaff} (the @code{line-count} property of
3571 @internalsref{TabStaff} can only be changed using
3572 @code{\outputproperty}, for more information, see @ref{Tuning
3573 objects}).
3574
3575 You can change the tuning of the strings. A string tuning is given as
3576 a Scheme list with one integer number for each string, the number
3577 being the pitch (measured in semitones relative to central C) of an
3578 open string.  The numbers specified for @code{stringTuning} are the
3579 numbers of semitones to subtract or add, starting the specified pitch
3580 by default middle C, in string order. Thus, the notes are e, a, d, and
3581 g:
3582
3583 @lilypond[fragment,verbatim]
3584   \context TabStaff <
3585
3586     \outputproperty #(make-type-checker 'staff-symbol-interface)
3587                     #'line-count = #4
3588     \property TabStaff.stringTunings =  #'(-5 -10 -15 -20)
3589     
3590     \notes {
3591       a,4 c' a e' e c' a e'
3592     }
3593   > 
3594 @end lilypond
3595
3596 It is possible to change the Scheme function to format the tablature
3597 note text. The default is @code{fret-number-tablature-format}, which
3598 uses the fret number. For instruments that do not use this notation,
3599 you can create a special tablature formatting function. This function
3600 takes three argument: string number, string tuning and note pitch.
3601
3602 @refbugs
3603
3604 Most of the guitar special effects such as bend have not been
3605 implemented yet.
3606
3607
3608
3609 @node Chord names
3610 @section Chord names
3611 @cindex Chords
3612
3613 LilyPond has support for both printing chord names.  Chords may be
3614 entered in musical chord notation, i.e. @code{<< .. >>}, but they can
3615 also be entered by name. Internally, the chords are represented as a
3616 set of pitches, so they can be transposed:
3617
3618
3619 @lilypond[verbatim,singleline]
3620 twoWays = \notes \transpose c c' {
3621   \chords {
3622     c1 f:sus4 bes/f
3623   }
3624   <<c e g>>
3625   <<f bes c'>>
3626   <<f bes d'>>
3627   }
3628
3629 \score {
3630    < \context ChordNames \twoWays
3631      \context Voice \twoWays > }
3632 @end lilypond
3633
3634 This example also shows that the chord printing routines do not try to
3635 be intelligent. The last chord (@code{f bes d}) is not interpreted as
3636 an inversion.
3637
3638
3639 @menu
3640 * Chords mode::                 
3641 * Printing chord names::        
3642 @end menu
3643
3644
3645 @node Chords mode
3646 @subsection Chords mode
3647 @cindex Chords mode
3648
3649 Chord mode is a mode where you can input sets of pitches using common
3650 names.  It is introduced by the keyword @code{\chords}.
3651 In chords mode,  a  chord is entered by the root, which is entered
3652 like a common pitch:
3653 @lilypond[fragment,verbatim,quote, relative=1]
3654 \chords { es4.  d8 c2 }
3655 @end lilypond
3656 @cindex chord entry
3657 @cindex chord mode
3658
3659 Other chords may be entered by suffixing a colon, and introducing a
3660 modifier, and optionally, a number:
3661 @c
3662 @lilypond[fragment,verbatim,quote]
3663 \chords { e1:m e1:7 e1:m7  }
3664 @end lilypond
3665 The first number following the root is taken to be the `type' of the
3666 chord, thirds are added to the root until it reaches the specified
3667 number:
3668 @lilypond[fragment,verbatim]
3669  \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
3670 @end lilypond
3671
3672 @cindex root of chord
3673 @cindex additions, in chords
3674 @cindex removals, in  chords
3675
3676 More complex chords may also be constructed  adding separate steps
3677 to a chord. Additions are added after the  number following
3678 the colon, and are separated by dots:
3679 @c
3680 @lilypond[verbatim,fragment,quote]
3681   \chords { c:5.6 c:3.7.8 c:3.6.13 }
3682 @end lilypond
3683 Chord steps can be  altered by suffixing a @code{-} or @code{+} sign
3684 to the number:
3685 @lilypond[verbatim,fragment,quote]
3686   \chords { c:7+ c:5+.3-  c:3-.5-.7- }
3687 @end lilypond
3688 Removals are specified similarly, and are introduced by a caret.  They
3689 must come after the additions:
3690 @lilypond[verbatim,fragment]
3691   \chords { c^3 c:7^5 c:9^3.5 }
3692 @end lilypond
3693
3694 Modifiers can be used to change pitches. The following modifiers are
3695 supported:
3696 @table @code
3697 @item m
3698   is the minor chord. This modifier lowers the 3rd and (if present) the 7th step.
3699 @item dim
3700   is the   diminished chord. This modifier lowers the 3rd, 5th and (if present)
3701   the 7th step.
3702 @item aug
3703   is the augmented chord. This modifier raises the 5th step.
3704 @item maj
3705   is the major 7th chord. This modifier raises the 7th step if present.  
3706 @item sus
3707   is the suspended 4th or 2nd. This modifier removes the 3rd
3708 step. Append either @code{2} or @code{4} to add the 2nd or 4th step to
3709 the chord.
3710 @end table
3711 Modifiers can be mixed with additions:
3712 @lilypond[verbatim,fragment]
3713   \chords { c:sus4 c:7sus4 c:dim7 c:m6 } 
3714 @end lilypond
3715
3716 @cindex modifiers, in chords. 
3717 @cindex @code{aug}
3718 @cindex @code{dim}
3719 @cindex @code{maj}
3720 @cindex @code{sus}
3721 @cindex @code{m}
3722
3723 Since an unaltered 11 does not sound good when combined with an
3724 unaltered 13, the 11 is removed in this case (, unless it is added
3725 explicitly):
3726 @lilypond[fragment,verbatim]
3727   \chords { c:13 c:13.11 c:m13 }
3728 @end lilypond 
3729
3730 @cindex @code{/}
3731
3732 An inversion (putting one pitch of the chord on the bottom), as well
3733 as bass notes, can be specified by appending
3734 @code{/}@var{pitch} to the chord:
3735 @lilypond[fragment,verbatim,center]
3736    \chords { c1 c/g c/f }
3737 @end lilypond 
3738 @cindex @code{/+}
3739
3740 A bass note can be added instead of transposed out of the chord,
3741 by using  @code{/+}@var{pitch}.
3742
3743 @lilypond[fragment,verbatim,center]
3744    \chords { c1 c/+g c/+f }
3745 @end lilypond 
3746
3747 Chords is a mode similar to @code{\lyrics}, @code{\notes} etc.  Most
3748 of the commands continue to work, for example, @code{r} and
3749 @code{\skip} can be used to insert rests and spaces, and
3750 @code{\property} may be used to change various settings.
3751
3752
3753
3754 @refbugs
3755
3756 Each step can only be present in a chord once.  The following
3757 simply produces the augmented chord, since @code{5+} is interpreted
3758 last:
3759 @cindex clusters
3760 @lilypond[verbatim,fragment]
3761   \chords { c:5.5-.5+ }
3762 @end lilypond
3763
3764
3765 @node Printing chord names
3766 @subsection Printing chord names
3767
3768 @cindex printing chord names
3769 @cindex chord names
3770 @cindex chords
3771
3772 For displaying printed chord names, use the @internalsref{ChordNames} context.
3773 The chords may be entered either using the notation
3774 described above, or directly using @code{<<} and @code{>>}:
3775
3776 @lilypond[verbatim,singleline]
3777 scheme = \notes {
3778   \chords {a1 b c} <<d' f' a'>>  <<e' g' b'>>
3779 }
3780 \score {
3781   \notes<
3782     \context ChordNames \scheme
3783     \context Staff \scheme
3784   >
3785 }
3786 @end lilypond
3787
3788 You can make the chord changes stand out by setting
3789 @internalsref{ChordNames}.@code{chordChanges} to true.  This will only
3790 display chord names when there is a change in the chords scheme and at
3791 the start of a new line:
3792
3793 @lilypond[verbatim, linewidth=9cm]
3794 scheme = \chords {
3795   c1:m c:m \break c:m c:m d
3796 }
3797 \score {
3798   \notes <
3799     \context ChordNames {
3800         \property ChordNames.chordChanges = ##t
3801         \scheme }
3802     \context Staff \transpose c c' \scheme
3803   >
3804 }
3805 @end lilypond
3806
3807 The default chord name layout is a system for Jazz music, proposed by
3808 Klaus Ignatzek (see @ref{Literature}).  It can be tuned through the
3809 following properties:
3810
3811 @table @code
3812 @cindex chordNameExceptions
3813 @item chordNameExceptions
3814 This is a list that contains the chords that have special formatting.
3815 For an example, see
3816 @inputfileref{input/regression,chord-name-exceptions.ly}.
3817 @cindex exceptions, chord names.
3818
3819
3820 @cindex majorSevenSymbol
3821 @item majorSevenSymbol
3822 This property contains the markup object used for the 7th step, when
3823 it is major. Predefined options are @code{whiteTriangleMarkup} and
3824 @code{blackTriangleMarkup}.  See
3825 @inputfileref{input/regression,chord-name-major7.ly} for an example.
3826
3827 @cindex chordNameSeparator
3828 @item chordNameSeparator
3829 Different parts of a chord name are normally separated by a
3830 slash. By setting @code{chordNameSeparator}, you can specify other
3831 separators, e.g.
3832 @lilypond[fragment,verbatim]
3833 \context ChordNames \chords {
3834       c:7sus4
3835       \property ChordNames.chordNameSeparator
3836         = \markup { \typewriter "|" }
3837       c:7sus4 }
3838 @end lilypond
3839
3840 @cindex chordRootNamer
3841 @item chordRootNamer
3842 The root of a chord is usually printed as a letter with an optional
3843 alteration. The transformation from pitch to letter is done by this
3844 function.  Special note names (for example, the German ``H'' for a
3845 B-chord) can be produced by storing a new function in this property.
3846
3847 @cindex chordNoteNamer
3848 @item chordNoteNamer
3849 The default is to print single pitch, e.g. the bass note, using the
3850 @code{chordRootNamer}.  The @code{chordNoteNamer} property can be set
3851 to a specialized function to change this behavior.  For example, the
3852 base can be printed in lower case.
3853
3854 @end table
3855
3856
3857 There are also two other chord name schemes implemented: an alternate
3858 Jazz chord notation, and a systematic scheme called Banter chords. The
3859 alternate jazz notation is also shown on the chart in @ref{Chord name
3860 chart}.  Turning on these styles is described in the input file
3861 @inputfileref{input/test/,chord-names-jazz.ly}.
3862
3863 @cindex Banter
3864 @cindex jazz chords
3865 @cindex chords, jazz  
3866
3867
3868 @refcommands
3869
3870 @cindex @code{\germanChords}
3871 @code{\germanChords}, 
3872 @cindex @code{\semiGermanChords}
3873 @code{\semiGermanChords}.
3874
3875
3876
3877
3878 @seealso
3879
3880 @inputfileref{input/regression,chord-name-major7.ly},
3881 @inputfileref{input/regression,chord-name-exceptions.ly},
3882 @inputfileref{input/test,chord-names-jazz.ly},
3883 @inputfileref{input/test,chord-names-german.ly},
3884 @file{scm/chords-ignatzek.scm}, @file{scm/chord-entry.scm}
3885
3886
3887 @refbugs
3888
3889 Chord names are determined solely from the list of pitches. Chord
3890 inversions are not identified, and neither are added bass notes. This
3891 may result in strange chord names when chords are entered with the
3892 @code{<< .. >>} syntax.
3893
3894
3895
3896
3897 @node Orchestral music
3898 @section Orchestral music
3899
3900 @cindex  Writing parts
3901
3902 Orchestral music involves some special notation, both in the full
3903 score and the individual parts. This section explains how to tackle
3904 some common problems in orchestral music.
3905
3906
3907
3908 @menu
3909 * Multiple staff contexts::     
3910 * Rehearsal marks::             
3911 * Bar numbers::                 
3912 * Instrument names::            
3913 * Transpose::                   
3914 * Multi measure rests::         
3915 * Automatic part combining::    
3916 * Frenched scores::             
3917 * Sound output for transposing instruments::  
3918 @end menu
3919
3920 @node Multiple staff contexts
3921 @subsection Multiple staff contexts
3922
3923 Polyphonic scores consist of many staffs. These staffs can be
3924 constructed in three different ways:
3925 @itemize @bullet
3926 @item The group is started with a brace at the left. This is done with the
3927 @internalsref{GrandStaff} context.
3928 @item The group is started with a bracket. This is done with the
3929 @internalsref{StaffGroup} context
3930 @item The group is  started with a vertical line. This is the default
3931 for the score.
3932 @end itemize
3933
3934 @cindex Staff, multiple
3935 @cindex bracket, vertical
3936 @cindex brace, vertical
3937 @cindex grand staff
3938 @cindex staff group
3939
3940
3941
3942
3943 @node Rehearsal marks
3944 @subsection Rehearsal marks
3945 @cindex Rehearsal marks
3946 @cindex mark
3947 @cindex @code{\mark}
3948
3949 To print a  rehearsal mark, use the @code{\mark} command. 
3950 @lilypond[fragment,verbatim]
3951 \relative c'' {
3952   c1 \mark "A"
3953   c1 \mark "B"
3954   c1 \mark "12"
3955   c1 \mark "13"
3956   c1
3957 }
3958 @end lilypond
3959
3960 The mark is incremented automatically if you use @code{\mark
3961 \default}. The value to use is stored in the property
3962 @code{rehearsalMark} is used and automatically incremented.
3963
3964 The @code{\mark} command can also be used to put signs like coda,
3965 segno and fermatas on a barline. Use @code{\markup} to
3966 to access the appropriate symbol.
3967
3968 @lilypond[fragment,verbatim,relative=1]
3969   c1 \mark \markup { \musicglyph #"scripts-ufermata" }
3970   c1
3971 @end lilypond
3972
3973 In this case, during line breaks,
3974 marks must also be printed at the end of the line, and not at the
3975 beginning. Use the following to force that behavior
3976 @example
3977 \property Score.RehearsalMark \override
3978   #'break-visibility = #begin-of-line-invisible
3979 @end example
3980
3981 See @inputfileref{input/test,boxed-molecule.ly}.  for putting boxes
3982 around the marks.
3983
3984 @cindex fermatas
3985 @cindex coda
3986 @cindex segno
3987 @cindex barlines, putting symbols on 
3988
3989 @seealso
3990
3991 @internalsref{MarkEvent}, @internalsref{RehearsalMark}, 
3992 @inputfileref{input/test,boxed-molecule.ly}.
3993
3994
3995 @node Bar numbers
3996 @subsection Bar numbers
3997
3998
3999 @cindex bar numbers
4000 @cindex measure numbers
4001 @cindex currentBarNumber
4002
4003 Bar numbers are printed by default at the start of the line.  The
4004 number itself is stored in the 
4005 @code{currentBarNumber} property,
4006 which is normally updated automatically for every measure.
4007
4008 Bar numbers can be typeset at regular intervals instead of at the
4009 beginning of each line. This is illustrated in the following example,
4010 whose source is available as
4011 @inputfileref{input/test,bar-number-regular-interval.ly}
4012
4013 @lilypondfile[notexidoc]{bar-number-regular-interval.ly}
4014
4015
4016 @seealso
4017
4018 @internalsref{BarNumber}.
4019 @inputfileref{input/test,bar-number-every-five-reset.ly}.
4020 @inputfileref{input/test,bar-number-regular-interval.ly}
4021
4022 @refbugs
4023
4024 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
4025 there is one at the top. To solve this, In that case, the
4026 @internalsref{padding} property of @internalsref{BarNumber} can be
4027 used to position the number correctly.
4028
4029 @node Instrument names
4030 @subsection Instrument names
4031
4032 In an orchestral score, instrument names are printed left of the
4033 staffs.
4034
4035 This can be achieved by setting @internalsref{Staff}.@code{instrument}
4036 and @internalsref{Staff}.@code{instr}. This will print a string before
4037 the start of the staff. For the first start, @code{instrument} is
4038 used, for the next ones @code{instr} is used.
4039
4040 @lilypond[verbatim,singleline]
4041   \property Staff.instrument = "ploink " { c''4 }  
4042 @end lilypond
4043
4044 You can also use markup texts to construct more complicated instrument
4045 names.
4046
4047 @lilypond[fragment,verbatim,singleline]
4048   \notes \context Staff = treble {
4049     \property Staff.instrument = \markup {
4050         \column << "Clarinetti"
4051           { "in B"
4052             \smaller \musicglyph #"accidentals--1"
4053           }
4054           >>
4055      }
4056      { c''1 }
4057   }
4058 @end lilypond
4059
4060
4061 @seealso
4062
4063 @internalsref{InstrumentName}
4064
4065 @refbugs
4066
4067 When you put a name on a grand staff or piano staff the width of the
4068 brace is not taken into account. You must add extra spaces to the end of
4069 the name to avoid a collision.
4070
4071 @node Transpose
4072 @subsection Transpose
4073 @cindex Transpose
4074 @cindex transposition of pitches
4075 @cindex @code{\transpose}
4076
4077 A music expression can be transposed with @code{\transpose}.  The syntax
4078 is
4079 @example
4080   \transpose @var{from} @var{to} @var{musicexpr}
4081 @end example
4082
4083 This means that @var{musicexpr} is transposed by the interval
4084 between @var{from} and @var{to}.
4085
4086 @code{\transpose} distinguishes between enharmonic pitches: both
4087 @code{\transpose c cis} or @code{\transpose c des} will transpose up
4088 half a tone.  The first version will print sharps and the second
4089 version will print flats.
4090
4091 @lilypond[singleline, verbatim]
4092 mus =\notes { \key d \major cis d fis g }
4093 \score { \notes \context Staff {
4094   \clef "F" \mus
4095   \clef "G"
4096   \transpose c g' \mus
4097   \transpose c f' \mus
4098 }}
4099 @end lilypond
4100
4101 @seealso
4102
4103 @internalsref{TransposedMusic}, @internalsref{UntransposableMusic}. 
4104
4105 @refbugs
4106
4107 If you want to use both @code{\transpose} and @code{\relative}, then
4108 you must put @code{\transpose} outside of @code{\relative}, since
4109 @code{\relative} will have no effect music that appears inside a
4110 @code{\transpose}.
4111
4112
4113
4114
4115 @node  Multi measure rests
4116 @subsection Multi measure rests
4117 @cindex multi measure rests
4118 @cindex Rests, multi measure
4119
4120 @cindex @code{R}
4121
4122 Multi measure rests are entered using `@code{R}'. It is specifically
4123 meant for full bar rests and for entering parts: the rest can expand to
4124 fill a score with rests, or it can be printed as a single multimeasure
4125 rest. This expansion is controlled by the property
4126 @code{Score.skipBars}. If this is set to true, Lily will not expand
4127 empty measures, and the appropriate number is added automatically.
4128
4129 @lilypond[fragment,verbatim]
4130  \time 4/4 r1 | R1 | R1*2
4131  \property Score.skipBars = ##t R1*17  R1*4
4132 @end lilypond
4133
4134 The @code{1} in @code{R1} is similar to the duration notation used for
4135 notes. Hence, for time signatures other than 4/4, you must enter other
4136 durations.  This can be done with augmentation dots or fractions:
4137
4138 @lilypond[fragment,verbatim]
4139  \property Score.skipBars = ##t
4140  \time 3/4
4141   R2. | R2.*2
4142  \time 13/8
4143  R1*13/8
4144  R1*13/8*12
4145 @end lilypond
4146
4147 A @code{R} spanning a single measure is printed as either a whole rest
4148 or a breve, centered in the measure regardless of the time signature.
4149
4150 @cindex text on multi-measure rest
4151 @cindex script on multi-measure rest
4152 @cindex fermata on multi-measure rest
4153
4154 Texts can be added to multi-measure rests by using the
4155 @var{note}-@code{markup} syntax (see @ref{Text markup}).  In this case, the number is
4156 replaced. If you need both texts and the number, you must add the
4157 number by hand. A variable (@code{\fermataMarkup}) is provided for
4158 adding fermatas.
4159
4160
4161 @lilypond[verbatim,fragment]
4162   \time 3/4
4163   R2._\markup { "Ad lib" }
4164   R2.^\fermataMarkup
4165 @end lilypond
4166
4167
4168 @cindex whole rests for a full measure 
4169
4170 @seealso
4171
4172 @internalsref{MultiMeasureRestEvent},
4173 @internalsref{MultiMeasureTextEvent},
4174 @internalsref{MultiMeasureRestMusicGroup},
4175 @internalsref{MultiMeasureRest}, 
4176
4177 The layout object @internalsref{MultiMeasureRestNumber} is for the
4178 default number, and @internalsref{MultiMeasureRestText} for user
4179 specified texts.
4180
4181 @refbugs
4182
4183 It is not possible to use fingerings (e.g. @code{R1-4}) to put numbers
4184 over multi-measure rests.
4185
4186 @cindex condensing rests
4187
4188 There is no way to automatically condense multiple rests into a single
4189 multimeasure rest. Multi measure rests do not take part in rest
4190 collisions.
4191
4192 Be careful when entering multimeasure rests followed by whole notes,
4193 @example
4194  R1*4 cis cis 
4195 @end example
4196 will enter two notes lasting four measures each. When @code{skipBars}
4197 is set, then the result will look OK, but the bar numbering will be
4198 off.
4199
4200 @node Automatic part combining
4201 @subsection Automatic part combining
4202 @cindex automatic part combining
4203 @cindex part combiner
4204
4205
4206 Automatic part combining is used to merge two parts of music onto a
4207 staff.  It is aimed at typesetting orchestral scores.  When the two
4208 parts are identical for a period of time, only one is shown.  In
4209 places where the two parts differ, they are typeset as separate
4210 voices, and stem directions are set automatically.  Also, solo and
4211 @emph{a due} parts are identified and can be marked.
4212
4213 @syntax
4214
4215 The syntax for part combining is
4216
4217 @example
4218   \partcombine @var{context} @var{musicexpr1} @var{musicexpr2}
4219 @end example
4220 where the pieces of music @var{musicexpr1} and @var{musicexpr2} will be
4221 combined into one context of type @var{context}.  The music expressions
4222 must be interpreted by contexts whose names should start with @code{one}
4223 and @code{two}.
4224
4225 The following example demonstrates the basic functionality of the part
4226 combiner: putting parts on one staff, and setting stem directions and
4227 polyphony.
4228
4229 @lilypond[verbatim,singleline,fragment]
4230   \context Staff <
4231     \context Voice=one \partcombine Voice
4232       \context Thread=one \relative c'' {
4233         g a-( b-) r
4234       }
4235       \context Thread=two \relative c'' {
4236         g r4 r f
4237       }
4238   >
4239 @end lilypond
4240
4241 The first @code{g} appears only once, although it was
4242 specified twice (once in each part).  Stem, slur and tie directions are
4243 set automatically, depending whether there is a solo or unisono. The
4244 first part (with context called @code{one}) always gets up stems, and
4245 `solo', while the second (called @code{two}) always gets down stems and
4246 `Solo II'.
4247
4248 If you just want the merging parts, and not the textual markings, you
4249 may set the property @var{soloADue} to false.
4250
4251 @lilypond[verbatim,singleline,fragment]
4252   \context Staff <
4253     \property Staff.soloADue = ##f
4254     \context Voice=one \partcombine Voice
4255       \context Thread=one \relative c'' {
4256         b4 a c g
4257       }
4258       \context Thread=two \relative c'' {
4259         d,2 a4 g'
4260       }
4261   >
4262 @end lilypond
4263
4264 @seealso
4265
4266 @internalsref{PartCombineMusic},
4267 @internalsref{Thread_devnull_engraver},
4268 @internalsref{Voice_devnull_engraver} and @internalsref{A2_engraver}.
4269
4270 @refbugs
4271
4272 The syntax for naming contexts in inconsistent with the syntax for
4273 combining stanzas.
4274
4275 In @code{soloADue} mode, when the two voices play the same notes on and
4276 off, the part combiner may typeset @code{a2} more than once in a
4277 measure.
4278
4279 @lilypond[fragment,singleline]
4280   \context Staff <
4281     \context Voice=one \partcombine Voice
4282       \context Thread=one \relative c'' {
4283         c b c b c a c a
4284       }
4285       \context Thread=two \relative c'' {
4286         b b b b f a f a
4287       }
4288   >
4289 @end lilypond
4290
4291 The part combiner is slated to be rewritten [TODO: explain why].
4292
4293 @cindex @code{Thread_devnull_engraver}
4294 @cindex @code{Voice_engraver}
4295 @cindex @code{A2_engraver}
4296
4297 @node Frenched scores
4298 @subsection Frenched scores
4299
4300 In orchestral scores, staff lines that only have rests are usually
4301 removed.  This saves some space. This style is called `French Score'.
4302 For @internalsref{Lyrics}, @internalsref{LyricsVoice},
4303 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
4304 switched on by default.  When these line of these contexts turn out
4305 empty after the line-breaking process, they are removed.
4306
4307
4308 For normal staffs, a specialized @internalsref{Staff} context is
4309 available, which does the same: staffs containing nothing (or only
4310 multi measure rests) are removed. The context definition is stored in
4311 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
4312 in this example disappears in the second line.
4313
4314
4315 @lilypond[verbatim]
4316 \score  {
4317   \notes \relative c' <
4318     \context Staff = SA { e4 f g a \break c1 }
4319     \context Staff = SB { c4 d e f \break R1 }
4320   >
4321   \paper {
4322     linewidth = 6.\cm 
4323     \translator { \RemoveEmptyStaffContext }
4324   }
4325 }
4326 @end lilypond
4327
4328
4329 @node Sound output for transposing instruments
4330 @subsection Sound output for transposing instruments
4331
4332 When you want to make a MIDI file from a score containing transposed
4333 and untransposed instruments, you have to instruct LilyPond the pitch
4334 offset (in semitones) for the transposed instruments. This is done
4335 using the @code{transposing} property. It does not affect printed
4336 output.
4337
4338 @cindex @code{transposing}
4339
4340 @example
4341         \property Staff.instrument = #"Cl. in B-flat"
4342         \property Staff.transposing = #-2
4343 @end example
4344
4345
4346 @node Ancient notation 
4347 @section Ancient notation
4348
4349 @cindex Vaticana, Editio
4350 @cindex Medicaea, Editio
4351 @cindex hufnagel
4352 @cindex Petrucci
4353 @cindex mensural
4354
4355 @c [TODO: write introduction on ancient notation]
4356
4357 @menu
4358 * Ancient note heads::          
4359 * Ancient clefs ::              
4360 * Custodes::                    
4361 * Divisiones::                  
4362 * Ligatures::                   
4363 * Figured bass::                
4364 @end menu
4365
4366
4367 @node Ancient note heads
4368 @subsection Ancient note heads
4369
4370 To get a longa note head, you have to use mensural note heads. This
4371 is accomplished by setting the @code{style} property of the
4372 NoteHead object to @code{mensural}. There is also a note head style
4373 @code{baroque} which gives mensural note heads for @code{\longa} and
4374 @code{\breve} but standard note heads for shorter notes.
4375
4376 @lilypond[fragment,singleline,verbatim]
4377  \property Voice.NoteHead \set #'style = #'mensural
4378  a'\longa
4379 @end lilypond
4380
4381 @node Ancient clefs 
4382 @subsection Ancient clefs
4383
4384 LilyPond supports a variety of clefs, many of them ancient.
4385
4386 For modern clefs, see section @ref{Clef}.  For the percussion clef, see
4387 section @ref{Percussion staves}.  For the @code{TAB} clef, see section
4388 @ref{Tablatures}.
4389
4390 The following table shows all ancient clefs that are supported via the
4391 @code{\clef} command.  Some of the clefs use the same glyph, but
4392 differ only with respect to the line they are printed on.  In such
4393 cases, a trailing number in the name is used to enumerate these clefs.
4394 Still, you can manually force a clef glyph to be typeset on an
4395 arbitrary line, as described in section @ref{Clef}.  The note printed
4396 to the right side of each clef in the example column denotes the
4397 @code{c'} with respect to that clef.
4398
4399 @multitable @columnfractions  .3 .3 .3 .1
4400
4401 @item
4402 @b{Glyph Name} @tab
4403 @b{Description} @tab
4404 @b{Supported Clefs} @tab
4405 @b{Example}
4406
4407 @item
4408 @code{clefs-neo_mensural_c} @tab
4409 modern style mensural C clef @tab
4410 @code{neo_mensural_c1}, @code{neo_mensural_c2},
4411 @code{neo_mensural_c3}, @code{neo_mensural_c4} @tab
4412 @lilypond[relative 0, notime]
4413 \property Staff.TimeSignature \set #'transparent = ##t
4414 \clef "neo_mensural_c2" c
4415 @end lilypond
4416
4417 @item
4418 @code{clefs-petrucci_c1}
4419 @code{clefs-petrucci_c2}
4420 @code{clefs-petrucci_c3}
4421 @code{clefs-petrucci_c4}
4422 @code{clefs-petrucci_c5}
4423
4424 @tab
4425 petrucci style mensural C clefs, for use  on different  stafflines
4426 (the examples shows the 2nd staffline C clef).
4427
4428 @tab
4429 @code{petrucci_c1}
4430 @code{petrucci_c2}
4431 @code{petrucci_c3}
4432 @code{petrucci_c4}
4433 @code{petrucci_c5}
4434
4435 @tab
4436 @lilypond[relative 0, notime]
4437 \property Staff.TimeSignature \set #'transparent = ##t
4438 \clef "petrucci_c2" c
4439 @end lilypond
4440
4441 @item
4442 @code{clefs-petrucci_f} @tab
4443 petrucci style mensural F clef @tab
4444 @code{petrucci_f} @tab
4445 @lilypond[relative 0, notime]
4446 \property Staff.TimeSignature \set #'transparent = ##t
4447 \clef "petrucci_f" c
4448 @end lilypond
4449
4450 @item
4451 @code{clefs-petrucci_g} @tab
4452 petrucci style mensural G clef @tab
4453 @code{petrucci_g} @tab
4454 @lilypond[relative 0, notime]
4455 \property Staff.TimeSignature \set #'transparent = ##t
4456 \clef "petrucci_g" c
4457 @end lilypond
4458
4459 @item
4460 @code{clefs-mensural_c'} @tab
4461 historic style mensural C clef @tab
4462 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
4463 @code{mensural_c4} @tab
4464 @lilypond[relative 0, notime]
4465 \property Staff.TimeSignature \set #'transparent = ##t
4466 \clef "mensural_c2" c
4467 @end lilypond
4468
4469 @item
4470 @code{clefs-mensural_f} @tab
4471 historic style mensural F clef @tab
4472 @code{mensural_f} @tab
4473 @lilypond[relative 0, notime]
4474 \property Staff.TimeSignature \set #'transparent = ##t
4475 \clef "mensural_f" c
4476 @end lilypond
4477
4478 @item
4479 @code{clefs-mensural_g} @tab
4480 historic style mensural G clef @tab
4481 @code{mensural_g} @tab
4482 @lilypond[relative 0, notime]
4483 \property Staff.TimeSignature \set #'transparent = ##t
4484 \clef "mensural_g" c
4485 @end lilypond
4486
4487 @item
4488 @code{clefs-vaticana_do} @tab
4489 Editio Vaticana style do clef @tab
4490 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
4491 @lilypond[relative 0, notime]
4492 \context Staff
4493 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4494 \property Staff.TimeSignature \set #'transparent = ##t
4495 \clef "vaticana_do2" c
4496 @end lilypond
4497
4498 @item
4499 @code{clefs-vaticana_fa} @tab
4500 Editio Vaticana style fa clef @tab
4501 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
4502 @lilypond[relative 0, notime]
4503 \context Staff
4504 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4505 \property Staff.TimeSignature \set #'transparent = ##t
4506 \clef "vaticana_fa2" c
4507 @end lilypond
4508
4509 @item
4510 @code{clefs-medicaea_do} @tab
4511 Editio Medicaea style do clef @tab
4512 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
4513 @lilypond[relative 0, notime]
4514 \context Staff
4515 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4516 \property Staff.TimeSignature \set #'transparent = ##t
4517 \clef "medicaea_do2" c
4518 @end lilypond
4519
4520 @item
4521 @code{clefs-medicaea_fa} @tab
4522 Editio Medicaea style fa clef @tab
4523 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
4524 @lilypond[relative 0, notime]
4525 \context Staff
4526 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4527 \property Staff.TimeSignature \set #'transparent = ##t
4528 \clef "medicaea_fa2" c
4529 @end lilypond
4530
4531 @item
4532 @code{clefs-hufnagel_do} @tab
4533 historic style hufnagel do clef @tab
4534 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
4535 @lilypond[relative 0, notime]
4536 \context Staff
4537 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4538 \property Staff.TimeSignature \set #'transparent = ##t
4539 \clef "hufnagel_do2" c
4540 @end lilypond
4541
4542 @item
4543 @code{clefs-hufnagel_fa} @tab
4544 historic style hufnagel fa clef @tab
4545 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
4546 @lilypond[relative 0, notime]
4547 \context Staff
4548 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4549 \property Staff.TimeSignature \set #'transparent = ##t
4550 \clef "hufnagel_fa2" c
4551 @end lilypond
4552
4553 @item
4554 @code{clefs-hufnagel_do_fa} @tab
4555 historic style hufnagel combined do/fa clef @tab
4556 @code{hufnagel_do_fa} @tab
4557 @lilypond[relative 0, notime]
4558 \property Staff.TimeSignature \set #'transparent = ##t
4559 \clef "hufnagel_do_fa" c
4560 @end lilypond
4561
4562 @end multitable
4563
4564 @c --- This should go somewhere else: ---
4565 @c @item modern style percussion clef (glyph: @code{clefs-percussion})
4566 @c
4567 @c Supported clefs:
4568 @c @code{percussion}
4569 @c
4570 @c @lilypond{\property Staff.TimeSignature \set #'transparent = ##t \clef "percussion" c'}
4571 @c
4572 @c @item modern style tab clef (glyph: @code{clefs-tab})
4573 @c
4574 @c Supported clefs:
4575 @c @code{tab}
4576 @c
4577 @c @lilypond{\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #6 \property Staff.TimeSignature \set #'transparent = ##t \clef "tab" c'}
4578
4579 @emph{Modern style} means ``as is typeset in contemporary editions of
4580 transcribed mensural music''.
4581
4582 @emph{Petrucci style} means ``inspired by printings published by the
4583 famous engraver Petrucci (1466-1539)''.
4584
4585 @emph{Historic style} means ``as was typeset or written in historic
4586 editions (other than those of Petrucci)''.
4587
4588 @emph{Editio XXX style} means ``as is/was printed in Editio XXX''.
4589
4590 Petrucci used C clefs with differently balanced left-side vertical
4591 beams, depending on which staffline it is printed.
4592
4593
4594 @node Custodes
4595 @subsection Custodes
4596
4597 @cindex custos
4598 @cindex custodes
4599
4600 A @emph{custos} (plural: @emph{custodes}; latin word for `guard') is a
4601 symbol that appears at the end of a staff.  It anticipates the pitch
4602 of the first note(s) of the following line and thus helps the player
4603 or singer to manage line breaks during performance, thus enhancing
4604 readability of a score.
4605
4606 Custodes were frequently used in music notation until the 17th
4607 century.  Nowadays, they have survived only in a few particular forms
4608 of musical notation such as contemporary editions of Gregorian chant
4609 like the @emph{editio vaticana}.  There are different custos glyphs
4610 used in different flavours of notational style.
4611
4612 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
4613 @internalsref{Staff} context when declaring the @code{\paper} block,
4614 as shown in the following example.
4615
4616 @example
4617 \paper @{
4618   \translator @{
4619      \StaffContext
4620      \consists Custos_engraver
4621      Custos \override #'style = #'mensural
4622   @}
4623 @}
4624 @end example
4625
4626 The result looks like this:
4627
4628 @lilypond
4629 \score {
4630     \notes {
4631         a'1
4632         \property Staff.Custos \set #'style = #'mensural
4633         \break
4634         g'
4635     }
4636     \paper {
4637         \translator {
4638             \StaffContext
4639             \consists Custos_engraver
4640         }
4641         linewidth = 4.0\cm
4642     }
4643 }
4644 @end lilypond
4645
4646 The custos glyph is selected by the @code{style} property. The styles
4647 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
4648 @code{mensural}.  They are demonstrated in the following fragment:
4649
4650 @lilypond
4651 \score {
4652     \notes {
4653         \fatText
4654         s
4655         ^\markup {
4656             \column <<
4657                 "vaticana" 
4658                 { " " \musicglyph #"custodes-vaticana-u0" }
4659             >>
4660             \column <<
4661                 "medicaea"
4662                 { " " \musicglyph #"custodes-medicaea-u0" }
4663             >>
4664             \column <<
4665                 "hufnagel"
4666                 { " " \musicglyph #"custodes-hufnagel-u0" }
4667             >>
4668             \column <<
4669                 "mensural"
4670                 { " " \musicglyph #"custodes-mensural-u0" }
4671             >>
4672         }
4673     }
4674     \paper {
4675         raggedright = ##t 
4676         interscoreline = 1
4677         \translator {
4678             \ScoreContext
4679             \remove "Bar_number_engraver"
4680         }
4681         \translator{
4682             \StaffContext
4683             \remove "Clef_engraver"
4684             \remove "Key_engraver"
4685             \remove "Time_signature_engraver"
4686             \remove "Staff_symbol_engraver"
4687             minimumVerticalExtent = ##f
4688         }
4689     }
4690 }
4691 @end lilypond
4692
4693 If the boolean property @code{adjust-if-on-staffline} is set to
4694 @code{#t} (which it is by default), lily typesets slightly different
4695 variants of the custos glyph, depending on whether the custos, is
4696 typeset on or between stafflines.   The glyph will
4697 optically fit well into the staff, with the appendage on the right of
4698 the custos always ending at the same vertical position between two
4699 stafflines regardless of the pitch.  If you set
4700 @code{adjust-if-on-staffline} to @code{#f}, then
4701 a compromise between both forms is  used.
4702
4703 Just like stems can be attached to noteheads in two directions
4704 @emph{up} and @emph{down}, each custos glyph is available with its
4705 appendage pointing either up or down.  If the pitch of a custos is
4706 above a selectable position, the appendage will point downwards; if
4707 the pitch is below this position, the appendage will point upwards.
4708 Use property @code{neutral-position} to select this position.  By
4709 default, it is set to @code{0}, such that the neutral position is the
4710 center of the staff.  Use property @code{neutral-direction} to control
4711 what happens if a custos is typeset on the neutral position itself.
4712 By default, this property is set to @code{-1}, such that the appendage
4713 will point downwards.  If set to @code{1}, the appendage will point
4714 upwards.  Other values such as @code{0} are reserved for future
4715 extensions and should not be used.
4716
4717 @seealso
4718
4719
4720 @internalsref{Custos}, @inputfileref{input/test,custos-style.ly} and
4721 @inputfileref{input/regression,custos.ly}.
4722
4723
4724 @node Divisiones
4725 @subsection Divisiones
4726
4727 @cindex divisio
4728 @cindex divisiones
4729 @cindex finalis
4730
4731 A @emph{divisio} (plural: @emph{divisiones}; latin word for
4732 `division') is a staff context symbol that is used to structure
4733 Gregorian music into phrases and sections.  The musical meaning of
4734 @emph{divisio minima}, @emph{divisio maior} and @emph{divisio maxima}
4735 can be characterized as short, medium and long pause, somewhat like
4736 @ref{Breath marks}.  The @emph{finalis} sign not only marks the end of
4737 a chant, but is also frequently used within a single
4738 antiphonal/responsorial chant to mark the end of each section.
4739
4740 @syntax
4741
4742 To use divisiones, include the file @code{gregorian-init.ly}.  It
4743 contains definitions that you can apply by just inserting
4744 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
4745 and @code{\finalis} at proper places in the input.  Some editions use
4746 @emph{virgula} or @emph{caesura} instead of divisio minima.
4747 Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and
4748 @code{\caesura}.
4749
4750
4751 @lilypondfile[notexidoc]{divisiones.ly}
4752
4753 @seealso
4754
4755 @internalsref{BreathingSign}, @internalsref{BreathingSignEvent},
4756 @inputfileref{input/test,divisiones.ly}, @ref{Breath marks}.
4757
4758 @node Ligatures
4759 @subsection Ligatures
4760
4761 @cindex Ligatures
4762
4763 @c TODO: Should double check if I recalled things correctly when I wrote
4764 @c down the following paragraph by heart.
4765
4766 In musical terminology, a ligature is a coherent graphical symbol that
4767 represents at least two different notes.  Ligatures originally appeared
4768 in the manuscripts of Gregorian chant notation roughly since the 9th
4769 century as an allusion to the accent symbols of greek lyric poetry to
4770 denote ascending or descending sequences of notes.  Both, the shape and
4771 the exact meaning of ligatures changed tremendously during the following
4772 centuries: In early notation, ligatures where used for monophonic tunes
4773 (Gregorian chant) and very soon denoted also the way of performance in
4774 the sense of articulation.  With upcoming multiphony, the need for a
4775 metric system arised, since multiple voices of a piece have to be
4776 synchronized some way.  New notation systems were invented that used
4777 the manifold shapes of ligatures to now denote rhythmical patterns
4778 (e.g. black mensural notation, mannered notation, ars nova).  With the
4779 invention of the metric system of the white mensural notation, the need
4780 for ligatures to denote such patterns disappeared.  Nevertheless,
4781 ligatures were still in use in the mensural system for a couple of
4782 decades until they finally disappeared during the late 16th / early 17th
4783 century.  Still, ligatures have survived in contemporary editions of
4784 Gregorian chant such as the Editio Vaticana from 1905/08.
4785
4786 @syntax
4787
4788 Syntactically, ligatures are simply enclosed by @code{\[} and
4789 @code{\]}.  Some ligature styles (such as Editio Vaticana) may need
4790 additional input syntax specific for this particular type of ligature.
4791 By default, the @internalsref{LigatureBracket} engraver just puts a
4792 square bracket above the ligature.
4793
4794 @lilypond[singleline,verbatim]
4795 \score {
4796     \notes \transpose c c' {
4797         \[ g c a f d' \]
4798         a g f
4799         \[ e f a g \]
4800     }
4801 }
4802 @end lilypond
4803
4804 To select a specific style of ligatures, a proper ligature engraver
4805 has to be added to the @internalsref{Voice} context, as explained in
4806 the following subsections.  Currently, only white mensural ligatures
4807 are supported with certain limitations.  Support for Editio Vaticana
4808 will be added in the future.
4809
4810 @menu
4811 * White mensural ligatures::    
4812 * Gregorian square neumes ligatures::  
4813 @end menu
4814
4815 @node White mensural ligatures
4816 @subsubsection White mensural ligatures
4817
4818 @cindex Mensural ligatures
4819 @cindex White mensural ligatures
4820
4821 There is limited support for white mensural ligatures.  The
4822 implementation is still experimental; it currently may output strange
4823 warnings or even crash in some cases or produce weird results on more
4824 complex ligatures.  To engrave white mensural ligatures, in the paper
4825 block the @internalsref{Mensural_ligature_engraver} has to be put into
4826 the @internalsref{Voice} context, and remove the
4827 @internalsref{Ligature_bracket_engraver}:
4828
4829 @example
4830     \paper @{
4831         \translator @{
4832             \VoiceContext
4833             \remove Ligature_bracket_engraver
4834             \consists Mensural_ligature_engraver
4835         @}
4836     @}
4837 @end example
4838
4839 There is no additional input language to describe the shape of a
4840 white mensural ligature.  The shape is rather determined solely from
4841 the pitch and duration of the enclosed notes.  While this approach may
4842 take a new user a while to get accustomed, it has the great advantage
4843 that the full musical information of the ligature is known internally.
4844 This is not only required for correct MIDI output, but also allows for
4845 automatic transcription of the ligatures.
4846
4847 Example:
4848
4849 @example
4850         \property Score.timing = ##f
4851         \property Score.defaultBarType = "empty"
4852         \property Voice.NoteHead \set #'style = #'neo_mensural
4853         \property Staff.TimeSignature \set #'style = #'neo_mensural
4854         \clef "petrucci_g"
4855         \[ g\longa c\breve a\breve f\breve d'\longa \]
4856         s4
4857         \[ e1 f1 a\breve g\longa \]
4858 @end example
4859 @lilypond[singleline]
4860 \score {
4861     \notes \transpose c c' {
4862         \property Score.timing = ##f
4863         \property Score.defaultBarType = "empty"
4864         \property Voice.NoteHead \set #'style = #'neo_mensural
4865         \property Staff.TimeSignature \set #'style = #'neo_mensural
4866         \clef "petrucci_g"
4867         \[ g\longa c\breve a\breve f\breve d'\longa \]
4868         s4
4869         \[ e1 f1 a\breve g\longa \]
4870     }
4871     \paper {
4872         \translator {
4873             \VoiceContext
4874             \remove Ligature_bracket_engraver
4875             \consists Mensural_ligature_engraver
4876         }
4877     }
4878 }
4879 @end lilypond
4880
4881 Without replacing @internalsref{Ligature_bracket_engraver} with
4882 @internalsref{Mensural_ligature_engraver}, the same music transcribes
4883 to the following:
4884
4885 @lilypond[singleline]
4886 \score {
4887     \notes \transpose c c' {
4888         \property Score.timing = ##f
4889         \property Score.defaultBarType = "empty"
4890         \property Voice.NoteHead \set #'style = #'neo_mensural
4891         \property Staff.TimeSignature \set #'style = #'neo_mensural
4892         \clef "petrucci_g"
4893         \[ g\longa c\breve a\breve f\breve d'\longa \]
4894         s4
4895         \[ e1 f1 a\breve g\longa \]
4896     }
4897 }
4898 @end lilypond
4899
4900 @node Gregorian square neumes ligatures
4901 @subsubsection Gregorian square neumes ligatures
4902
4903 @cindex Square neumes ligatures
4904 @cindex Gregorian square neumes ligatures
4905
4906 Gregorian square neumes notation (following the style of the Editio
4907 Vaticana) is under heavy development, but not yet really usable for
4908 production purposes.  Core ligatures can already be typeset, but
4909 essential issues for serious typesetting are still under development,
4910 such as (among others) horizontal alignment of multiple ligatures,
4911 lyrics alignment and proper accidentals handling.  Still, this section
4912 gives a sneak preview of what Gregorian chant may look like once it
4913 will work.
4914
4915 The following table contains the extended neumes table of the 2nd
4916 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
4917 1983 by the monks of Solesmes.
4918
4919 @multitable @columnfractions .4 .2 .2 .2
4920
4921 @item
4922 @b{Neuma aut@*Neumarum Elementa} @tab
4923 @b{Figurae@*Rectae} @tab
4924 @b{Figurae@*Liquescentes Auctae} @tab
4925 @b{Figurae@*Liquescentes Deminutae}
4926
4927 @c TODO: \paper block is identical in all of the below examples.
4928 @c Therefore, it should somehow be included rather than duplicated all
4929 @c the time. --jr
4930
4931 @c why not make identifiers in ly/engraver-init.ly? --hwn
4932
4933 @c Because it's just used to typeset plain notes without
4934 @c a staff for demonstration purposes rather than something
4935 @c special of Gregorian chant notation. --jr
4936
4937 @item
4938 @code{1. Punctum}
4939 @tab
4940 @lilypond[noindent, 26pt, nofragment, linewidth=1.5cm]
4941 \include "gregorian-init.ly"
4942 \score {
4943     \notes \transpose c c' {
4944         % Punctum
4945         \[ b \]
4946         \noBreak s^\markup {"a"} \noBreak
4947
4948         % Punctum Inclinatum
4949         \[ \inclinatum b \]
4950         \noBreak s^\markup {"b"}
4951     }
4952     \paper {
4953         interscoreline = 1
4954         \translator {
4955             \ScoreContext
4956             \remove "Bar_number_engraver"
4957         }
4958         \translator {
4959             \StaffContext
4960             \remove "Clef_engraver"
4961             \remove "Key_engraver"
4962             StaffSymbol \set #'transparent = ##t
4963             \remove "Time_signature_engraver"
4964             \remove "Bar_engraver"
4965             minimumVerticalExtent = ##f
4966         }
4967         \translator {
4968             \VoiceContext
4969             \remove Ligature_bracket_engraver
4970             \consists Vaticana_ligature_engraver
4971             NoteHead \set #'style = #'vaticana_punctum
4972             Stem \set #'transparent = ##t
4973         }
4974     }
4975 }
4976 @end lilypond
4977 @tab
4978 @lilypond[noindent, 26pt, nofragment, linewidth=2.5cm]
4979 \include "gregorian-init.ly"
4980 \score {
4981     \notes \transpose c c' {
4982         % Punctum Auctum Ascendens
4983         \[ \auctum \ascendens b \]
4984         \noBreak s^\markup {"c"} \noBreak
4985
4986         % Punctum Auctum Descendens
4987         \[ \auctum \descendens b \]
4988         \noBreak s^\markup {"d"} \noBreak
4989
4990         % Punctum Inclinatum Auctum
4991         \[ \inclinatum \auctum b \]
4992         \noBreak s^\markup {"e"}
4993     }
4994     \paper {
4995         interscoreline = 1
4996         \translator {
4997             \ScoreContext
4998             \remove "Bar_number_engraver"
4999         }
5000         \translator {
5001             \StaffContext
5002             \remove "Clef_engraver"
5003             \remove "Key_engraver"
5004             StaffSymbol \set #'transparent = ##t
5005             \remove "Time_signature_engraver"
5006             \remove "Bar_engraver"
5007             minimumVerticalExtent = ##f
5008         }
5009         \translator {
5010             \VoiceContext
5011             \remove Ligature_bracket_engraver
5012             \consists Vaticana_ligature_engraver
5013             NoteHead \set #'style = #'vaticana_punctum
5014             Stem \set #'transparent = ##t
5015         }
5016     }
5017 }
5018 @end lilypond
5019 @tab
5020 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5021 \include "gregorian-init.ly"
5022 \score {
5023     \notes \transpose c c' {
5024         % Punctum Inclinatum Parvum
5025         \[ \inclinatum \deminutum b \]
5026         \noBreak s^\markup {"f"}
5027     }
5028     \paper {
5029         interscoreline = 1
5030         \translator {
5031             \ScoreContext
5032             \remove "Bar_number_engraver"
5033         }
5034         \translator {
5035             \StaffContext
5036             \remove "Clef_engraver"
5037             \remove "Key_engraver"
5038             StaffSymbol \set #'transparent = ##t
5039             \remove "Time_signature_engraver"
5040             \remove "Bar_engraver"
5041             minimumVerticalExtent = ##f
5042         }
5043         \translator {
5044             \VoiceContext
5045             \remove Ligature_bracket_engraver
5046             \consists Vaticana_ligature_engraver
5047             NoteHead \set #'style = #'vaticana_punctum
5048             Stem \set #'transparent = ##t
5049         }
5050     }
5051 }
5052 @end lilypond
5053
5054 @item
5055 @code{2. Virga}
5056 @tab
5057 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5058 \include "gregorian-init.ly"
5059 \score {
5060     \notes \transpose c c' {
5061         % Virga
5062         \[ \virga b \]
5063         \noBreak s^\markup {"g"}
5064     }
5065     \paper {
5066         interscoreline = 1
5067         \translator {
5068             \ScoreContext
5069             \remove "Bar_number_engraver"
5070         }
5071         \translator {
5072             \StaffContext
5073             \remove "Clef_engraver"
5074             \remove "Key_engraver"
5075             StaffSymbol \set #'transparent = ##t
5076             \remove "Time_signature_engraver"
5077             \remove "Bar_engraver"
5078             minimumVerticalExtent = ##f
5079         }
5080         \translator {
5081             \VoiceContext
5082             \remove Ligature_bracket_engraver
5083             \consists Vaticana_ligature_engraver
5084             NoteHead \set #'style = #'vaticana_punctum
5085             Stem \set #'transparent = ##t
5086         }
5087     }
5088 }
5089 @end lilypond
5090 @tab
5091 @tab
5092
5093 @item
5094 @code{3. Apostropha vel Stropha}
5095 @tab
5096 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5097 \include "gregorian-init.ly"
5098 \score {
5099     \notes \transpose c c' {
5100         % Stropha
5101         \[ \stropha b \]
5102         \noBreak s^\markup {"h"}
5103     }
5104     \paper {
5105         interscoreline = 1
5106         \translator {
5107             \ScoreContext
5108             \remove "Bar_number_engraver"
5109         }
5110         \translator {
5111             \StaffContext
5112             \remove "Clef_engraver"
5113             \remove "Key_engraver"
5114             StaffSymbol \set #'transparent = ##t
5115             \remove "Time_signature_engraver"
5116             \remove "Bar_engraver"
5117             minimumVerticalExtent = ##f
5118         }
5119         \translator {
5120             \VoiceContext
5121             \remove Ligature_bracket_engraver
5122             \consists Vaticana_ligature_engraver
5123             NoteHead \set #'style = #'vaticana_punctum
5124             Stem \set #'transparent = ##t
5125         }
5126     }
5127 }
5128 @end lilypond
5129 @tab
5130 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5131 \include "gregorian-init.ly"
5132 \score {
5133     \notes \transpose c c' {
5134         % Stropha Aucta
5135         \[ \stropha \auctum b \]
5136         \noBreak s^\markup {"i"}
5137     }
5138     \paper {
5139         interscoreline = 1
5140         \translator {
5141             \ScoreContext
5142             \remove "Bar_number_engraver"
5143         }
5144         \translator {
5145             \StaffContext
5146             \remove "Clef_engraver"
5147             \remove "Key_engraver"
5148             StaffSymbol \set #'transparent = ##t
5149             \remove "Time_signature_engraver"
5150             \remove "Bar_engraver"
5151             minimumVerticalExtent = ##f
5152         }
5153         \translator {
5154             \VoiceContext
5155             \remove Ligature_bracket_engraver
5156             \consists Vaticana_ligature_engraver
5157             NoteHead \set #'style = #'vaticana_punctum
5158             Stem \set #'transparent = ##t
5159         }
5160     }
5161 }
5162 @end lilypond
5163 @tab
5164
5165 @item
5166 @code{4. Oriscus}
5167 @tab
5168 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5169 \include "gregorian-init.ly"
5170 \score {
5171     \notes \transpose c c' {
5172         % Oriscus
5173         \[ \oriscus b \]
5174         \noBreak s^\markup {"j"}
5175     }
5176     \paper {
5177         interscoreline = 1
5178         \translator {
5179             \ScoreContext
5180             \remove "Bar_number_engraver"
5181         }
5182         \translator {
5183             \StaffContext
5184             \remove "Clef_engraver"
5185             \remove "Key_engraver"
5186             StaffSymbol \set #'transparent = ##t
5187             \remove "Time_signature_engraver"
5188             \remove "Bar_engraver"
5189             minimumVerticalExtent = ##f
5190         }
5191         \translator {
5192             \VoiceContext
5193             \remove Ligature_bracket_engraver
5194             \consists Vaticana_ligature_engraver
5195             NoteHead \set #'style = #'vaticana_punctum
5196             Stem \set #'transparent = ##t
5197         }
5198     }
5199 }
5200 @end lilypond
5201 @tab
5202 @tab
5203
5204 @item
5205 @code{5. Clivis vel Flexa}
5206 @tab
5207 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5208 \include "gregorian-init.ly"
5209 \score {
5210     \notes \transpose c c' {
5211         % Clivis vel Flexa
5212         \[ b \flexa g \]
5213         s^\markup {"k"}
5214     }
5215     \paper {
5216         interscoreline = 1
5217         \translator {
5218             \ScoreContext
5219             \remove "Bar_number_engraver"
5220         }
5221         \translator {
5222             \StaffContext
5223             \remove "Clef_engraver"
5224             \remove "Key_engraver"
5225             StaffSymbol \set #'transparent = ##t
5226             \remove "Time_signature_engraver"
5227             \remove "Bar_engraver"
5228             minimumVerticalExtent = ##f
5229         }
5230         \translator {
5231             \VoiceContext
5232             \remove Ligature_bracket_engraver
5233             \consists Vaticana_ligature_engraver
5234             NoteHead \set #'style = #'vaticana_punctum
5235             Stem \set #'transparent = ##t
5236         }
5237     }
5238 }
5239 @end lilypond
5240 @tab
5241 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
5242 \include "gregorian-init.ly"
5243 \score {
5244     \notes \transpose c c' {
5245         % Clivis Aucta Descendens
5246         \[ b \flexa \auctum \descendens g \]
5247         \noBreak s^\markup {"l"} \noBreak
5248
5249         % Clivis Aucta Ascendens
5250         \[ b \flexa \auctum \ascendens g \]
5251         \noBreak s^\markup {"m"}
5252     }
5253     \paper {
5254         interscoreline = 1
5255         \translator {
5256             \ScoreContext
5257             \remove "Bar_number_engraver"
5258         }
5259         \translator {
5260             \StaffContext
5261             \remove "Clef_engraver"
5262             \remove "Key_engraver"
5263             StaffSymbol \set #'transparent = ##t
5264             \remove "Time_signature_engraver"
5265             \remove "Bar_engraver"
5266             minimumVerticalExtent = ##f
5267         }
5268         \translator {
5269             \VoiceContext
5270             \remove Ligature_bracket_engraver
5271             \consists Vaticana_ligature_engraver
5272             NoteHead \set #'style = #'vaticana_punctum
5273             Stem \set #'transparent = ##t
5274         }
5275     }
5276 }
5277 @end lilypond
5278 @tab
5279 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5280 \include "gregorian-init.ly"
5281 \score {
5282     \notes \transpose c c' {
5283         % Cephalicus
5284         \[ b \flexa \deminutum g \]
5285         s^\markup {"n"}
5286     }
5287     \paper {
5288         interscoreline = 1
5289         \translator {
5290             \ScoreContext
5291             \remove "Bar_number_engraver"
5292         }
5293         \translator {
5294             \StaffContext
5295             \remove "Clef_engraver"
5296             \remove "Key_engraver"
5297             StaffSymbol \set #'transparent = ##t
5298             \remove "Time_signature_engraver"
5299             \remove "Bar_engraver"
5300             minimumVerticalExtent = ##f
5301         }
5302         \translator {
5303             \VoiceContext
5304             \remove Ligature_bracket_engraver
5305             \consists Vaticana_ligature_engraver
5306             NoteHead \set #'style = #'vaticana_punctum
5307             Stem \set #'transparent = ##t
5308         }
5309     }
5310 }
5311 @end lilypond
5312
5313 @item
5314 @code{6. Podatus vel Pes}
5315 @tab
5316 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5317 \include "gregorian-init.ly"
5318 \score {
5319     \notes \transpose c c' {
5320         % Podatus vel Pes
5321         \[ g \pes b \]
5322         s^\markup {"o"}
5323     }
5324     \paper {
5325         interscoreline = 1
5326         \translator {
5327             \ScoreContext
5328             \remove "Bar_number_engraver"
5329         }
5330         \translator {
5331             \StaffContext
5332             \remove "Clef_engraver"
5333             \remove "Key_engraver"
5334             StaffSymbol \set #'transparent = ##t
5335             \remove "Time_signature_engraver"
5336             \remove "Bar_engraver"
5337             minimumVerticalExtent = ##f
5338         }
5339         \translator {
5340             \VoiceContext
5341             \remove Ligature_bracket_engraver
5342             \consists Vaticana_ligature_engraver
5343             NoteHead \set #'style = #'vaticana_punctum
5344             Stem \set #'transparent = ##t
5345         }
5346     }
5347 }
5348 @end lilypond
5349 @tab
5350 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
5351 \include "gregorian-init.ly"
5352 \score {
5353     \notes \transpose c c' {
5354         % Pes Auctus Descendens
5355         \[ g \pes \auctum \descendens b \]
5356         \noBreak s^\markup {"p"} \noBreak
5357
5358         % Pes Auctus Ascendens
5359         \[ g \pes \auctum \ascendens b \]
5360         \noBreak s^\markup {"q"}
5361     }
5362     \paper {
5363         interscoreline = 1
5364         \translator {
5365             \ScoreContext
5366             \remove "Bar_number_engraver"
5367         }
5368         \translator {
5369             \StaffContext
5370             \remove "Clef_engraver"
5371             \remove "Key_engraver"
5372             StaffSymbol \set #'transparent = ##t
5373             \remove "Time_signature_engraver"
5374             \remove "Bar_engraver"
5375             minimumVerticalExtent = ##f
5376         }
5377         \translator {
5378             \VoiceContext
5379             \remove Ligature_bracket_engraver
5380             \consists Vaticana_ligature_engraver
5381             NoteHead \set #'style = #'vaticana_punctum
5382             Stem \set #'transparent = ##t
5383         }
5384     }
5385 }
5386 @end lilypond
5387 @tab
5388 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5389 \include "gregorian-init.ly"
5390 \score {
5391     \notes \transpose c c' {
5392         % Epiphonus
5393         \[ g \pes \deminutum b \]
5394         s^\markup {"r"}
5395     }
5396     \paper {
5397         interscoreline = 1
5398         \translator {
5399             \ScoreContext
5400             \remove "Bar_number_engraver"
5401         }
5402         \translator {
5403             \StaffContext
5404             \remove "Clef_engraver"
5405             \remove "Key_engraver"
5406             StaffSymbol \set #'transparent = ##t
5407             \remove "Time_signature_engraver"
5408             \remove "Bar_engraver"
5409             minimumVerticalExtent = ##f
5410         }
5411         \translator {
5412             \VoiceContext
5413             \remove Ligature_bracket_engraver
5414             \consists Vaticana_ligature_engraver
5415             NoteHead \set #'style = #'vaticana_punctum
5416             Stem \set #'transparent = ##t
5417         }
5418     }
5419 }
5420 @end lilypond
5421
5422 @item
5423 @code{7. Pes Quassus}
5424 @tab
5425 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5426 \include "gregorian-init.ly"
5427 \score {
5428     \notes \transpose c c' {
5429         % Pes Quassus
5430         \[ \oriscus g \pes \virga b \]
5431         s^\markup {"s"}
5432     }
5433     \paper {
5434         interscoreline = 1
5435         \translator {
5436             \ScoreContext
5437             \remove "Bar_number_engraver"
5438         }
5439         \translator {
5440             \StaffContext
5441             \remove "Clef_engraver"
5442             \remove "Key_engraver"
5443             StaffSymbol \set #'transparent = ##t
5444             \remove "Time_signature_engraver"
5445             \remove "Bar_engraver"
5446             minimumVerticalExtent = ##f
5447         }
5448         \translator {
5449             \VoiceContext
5450             \remove Ligature_bracket_engraver
5451             \consists Vaticana_ligature_engraver
5452             NoteHead \set #'style = #'vaticana_punctum
5453             Stem \set #'transparent = ##t
5454         }
5455     }
5456 }
5457 @end lilypond
5458 @tab
5459 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5460 \include "gregorian-init.ly"
5461 \score {
5462     \notes \transpose c c' {
5463         % Pes Quassus Auctus Descendens
5464         \[ \oriscus g \pes \auctum \descendens b \]
5465         s^\markup {"t"}
5466     }
5467     \paper {
5468         interscoreline = 1
5469         \translator {
5470             \ScoreContext
5471             \remove "Bar_number_engraver"
5472         }
5473         \translator {
5474             \StaffContext
5475             \remove "Clef_engraver"
5476             \remove "Key_engraver"
5477             StaffSymbol \set #'transparent = ##t
5478             \remove "Time_signature_engraver"
5479             \remove "Bar_engraver"
5480             minimumVerticalExtent = ##f
5481         }
5482         \translator {
5483             \VoiceContext
5484             \remove Ligature_bracket_engraver
5485             \consists Vaticana_ligature_engraver
5486             NoteHead \set #'style = #'vaticana_punctum
5487             Stem \set #'transparent = ##t
5488         }
5489     }
5490 }
5491 @end lilypond
5492 @tab
5493
5494 @item
5495 @code{8. Quilisma Pes}
5496 @tab
5497 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5498 \include "gregorian-init.ly"
5499 \score {
5500     \notes \transpose c c' {
5501         % Quilisma Pes
5502         \[ \quilisma g \pes b \]
5503         s^\markup {"u"}
5504     }
5505     \paper {
5506         interscoreline = 1
5507         \translator {
5508             \ScoreContext
5509             \remove "Bar_number_engraver"
5510         }
5511         \translator {
5512             \StaffContext
5513             \remove "Clef_engraver"
5514             \remove "Key_engraver"
5515             StaffSymbol \set #'transparent = ##t
5516             \remove "Time_signature_engraver"
5517             \remove "Bar_engraver"
5518             minimumVerticalExtent = ##f
5519         }
5520         \translator {
5521             \VoiceContext
5522             \remove Ligature_bracket_engraver
5523             \consists Vaticana_ligature_engraver
5524             NoteHead \set #'style = #'vaticana_punctum
5525             Stem \set #'transparent = ##t
5526         }
5527     }
5528 }
5529 @end lilypond
5530 @tab
5531 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5532 \include "gregorian-init.ly"
5533 \score {
5534     \notes \transpose c c' {
5535         % Quilisma Pes Auctus Descendens
5536         \[ \quilisma g \pes \auctum \descendens b \]
5537         s^\markup {"v"}
5538     }
5539     \paper {
5540         interscoreline = 1
5541         \translator {
5542             \ScoreContext
5543             \remove "Bar_number_engraver"
5544         }
5545         \translator {
5546             \StaffContext
5547             \remove "Clef_engraver"
5548             \remove "Key_engraver"
5549             StaffSymbol \set #'transparent = ##t
5550             \remove "Time_signature_engraver"
5551             \remove "Bar_engraver"
5552             minimumVerticalExtent = ##f
5553         }
5554         \translator {
5555             \VoiceContext
5556             \remove Ligature_bracket_engraver
5557             \consists Vaticana_ligature_engraver
5558             NoteHead \set #'style = #'vaticana_punctum
5559             Stem \set #'transparent = ##t
5560         }
5561     }
5562 }
5563 @end lilypond
5564 @tab
5565
5566 @item
5567 @code{9. Podatus Initio Debilis}
5568 @tab
5569 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5570 \include "gregorian-init.ly"
5571 \score {
5572     \notes \transpose c c' {
5573         % Pes Initio Debilis
5574         \[ \deminutum g \pes b \]
5575         s^\markup {"w"}
5576     }
5577     \paper {
5578         interscoreline = 1
5579         \translator {
5580             \ScoreContext
5581             \remove "Bar_number_engraver"
5582         }
5583         \translator {
5584             \StaffContext
5585             \remove "Clef_engraver"
5586             \remove "Key_engraver"
5587             StaffSymbol \set #'transparent = ##t
5588             \remove "Time_signature_engraver"
5589             \remove "Bar_engraver"
5590             minimumVerticalExtent = ##f
5591         }
5592         \translator {
5593             \VoiceContext
5594             \remove Ligature_bracket_engraver
5595             \consists Vaticana_ligature_engraver
5596             NoteHead \set #'style = #'vaticana_punctum
5597             Stem \set #'transparent = ##t
5598         }
5599     }
5600 }
5601 @end lilypond
5602 @tab
5603 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5604 \include "gregorian-init.ly"
5605 \score {
5606     \notes \transpose c c' {
5607         % Pes Auctus Descendens Initio Debilis
5608         \[ \deminutum g \pes \auctum \descendens b \]
5609         s^\markup {"x"}
5610     }
5611     \paper {
5612         interscoreline = 1
5613         \translator {
5614             \ScoreContext
5615             \remove "Bar_number_engraver"
5616         }
5617         \translator {
5618             \StaffContext
5619             \remove "Clef_engraver"
5620             \remove "Key_engraver"
5621             StaffSymbol \set #'transparent = ##t
5622             \remove "Time_signature_engraver"
5623             \remove "Bar_engraver"
5624             minimumVerticalExtent = ##f
5625         }
5626         \translator {
5627             \VoiceContext
5628             \remove Ligature_bracket_engraver
5629             \consists Vaticana_ligature_engraver
5630             NoteHead \set #'style = #'vaticana_punctum
5631             Stem \set #'transparent = ##t
5632         }
5633     }
5634 }
5635 @end lilypond
5636 @tab
5637
5638 @item
5639 @code{10. Torculus}
5640 @tab
5641 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5642 \include "gregorian-init.ly"
5643 \score {
5644     \notes \transpose c c' {
5645         % Torculus
5646         \[ a \pes b \flexa g \]
5647         s^\markup {"y"}
5648     }
5649     \paper {
5650         interscoreline = 1
5651         \translator {
5652             \ScoreContext
5653             \remove "Bar_number_engraver"
5654         }
5655         \translator {
5656             \StaffContext
5657             \remove "Clef_engraver"
5658             \remove "Key_engraver"
5659             StaffSymbol \set #'transparent = ##t
5660             \remove "Time_signature_engraver"
5661             \remove "Bar_engraver"
5662             minimumVerticalExtent = ##f
5663         }
5664         \translator {
5665             \VoiceContext
5666             \remove Ligature_bracket_engraver
5667             \consists Vaticana_ligature_engraver
5668             NoteHead \set #'style = #'vaticana_punctum
5669             Stem \set #'transparent = ##t
5670         }
5671     }
5672 }
5673 @end lilypond
5674 @tab
5675 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5676 \include "gregorian-init.ly"
5677 \score {
5678     \notes \transpose c c' {
5679         % Torculus Auctus Descendens
5680         \[ a \pes b \flexa \auctum \descendens g \]
5681         s^\markup {"z"}
5682     }
5683     \paper {
5684         interscoreline = 1
5685         \translator {
5686             \ScoreContext
5687             \remove "Bar_number_engraver"
5688         }
5689         \translator {
5690             \StaffContext
5691             \remove "Clef_engraver"
5692             \remove "Key_engraver"
5693             StaffSymbol \set #'transparent = ##t
5694             \remove "Time_signature_engraver"
5695             \remove "Bar_engraver"
5696             minimumVerticalExtent = ##f
5697         }
5698         \translator {
5699             \VoiceContext
5700             \remove Ligature_bracket_engraver
5701             \consists Vaticana_ligature_engraver
5702             NoteHead \set #'style = #'vaticana_punctum
5703             Stem \set #'transparent = ##t
5704         }
5705     }
5706 }
5707 @end lilypond
5708 @tab
5709 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5710 \include "gregorian-init.ly"
5711 \score {
5712     \notes \transpose c c' {
5713         % Torculus Deminutus
5714         \[ a \pes b \flexa \deminutum g \]
5715         s^\markup {"A"}
5716     }
5717     \paper {
5718         interscoreline = 1
5719         \translator {
5720             \ScoreContext
5721             \remove "Bar_number_engraver"
5722         }
5723         \translator {
5724             \StaffContext
5725             \remove "Clef_engraver"
5726             \remove "Key_engraver"
5727             StaffSymbol \set #'transparent = ##t
5728             \remove "Time_signature_engraver"
5729             \remove "Bar_engraver"
5730             minimumVerticalExtent = ##f
5731         }
5732         \translator {
5733             \VoiceContext
5734             \remove Ligature_bracket_engraver
5735             \consists Vaticana_ligature_engraver
5736             NoteHead \set #'style = #'vaticana_punctum
5737             Stem \set #'transparent = ##t
5738         }
5739     }
5740 }
5741 @end lilypond
5742
5743 @item
5744 @code{11. Torculus Initio Debilis}
5745 @tab
5746 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5747 \include "gregorian-init.ly"
5748 \score {
5749     \notes \transpose c c' {
5750         % Torculus Initio Debilis
5751         \[ \deminutum a \pes b \flexa g \]
5752         s^\markup {"B"}
5753     }
5754     \paper {
5755         interscoreline = 1
5756         \translator {
5757             \ScoreContext
5758             \remove "Bar_number_engraver"
5759         }
5760         \translator {
5761             \StaffContext
5762             \remove "Clef_engraver"
5763             \remove "Key_engraver"
5764             StaffSymbol \set #'transparent = ##t
5765             \remove "Time_signature_engraver"
5766             \remove "Bar_engraver"
5767             minimumVerticalExtent = ##f
5768         }
5769         \translator {
5770             \VoiceContext
5771             \remove Ligature_bracket_engraver
5772             \consists Vaticana_ligature_engraver
5773             NoteHead \set #'style = #'vaticana_punctum
5774             Stem \set #'transparent = ##t
5775         }
5776     }
5777 }
5778 @end lilypond
5779 @tab
5780 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5781 \include "gregorian-init.ly"
5782 \score {
5783     \notes \transpose c c' {
5784         % Torculus Auctus Descendens Initio Debilis
5785         \[ \deminutum a \pes b \flexa \auctum \descendens g \]
5786         s^\markup {"C"}
5787     }
5788     \paper {
5789         interscoreline = 1
5790         \translator {
5791             \ScoreContext
5792             \remove "Bar_number_engraver"
5793         }
5794         \translator {
5795             \StaffContext
5796             \remove "Clef_engraver"
5797             \remove "Key_engraver"
5798             StaffSymbol \set #'transparent = ##t
5799             \remove "Time_signature_engraver"
5800             \remove "Bar_engraver"
5801             minimumVerticalExtent = ##f
5802         }
5803         \translator {
5804             \VoiceContext
5805             \remove Ligature_bracket_engraver
5806             \consists Vaticana_ligature_engraver
5807             NoteHead \set #'style = #'vaticana_punctum
5808             Stem \set #'transparent = ##t
5809         }
5810     }
5811 }
5812 @end lilypond
5813 @tab
5814 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5815 \include "gregorian-init.ly"
5816 \score {
5817     \notes \transpose c c' {
5818         % Torculus Deminutus Initio Debilis
5819         \[ \deminutum a \pes b \flexa \deminutum g \]
5820         s^\markup {"D"}
5821     }
5822     \paper {
5823         interscoreline = 1
5824         \translator {
5825             \ScoreContext
5826             \remove "Bar_number_engraver"
5827         }
5828         \translator {
5829             \StaffContext
5830             \remove "Clef_engraver"
5831             \remove "Key_engraver"
5832             StaffSymbol \set #'transparent = ##t
5833             \remove "Time_signature_engraver"
5834             \remove "Bar_engraver"
5835             minimumVerticalExtent = ##f
5836         }
5837         \translator {
5838             \VoiceContext
5839             \remove Ligature_bracket_engraver
5840             \consists Vaticana_ligature_engraver
5841             NoteHead \set #'style = #'vaticana_punctum
5842             Stem \set #'transparent = ##t
5843         }
5844     }
5845 }
5846 @end lilypond
5847
5848 @item
5849 @code{12. Porrectus}
5850 @tab
5851 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5852 \include "gregorian-init.ly"
5853 \score {
5854     \notes \transpose c c' {
5855         % Porrectus
5856         \[ a \flexa g \pes b \]
5857         s^\markup {"E"}
5858     }
5859     \paper {
5860         interscoreline = 1
5861         \translator {
5862             \ScoreContext
5863             \remove "Bar_number_engraver"
5864         }
5865         \translator {
5866             \StaffContext
5867             \remove "Clef_engraver"
5868             \remove "Key_engraver"
5869             StaffSymbol \set #'transparent = ##t
5870             \remove "Time_signature_engraver"
5871             \remove "Bar_engraver"
5872             minimumVerticalExtent = ##f
5873         }
5874         \translator {
5875             \VoiceContext
5876             \remove Ligature_bracket_engraver
5877             \consists Vaticana_ligature_engraver
5878             NoteHead \set #'style = #'vaticana_punctum
5879             Stem \set #'transparent = ##t
5880         }
5881     }
5882 }
5883 @end lilypond
5884 @tab
5885 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5886 \include "gregorian-init.ly"
5887 \score {
5888     \notes \transpose c c' {
5889         % Porrectus Auctus Descendens
5890         \[ a \flexa g \pes \auctum \descendens b \]
5891         s^\markup {"F"}
5892     }
5893     \paper {
5894         interscoreline = 1
5895         \translator {
5896             \ScoreContext
5897             \remove "Bar_number_engraver"
5898         }
5899         \translator {
5900             \StaffContext
5901             \remove "Clef_engraver"
5902             \remove "Key_engraver"
5903             StaffSymbol \set #'transparent = ##t
5904             \remove "Time_signature_engraver"
5905             \remove "Bar_engraver"
5906             minimumVerticalExtent = ##f
5907         }
5908         \translator {
5909             \VoiceContext
5910             \remove Ligature_bracket_engraver
5911             \consists Vaticana_ligature_engraver
5912             NoteHead \set #'style = #'vaticana_punctum
5913             Stem \set #'transparent = ##t
5914         }
5915     }
5916 }
5917 @end lilypond
5918 @tab
5919 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5920 \include "gregorian-init.ly"
5921 \score {
5922     \notes \transpose c c' {
5923         % Porrectus Deminutus
5924         \[ a \flexa g \pes \deminutum b \]
5925         s^\markup {"G"}
5926     }
5927     \paper {
5928         interscoreline = 1
5929         \translator {
5930             \ScoreContext
5931             \remove "Bar_number_engraver"
5932         }
5933         \translator {
5934             \StaffContext
5935             \remove "Clef_engraver"
5936             \remove "Key_engraver"
5937             StaffSymbol \set #'transparent = ##t
5938             \remove "Time_signature_engraver"
5939             \remove "Bar_engraver"
5940             minimumVerticalExtent = ##f
5941         }
5942         \translator {
5943             \VoiceContext
5944             \remove Ligature_bracket_engraver
5945             \consists Vaticana_ligature_engraver
5946             NoteHead \set #'style = #'vaticana_punctum
5947             Stem \set #'transparent = ##t
5948         }
5949     }
5950 }
5951 @end lilypond
5952
5953 @item
5954 @code{13. Climacus}
5955 @tab
5956 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5957 \include "gregorian-init.ly"
5958 \score {
5959     \notes \transpose c c' {
5960         % Climacus
5961         \[ \virga b \inclinatum a \inclinatum g \]
5962         s^\markup {"H"}
5963     }
5964     \paper {
5965         interscoreline = 1
5966         \translator {
5967             \ScoreContext
5968             \remove "Bar_number_engraver"
5969         }
5970         \translator {
5971             \StaffContext
5972             \remove "Clef_engraver"
5973             \remove "Key_engraver"
5974             StaffSymbol \set #'transparent = ##t
5975             \remove "Time_signature_engraver"
5976             \remove "Bar_engraver"
5977             minimumVerticalExtent = ##f
5978         }
5979         \translator {
5980             \VoiceContext
5981             \remove Ligature_bracket_engraver
5982             \consists Vaticana_ligature_engraver
5983             NoteHead \set #'style = #'vaticana_punctum
5984             Stem \set #'transparent = ##t
5985         }
5986     }
5987 }
5988 @end lilypond
5989 @tab
5990 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5991 \include "gregorian-init.ly"
5992 \score {
5993     \notes \transpose c c' {
5994         % Climacus Auctus
5995         \[ \virga b \inclinatum a \inclinatum \auctum g \]
5996         s^\markup {"I"}
5997     }
5998     \paper {
5999         interscoreline = 1
6000         \translator {
6001             \ScoreContext
6002             \remove "Bar_number_engraver"
6003         }
6004         \translator {
6005             \StaffContext
6006             \remove "Clef_engraver"
6007             \remove "Key_engraver"
6008             StaffSymbol \set #'transparent = ##t
6009             \remove "Time_signature_engraver"
6010             \remove "Bar_engraver"
6011             minimumVerticalExtent = ##f
6012         }
6013         \translator {
6014             \VoiceContext
6015             \remove Ligature_bracket_engraver
6016             \consists Vaticana_ligature_engraver
6017             NoteHead \set #'style = #'vaticana_punctum
6018             Stem \set #'transparent = ##t
6019         }
6020     }
6021 }
6022 @end lilypond
6023 @tab
6024 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6025 \include "gregorian-init.ly"
6026 \score {
6027     \notes \transpose c c' {
6028         % Climacus Deminutus
6029         \[ \virga b \inclinatum a \inclinatum \deminutum g \]
6030         s^\markup {"J"}
6031     }
6032     \paper {
6033         interscoreline = 1
6034         \translator {
6035             \ScoreContext
6036             \remove "Bar_number_engraver"
6037         }
6038         \translator {
6039             \StaffContext
6040             \remove "Clef_engraver"
6041             \remove "Key_engraver"
6042             StaffSymbol \set #'transparent = ##t
6043             \remove "Time_signature_engraver"
6044             \remove "Bar_engraver"
6045             minimumVerticalExtent = ##f
6046         }
6047         \translator {
6048             \VoiceContext
6049             \remove Ligature_bracket_engraver
6050             \consists Vaticana_ligature_engraver
6051             NoteHead \set #'style = #'vaticana_punctum
6052             Stem \set #'transparent = ##t
6053         }
6054     }
6055 }
6056 @end lilypond
6057
6058 @item
6059 @code{14. Scandicus}
6060 @tab
6061 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6062 \include "gregorian-init.ly"
6063 \score {
6064     \notes \transpose c c' {
6065         % Scandicus
6066         \[ g \pes a \virga b \]
6067         s^\markup {"K"}
6068     }
6069     \paper {
6070         interscoreline = 1
6071         \translator {
6072             \ScoreContext
6073             \remove "Bar_number_engraver"
6074         }
6075         \translator {
6076             \StaffContext
6077             \remove "Clef_engraver"
6078             \remove "Key_engraver"
6079             StaffSymbol \set #'transparent = ##t
6080             \remove "Time_signature_engraver"
6081             \remove "Bar_engraver"
6082             minimumVerticalExtent = ##f
6083         }
6084         \translator {
6085             \VoiceContext
6086             \remove Ligature_bracket_engraver
6087             \consists Vaticana_ligature_engraver
6088             NoteHead \set #'style = #'vaticana_punctum
6089             Stem \set #'transparent = ##t
6090         }
6091     }
6092 }
6093 @end lilypond
6094 @tab
6095 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6096 \include "gregorian-init.ly"
6097 \score {
6098     \notes \transpose c c' {
6099         % Scandicus Auctus Descendens
6100         \[ g \pes a \pes \auctum \descendens b \]
6101         s^\markup {"L"}
6102     }
6103     \paper {
6104         interscoreline = 1
6105         \translator {
6106             \ScoreContext
6107             \remove "Bar_number_engraver"
6108         }
6109         \translator {
6110             \StaffContext
6111             \remove "Clef_engraver"
6112             \remove "Key_engraver"
6113             StaffSymbol \set #'transparent = ##t
6114             \remove "Time_signature_engraver"
6115             \remove "Bar_engraver"
6116             minimumVerticalExtent = ##f
6117         }
6118         \translator {
6119             \VoiceContext
6120             \remove Ligature_bracket_engraver
6121             \consists Vaticana_ligature_engraver
6122             NoteHead \set #'style = #'vaticana_punctum
6123             Stem \set #'transparent = ##t
6124         }
6125     }
6126 }
6127 @end lilypond
6128 @tab
6129 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6130 \include "gregorian-init.ly"
6131 \score {
6132     \notes \transpose c c' {
6133         % Scandicus Deminutus
6134         \[ g \pes a \pes \deminutum b \]
6135         s^\markup {"M"}
6136     }
6137     \paper {
6138         interscoreline = 1
6139         \translator {
6140             \ScoreContext
6141             \remove "Bar_number_engraver"
6142         }
6143         \translator {
6144             \StaffContext
6145             \remove "Clef_engraver"
6146             \remove "Key_engraver"
6147             StaffSymbol \set #'transparent = ##t
6148             \remove "Time_signature_engraver"
6149             \remove "Bar_engraver"
6150             minimumVerticalExtent = ##f
6151         }
6152         \translator {
6153             \VoiceContext
6154             \remove Ligature_bracket_engraver
6155             \consists Vaticana_ligature_engraver
6156             NoteHead \set #'style = #'vaticana_punctum
6157             Stem \set #'transparent = ##t
6158         }
6159     }
6160 }
6161 @end lilypond
6162
6163 @item
6164 @code{15. Salicus}
6165 @tab
6166 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6167 \include "gregorian-init.ly"
6168 \score {
6169     \notes \transpose c c' {
6170         % Salicus
6171         \[ g \oriscus a \pes \virga b \]
6172         s^\markup {"N"}
6173     }
6174     \paper {
6175         interscoreline = 1
6176         \translator {
6177             \ScoreContext
6178             \remove "Bar_number_engraver"
6179         }
6180         \translator {
6181             \StaffContext
6182             \remove "Clef_engraver"
6183             \remove "Key_engraver"
6184             StaffSymbol \set #'transparent = ##t
6185             \remove "Time_signature_engraver"
6186             \remove "Bar_engraver"
6187             minimumVerticalExtent = ##f
6188         }
6189         \translator {
6190             \VoiceContext
6191             \remove Ligature_bracket_engraver
6192             \consists Vaticana_ligature_engraver
6193             NoteHead \set #'style = #'vaticana_punctum
6194             Stem \set #'transparent = ##t
6195         }
6196     }
6197 }
6198 @end lilypond
6199 @tab
6200 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6201 \include "gregorian-init.ly"
6202 \score {
6203     \notes \transpose c c' {
6204         % Salicus Auctus Descendens
6205         \[ g \oriscus a \pes \auctum \descendens b \]
6206         s^\markup {"O"}
6207     }
6208     \paper {
6209         interscoreline = 1
6210         \translator {
6211             \ScoreContext
6212             \remove "Bar_number_engraver"
6213         }
6214         \translator {
6215             \StaffContext
6216             \remove "Clef_engraver"
6217             \remove "Key_engraver"
6218             StaffSymbol \set #'transparent = ##t
6219             \remove "Time_signature_engraver"
6220             \remove "Bar_engraver"
6221             minimumVerticalExtent = ##f
6222         }
6223         \translator {
6224             \VoiceContext
6225             \remove Ligature_bracket_engraver
6226             \consists Vaticana_ligature_engraver
6227             NoteHead \set #'style = #'vaticana_punctum
6228             Stem \set #'transparent = ##t
6229         }
6230     }
6231 }
6232 @end lilypond
6233 @tab
6234
6235 @item
6236 @code{16. Trigonus}
6237 @tab
6238 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6239 \include "gregorian-init.ly"
6240 \score {
6241     \notes \transpose c c' {
6242         % Trigonus
6243         \[ \stropha b \stropha b \stropha a \]
6244         s^\markup {"P"}
6245     }
6246     \paper {
6247         interscoreline = 1
6248         \translator {
6249             \ScoreContext
6250             \remove "Bar_number_engraver"
6251         }
6252         \translator {
6253             \StaffContext
6254             \remove "Clef_engraver"
6255             \remove "Key_engraver"
6256             StaffSymbol \set #'transparent = ##t
6257             \remove "Time_signature_engraver"
6258             \remove "Bar_engraver"
6259             minimumVerticalExtent = ##f
6260         }
6261         \translator {
6262             \VoiceContext
6263             \remove Ligature_bracket_engraver
6264             \consists Vaticana_ligature_engraver
6265             NoteHead \set #'style = #'vaticana_punctum
6266             Stem \set #'transparent = ##t
6267         }
6268     }
6269 }
6270 @end lilypond
6271 @tab
6272 @tab
6273
6274 @end multitable
6275
6276
6277 Unlike most other neumes notation systems, the input language for
6278 neumes does not necessarily reflect directly the typographical
6279 appearance, but is designed to solely focuse on musical meaning.  For
6280 example, @code{\[ a \pes b \flexa g \]} produces a Torculus consisting
6281 of three Punctum heads, while @code{\[ a \flexa g \pes b \]} produces
6282 a torculus with a curved flexa shape and only a single Punctum head.
6283 There is no command to explicitly typeset the curved flexa shape; the
6284 decision of when to typeset a curved flexa shape is purely taken from
6285 the musical input.  The idea of this approach is to separate the
6286 musical aspects of the input from the notation style of the output.
6287 This way, the same input can be reused to typeset the same music in a
6288 different style of Gregorian chant notation such as Hufnagel (also
6289 known as German gothic neumes) or Medicaea (kind of a very simple
6290 forerunner of the Editio Vaticana).  As soon as Hufnagel ligature
6291 engraver and Medicaea ligature engraver will have been implemented, it
6292 will be as simple as replacing the ligature engraver in the
6293 @internalsref{Voice} context to get the desired notation style from
6294 the same input.
6295
6296 The following table shows the code fragments that produce the
6297 ligatures in the above neumes table.  The letter in the first column
6298 in each line of the below table indicates to which ligature in the
6299 above table it refers.  The second column gives the name of the
6300 ligature.  The third column shows the code fragment that produces this
6301 ligature, using @code{g}, @code{a} and @code{b} as example pitches.
6302
6303 @multitable @columnfractions .1 .4 .5
6304
6305 @item
6306 @b{#} @tab
6307 @b{Name} @tab
6308 @b{Input Language}
6309
6310 @item
6311 a @tab
6312 Punctum @tab
6313 @code{\[ b \]}
6314
6315 @item
6316 b @tab
6317 Punctum Inclinatum @tab
6318 @code{\[ \inclinatum b \]}
6319
6320 @item
6321 c @tab
6322 Punctum Auctum Ascendens @tab
6323 @code{\[ \auctum \ascendens b \]}
6324
6325 @item
6326 d @tab
6327 Punctum Auctum Descendens @tab
6328 @code{\[ \auctum \descendens b \]}
6329
6330 @item
6331 e @tab
6332 Punctum Inclinatum Auctum @tab
6333 @code{\[ \inclinatum \auctum b \]}
6334
6335 @item
6336 f @tab
6337 Punctum Inclinatum Parvum @tab
6338 @code{\[ \inclinatum \deminutum b \]}
6339
6340 @item
6341 g @tab
6342 Virga @tab
6343 @code{\[ \virga b \]}
6344
6345 @item
6346 h @tab
6347 Stropha @tab
6348 @code{\[ \stropha b \]}
6349
6350 @item
6351 i @tab
6352 Stropha Aucta @tab
6353 @code{\[ \stropha \auctum b \]}
6354
6355 @item
6356 j @tab
6357 Oriscus @tab
6358 @code{\[ \oriscus b \]}
6359
6360 @item
6361 k @tab
6362 Clivis vel Flexa @tab
6363 @code{\[ b \flexa g \]}
6364
6365 @item
6366 l @tab
6367 Clivis Aucta Descendens @tab
6368 @code{\[ b \flexa \auctum \descendens g \]}
6369
6370 @item
6371 m @tab
6372 Clivis Aucta Ascendens @tab
6373 @code{\[ b \flexa \auctum \ascendens g \]}
6374
6375 @item
6376 n @tab
6377 Cephalicus @tab
6378 @code{\[ b \flexa \deminutum g \]}
6379
6380 @item
6381 o @tab
6382 Podatus vel Pes @tab
6383 @code{\[ g \pes b \]}
6384
6385 @item
6386 p @tab
6387 Pes Auctus Descendens @tab
6388 @code{\[ g \pes \auctum \descendens b \]}
6389
6390 @item
6391 q @tab
6392 Pes Auctus Ascendens @tab
6393 @code{\[ g \pes \auctum \ascendens b \]}
6394
6395 @item
6396 r @tab
6397 Epiphonus @tab
6398 @code{\[ g \pes \deminutum b \]}
6399
6400 @item
6401 s @tab
6402 Pes Quassus @tab
6403 @code{\[ \oriscus g \pes \virga b \]}
6404
6405 @item
6406 t @tab
6407 Pes Quassus Auctus Descendens @tab
6408 @code{\[ \oriscus g \pes \auctum \descendens b \]}
6409
6410 @item
6411 u @tab
6412 Quilisma Pes @tab
6413 @code{\[ \quilisma g \pes b \]}
6414
6415 @item
6416 v @tab
6417 Quilisma Pes Auctus Descendens @tab
6418 @code{\[ \quilisma g \pes \auctum \descendens b \]}
6419
6420 @item
6421 w @tab
6422 Pes Initio Debilis @tab
6423 @code{\[ \deminutum g \pes b \]}
6424
6425 @item
6426 x @tab
6427 Pes Auctus Descendens Initio Debilis @tab
6428 @code{\[ \deminutum g \pes \auctum \descendens b \]}
6429
6430 @item
6431 y @tab
6432 Torculus @tab
6433 @code{\[ a \pes b \flexa g \]}
6434
6435 @item
6436 z @tab
6437 Torculus Auctus Descendens @tab
6438 @code{\[ a \pes b \flexa \auctum \descendens g \]}
6439
6440 @item
6441 A @tab
6442 Torculus Deminutus @tab
6443 @code{\[ a \pes b \flexa \deminutum g \]}
6444
6445 @item
6446 B @tab
6447 Torculus Initio Debilis @tab
6448 @code{\[ \deminutum a \pes b \flexa g \]}
6449
6450 @item
6451 C @tab
6452 Torculus Auctus Descendens Initio Debilis @tab
6453 @code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}
6454
6455 @item
6456 D @tab
6457 Torculus Deminutus Initio Debilis @tab
6458 @code{\[ \deminutum a \pes b \flexa \deminutum g \]}
6459
6460 @item
6461 E @tab
6462 Porrectus @tab
6463 @code{\[ a \flexa g \pes b \]}
6464
6465 @item
6466 F @tab
6467 Porrectus Auctus Descendens @tab
6468 @code{\[ a \flexa g \pes \auctum \descendens b \]}
6469
6470 @item
6471 G @tab
6472 Porrectus Deminutus @tab
6473 @code{\[ a \flexa g \pes \deminutum b \]}
6474
6475 @item
6476 H @tab
6477 Climacus @tab
6478 @code{\[ \virga b \inclinatum a \inclinatum g \]}
6479
6480 @item
6481 I @tab
6482 Climacus Auctus @tab
6483 @code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}
6484
6485 @item
6486 J @tab
6487 Climacus Deminutus @tab
6488 @code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}
6489
6490 @item
6491 K @tab
6492 Scandicus @tab
6493 @code{\[ g \pes a \virga b \]}
6494
6495 @item
6496 L @tab
6497 Scandicus Auctus Descendens @tab
6498 @code{\[ g \pes a \pes \auctum \descendens b \]}
6499
6500 @item
6501 M @tab
6502 Scandicus Deminutus @tab
6503 @code{\[ g \pes a \pes \deminutum b \]}
6504
6505 @item
6506 N @tab
6507 Salicus @tab
6508 @code{\[ g \oriscus a \pes \virga b \]}
6509
6510 @item
6511 O @tab
6512 Salicus Auctus Descendens @tab
6513 @code{\[ g \oriscus a \pes \auctum \descendens b \]}
6514
6515 @item
6516 P @tab
6517 Trigonus @tab
6518 @code{\[ \stropha b \stropha b \stropha a \]}
6519
6520 @end multitable
6521
6522 @refbugs
6523
6524 Scandicus Deminutus: Punctum Auctum Ascendens overlaps with
6525 Semivocalis head; this looks awful.
6526
6527 Trigonus: apply equal spacing, regardless of pitch.
6528
6529 @node Figured bass
6530 @subsection Figured bass
6531
6532 @cindex Basso continuo
6533
6534 @c TODO: musicological blurb about FB
6535
6536 @syntax
6537
6538 LilyPond has limited support for figured bass:
6539
6540 @lilypond[verbatim,fragment]
6541 <
6542  \context Voice \notes { \clef bass dis4  c d ais}
6543  \context FiguredBass
6544    \figures {
6545     < 6 >4 < 7 >8 < 6+ [_!] >
6546     < 6 >4 <6 5 [3+] >
6547    }
6548  >
6549 @end lilypond
6550
6551 The support for figured bass consists of two parts: there is an input
6552 mode, introduced by @code{\figures}, where you can enter bass figures
6553 as numbers, and there is a context called @internalsref{FiguredBass}
6554 that takes care of making @internalsref{BassFigure} objects.
6555
6556 In figures input mode, a group of bass figures is delimited by
6557 @code{<} and @code{>}. The duration is entered after the @code{>}.
6558 @example
6559         <4 6>
6560 @end example
6561 @lilypond[fragment]
6562 \context FiguredBass
6563 \figures { <4 6> }
6564 @end lilypond
6565
6566 Accidentals are added when you append @code{-}, @code{!}  and @code{+}
6567 to the numbers.
6568
6569 @example
6570   <4- 6+ 7!>
6571 @end example
6572 @lilypond[fragment]
6573   \context FiguredBass
6574     \figures { <4- 6+ 7!> }
6575 @end lilypond
6576
6577 Spaces or dashes may be inserted by using @code{_}. Brackets are
6578 introduced with @code{[} and @code{]}.
6579
6580 @example
6581         < [4 6] 8 [_! 12]>
6582 @end example
6583 @lilypond[fragment]
6584  \context FiguredBass
6585 \figures { < [4 6] 8 [_! 12]> }
6586 @end lilypond
6587
6588 Although the support for figured bass may superficially resemble chord
6589 support, it works much simpler.  The @code{\figures} mode simply
6590 stores the numbers , and @internalsref{FiguredBass} context prints
6591 them as entered. There is no conversion to pitches, and no
6592 realizations of the bass are played in the MIDI file.
6593
6594 Internally, the code produces markup texts. You can use any of the
6595 markup text properties to override formatting. For example, the
6596 vertical spacing of the figures may be set with @code{baseline-skip}.
6597
6598 @seealso
6599
6600 @internalsref{BassFigureEvent} music, @internalsref{BassFigure} object,
6601 @internalsref{FiguredBass} context
6602
6603 @refbugs
6604
6605 Slash notation for alterations is not supported.
6606
6607
6608 @node Contemporary notation
6609 @section Contemporary notation
6610
6611 In the 20th century, composers have greatly expanded the musical
6612 vocabulary. With this expansion, many innovations in musical notation
6613 have been tried. For a comprehensive overview, refer to @cite{Stone
6614 1980} (see @ref{Literature}). In general, the use of new, innovative
6615 notation makes a piece harder to understand and perform and its use
6616 should therefore be avoided if possible.  For this reason, support for
6617 contemporary notation in LilyPond is limited.
6618
6619
6620 @menu
6621 * Clusters::                    
6622 * Fermatas::                    
6623 @end menu
6624
6625 @node Clusters
6626 @subsection Clusters
6627
6628 @cindex cluster
6629
6630 In musical terminology, a @emph{cluster} denotes a range of
6631 simultaneously sounding pitches that may change over time.  The set of
6632 available pitches to apply usually depends on the accoustic source.
6633 Thus, in piano music, a cluster typically consists of a continous range
6634 of the semitones as provided by the piano's fixed set of a chromatic
6635 scale.  In choral music, each singer of the choir typically may sing an
6636 arbitrary pitch within the cluster's range that is not bound to any
6637 diatonic, chromatic or other scale.  In electronic music, a cluster
6638 (theoretically) may even cover a continuous range of pitches, thus
6639 resulting in coloured noise, such as pink noise.
6640
6641 Clusters can be denoted in the context of ordinary staff notation by
6642 engraving simple geometrical shapes that replace ordinary notation of
6643 notes.  Ordinary notes as musical events specify starting time and
6644 duration of pitches; however, the duration of a note is expressed by the
6645 shape of the note head rather than by the horizontal graphical extent of
6646 the note symbol.  In contrast, the shape of a cluster geometrically
6647 describes the development of a range of pitches (vertical extent) over
6648 time (horizontal extent).  Still, the geometrical shape of a cluster
6649 covers the area in wich any single pitch contained in the cluster would
6650 be notated as an ordinary note.  From this point of view, it is
6651 reasonable to specify a cluster as the envelope of a set of notes.
6652
6653 @syntax
6654
6655 A cluster is engraved as the envelope of a set of
6656 cluster-notes. Cluster notes are created by applying the function
6657 @code{notes-to-clusters} to a sequence of chords, eg.
6658 @c
6659 @lilypond[relative 1,verbatim]
6660     \apply #notes-to-clusters {  <<c e >> <<b f'>>  }
6661 @end lilypond
6662
6663 The following example (from
6664 @inputfileref{input/regression,cluster.ly}) shows what the result
6665 looks like.
6666
6667 @lilypondfile[notexidoc]{cluster.ly}
6668
6669 By default, @internalsref{Cluster_engraver} is in the
6670 @internalsref{Voice} context.  This allows putting ordinary notes and
6671 clusters together in the same staff, even simultaneously.  In such a
6672 case no attempt is made to automatically avoid collisions between
6673 ordinary notes and clusters.
6674
6675 @seealso
6676
6677 @internalsref{ClusterSpanner}, @internalsref{ClusterSpannerBeacon},
6678 @inputfileref{input/regression,cluster.ly},
6679 @internalsref{Cluster_engraver}, @internalsref{ClusterNoteEvent}.
6680
6681 @refbugs
6682
6683 Music expressions like @code{< @{ g8 e8 @} a4 >} are not printed
6684 accurately.  Use @code{<<g a>>8 <<e a>>8} instead.
6685
6686
6687
6688 @node Fermatas
6689 @subsection Fermatas
6690
6691 @cindex fermatas
6692
6693
6694
6695 Contemporary music notation frequently uses special fermata symbols to
6696 indicate fermatas of differing lengths.
6697
6698 @syntax
6699
6700 The following are supported
6701
6702 @lilypond[singleline]
6703 \score {
6704   <  \addlyrics \notes {
6705         b'
6706         ^\shortfermata
6707         _\shortfermata
6708         r
6709         b'
6710         ^\fermata
6711         _\fermata
6712
6713         r
6714         b'
6715         ^\longfermata
6716         _\longfermata
6717
6718         r
6719         b'
6720         ^\verylongfermata
6721         _\verylongfermata
6722         r
6723     }
6724     \context Lyrics \lyrics {
6725       "shortfermata" "fermata"  "longfermata" "verylongfermata"
6726     } >
6727 }
6728 @end lilypond
6729
6730 See @ref{Articulations} for general instructions how to apply scripts
6731 such as fermatas to a @code{\notes@{@}} block.
6732
6733 @node Tuning output
6734 @section Tuning output
6735
6736 There are situations where default layout decisions are not
6737 sufficient.  In this section we discuss ways to override these
6738 defaults.
6739
6740 Formatting is internally done by manipulating so called objects
6741 (graphic objects). Each object carries with it a set of properties
6742 (object or layout properties) specific to that object.  For example, a
6743 stem object has properties that specify its direction, length and
6744 thickness.
6745
6746 The most direct way of tuning the output is by altering the values of
6747 these properties. There are two ways of doing that: first, you can
6748 temporarily change the definition of one type of object, thus
6749 affecting a whole set of objects.  Second, you can select one specific
6750 object, and set a layout property in that object.
6751
6752 Do not confuse layout properties with translation
6753 properties. Translation properties always use a mixed caps style
6754 naming, and are manipulated using @code{\property}
6755 @example
6756   \property Context.propertyName  = @var{value}
6757 @end example
6758 Layout properties are use Scheme style variable naming, i.e.  lower
6759 case words separated with dashes. They are symbols, and should always
6760 be quoted using @code{#'}.  For example, this could be an imaginary
6761 layout property name:
6762 @example
6763   #'layout-property-name
6764 @end example
6765
6766 @menu
6767 * Tuning objects ::             
6768 * Constructing a tweak::        
6769 * Applyoutput::                 
6770 * Outputproperty::              
6771 * Font selection::              
6772 * Text markup::                 
6773 @end menu
6774
6775
6776
6777 @node Tuning objects 
6778 @subsection Tuning objects 
6779
6780 @cindex object description
6781
6782 The definition of an object is a list of default object
6783 properties. For example, the definition of the Stem object (available
6784 in @file{scm/define-grobs.scm}), includes the following definitions
6785 for @internalsref{Stem}
6786
6787 @example
6788         (thickness . 1.3)
6789         (beamed-lengths . (0.0 2.5 2.0 1.5))
6790         (Y-extent-callback . ,Stem::height)
6791         @var{...}
6792 @end example
6793
6794
6795 Adding variables on top of this existing definition overrides the
6796 system default, and alters the resulting appearance of the layout
6797 object.
6798
6799 @syntax
6800
6801
6802 Changing a variable for only one object is commonly achieved with
6803 @code{\once}:
6804
6805 @example
6806 \once \property @var{context}.@var{objectname}
6807   \override @var{symbol} = @var{value}
6808 @end example
6809 Here @var{symbol} is a Scheme expression of symbol type, @var{context}
6810 and @var{objectname} is a string and @var{value} is a Scheme expression.
6811 This command applies a setting only during one moment in the score.
6812
6813 In the following example, only one @internalsref{Stem} object is
6814 changed from its original setting:
6815
6816 @lilypond[verbatim, fragment, relative=1]
6817   c4 
6818   \once \property Voice.Stem \set #'thickness = #4
6819   c4
6820   c4
6821 @end lilypond
6822 @cindex @code{\once}
6823
6824 For changing more objects, the same command, without @code{\once} can
6825 be used.
6826 @example
6827 \property @var{context}.@var{objectname} \override @var{symbol} = @var{value}
6828 @end example
6829 This command adds @code{@var{symbol} = @var{value}} to the definition
6830 of @var{objectname} in the context @var{context}, and this definition
6831 stays in place until it is removed.
6832
6833 An existing definition may be removed by the following command
6834 @c
6835 @example
6836 \property @var{context}.@var{objectname} \revert @var{symbol}
6837 @end example
6838 @c
6839 All @code{\override} and @code{\revert} commands should be balanced.
6840 The @code{\set} shorthand performs a revert followed by an override,
6841 and is often more convenient to use
6842
6843 @example
6844 \property @var{context}.@var{objectname} \set @var{symbol} = @var{value}
6845 @end example
6846
6847 Some examples: 
6848 @lilypond[verbatim,quote]
6849 c'4 \property Voice.Stem \override #'thickness = #4.0
6850 c'4
6851 c'4 \property Voice.Stem \revert #'thickness
6852 c'4
6853 @end lilypond
6854
6855 The following example gives exactly the same result as the previous
6856 one (assuming the system default for stem thickness is 1.3).
6857 @c
6858 @lilypond[verbatim,quote]
6859   c'4 \property Voice.Stem \set #'thickness = #4.0
6860   c'4
6861   c'4 \property Voice.Stem \set #'thickness = #1.3
6862   c'4
6863 @end lilypond
6864
6865 Reverting a setting which was not set in the first place has no
6866 effect. However, if the setting was set as a system default, this may
6867 remove the default value, and this may give surprising results,
6868 including crashes.  In other words, @code{\override} and
6869 @code{\revert} must be carefully balanced.  The following are examples
6870 of correct nesting of @code{\override}, @code{\set}, @code{\revert}.
6871
6872 @itemize @bullet
6873 @item
6874 A clumsy but correct form:
6875 @example
6876   \override \revert \override \revert \override \revert
6877 @end example
6878
6879 @item
6880 Shorter version of the same:
6881 @example 
6882   \override \set \set  \revert
6883 @end example
6884
6885 @item
6886 A short form, using only @code{\set}. This requires you to know the
6887 default value:
6888 @example
6889   \set \set \set \set @var{to default value}
6890 @end example
6891
6892 @item
6893 If there is no default (i.e. by default, the object property is unset),
6894 then you can use
6895 @example
6896   \set \set \set \revert
6897 @end example
6898 @end itemize
6899
6900 For the digirati, the object description is an Scheme association
6901 list. Since a Scheme list is a singly linked list, we can treat it as
6902 a stack, and @code{\override} and @code{\revert} are push and pop
6903 operations.  The association list is stored in a normal context
6904 property, hence
6905 @example
6906  \property Voice.NoteHead  = #'() 
6907 @end example
6908 will effectively erase @internalsref{NoteHead}s from the current
6909 @internalsref{Voice}. However, this mechanism is not guaranteed to
6910 work, and may cause crashes or other anomalous behavior.
6911
6912 @seealso
6913
6914 @internalsref{OverrideProperty}, @internalsref{RevertProperty},
6915 @internalsref{PropertySet}, @internalsref{backend properties},
6916 @internalsref{All layout objects}.
6917
6918
6919 @refbugs
6920
6921 The backend is not very strict in type-checking object properties.
6922 Cyclic references in @var{value} cause hangs and/or crashes.
6923 Similarly, reverting properties that are system defaults may also lead
6924 to crashes.
6925
6926 @node Constructing a tweak
6927 @subsection Constructing a tweak
6928
6929
6930 @cindex internal documentation
6931 @cindex finding graphical objects
6932 @cindex graphical object descriptions 
6933 @cindex tweaking
6934 @cindex @code{\override}
6935 @cindex @code{\set}
6936 @cindex internal documentation
6937
6938
6939
6940 Three pieces of information are required to use @code{\override} and
6941 @code{\set}: the name of the layout object, the context and the name
6942 of the property.  We demonstrate how to glean this information from
6943 the notation manual and the generated documentation.
6944
6945 The generated documentation is a set of HTML pages which should be
6946 included if you installed a binary distribution, typically in
6947 @file{/usr/share/doc/lilypond}.  They are also available on the web:
6948 go to the @uref{http://lilypond.org,LilyPond website}, click
6949 ``Documentation'', and then ``Program reference'' on the side bar. It
6950 is advisable to bookmark either the local HTML files if possible. They
6951 will load faster than the ones on the web.  If you use the version
6952 from the web, you must check whether the documentation matches the
6953 program version: the documentation is generated from the definitions
6954 that the program uses, and therefore it is strongly tied to the
6955 LilyPond version.
6956
6957
6958 @c  [TODO: revise for new site.]
6959
6960 Suppose we want to move the fingering indication in the fragment below
6961
6962 @lilypond[relative=2,verbatim]
6963 c-2
6964 \stemUp
6965 f
6966 @end lilypond
6967
6968 If you visit the documentation of @code{Fingering} (in @ref{Fingering
6969 instructions}), you will notice that it says
6970
6971 @quotation
6972 @seealso
6973
6974 @internalsref{FingerEvent} and @internalsref{Fingering}.
6975 @end quotation
6976
6977 @noindent
6978 In other words, the fingerings once entered, are internally stored as
6979 @code{FingerEvent} music objects. When printed, a @code{Fingering}
6980 layout object is created for every @code{FingerEvent}.
6981
6982 The Fingering object has a number of different functions, and each of
6983 those is captured in an interface.  when we look up
6984 @internalsref{Fingering} in the generated documentation.
6985
6986
6987
6988 The @code{Fingering} object has a fixed size
6989 (@internalsref{item-interface}), the symbol is a piece of text
6990 (@internalsref{text-interface}), whose font can be set
6991 (@internalsref{font-interface}).  It is centered horizontally
6992 (@internalsref{self-alignment-interface}), it is placed next to other
6993 objects (@internalsref{side-position-interface}) vertically, and its
6994 placement is coordinated with other scripts
6995 (@internalsref{text-script-interface}).  It also has the standard
6996 @internalsref{grob-interface} (grob stands for Graphical object)
6997 @cindex grob
6998 @cindex graphical object
6999 @cindex layout object
7000 @cindex object, layout 
7001 with all the variables that come with
7002 it.  Finally, it denotes a fingering instruction, so it has
7003 @internalsref{finger-interface}.
7004
7005 For the vertical placement, we have to look under
7006 @code{side-position-interface}.
7007 @quotation
7008 @code{side-position-interface}
7009
7010   Position a victim object (this one) next to other objects (the
7011   support).  In this case, the direction signifies where to put the
7012   victim object relative to the support (left or right, up or down?)
7013 @end quotation
7014 below this description, the variable @code{padding} is described as
7015 @quotation
7016 @table @code
7017 @item padding
7018  (dimension, in staff space)
7019
7020    add this much extra space between objects that are next to each
7021 other. Default value: @code{0.6}
7022 @end table
7023 @end quotation
7024
7025 By increasing the value of @code{padding}, we can move away the
7026 fingering.  The following command inserts 3 staff spaces of white
7027 between the note and the fingering
7028 @example
7029 \once \property Voice.Fingering \set #'padding = #3
7030 @end example
7031
7032 Inserting this command before the Fingering object is created,
7033 i.e. before @code{c2}, yields the following result.
7034
7035 @lilypond[relative=2,fragment,verbatim]
7036 \once \property Voice.Fingering
7037   \set #'padding = #3
7038 c-2
7039 \stemUp
7040 f
7041 @end lilypond
7042
7043 The context name @code{Voice} in the example above can be determined
7044 as follows. In the documentation for @internalsref{Fingering}, it says
7045 @quotation
7046 Fingering grobs are created by: @internalsref{Fingering_engraver}
7047 @end quotation
7048
7049 Clicking @code{Fingering_engraver} shows the documentation of
7050 the module responsible for interpreting the fingering instructions and
7051 translating them to a @code{Fingering} object.  Such a module is called
7052 an @emph{engraver}.  The documentation of the @code{Fingering_engraver}
7053 says
7054 @example
7055 Fingering_engraver is part of contexts: Voice 
7056 @end example
7057 so tuning the settings for Fingering should be done with
7058 @example
7059   \property Voice.Fingering \set @dots{}
7060 @end example
7061
7062 Of course, the tweak may also done in a larger context than
7063 @code{Voice}, for example, @internalsref{Staff} or
7064 @internalsref{Score}.
7065
7066 The internals document also contains alphabetical lists of
7067 @internalsref{All contexts}, @internalsref{All layout objects} and
7068 @internalsref{All music types}, so you can also find which objects to
7069 tweak by browsing the internals document.
7070
7071
7072 @node Applyoutput
7073 @subsection Applyoutput
7074
7075 The most versatile way of tuning an object is @code{\applyoutput}. Its
7076 syntax is
7077 @example
7078 \applyoutput @var{proc}
7079 @end example
7080
7081 @noindent
7082 where @var{proc} is a Scheme function, taking four arguments.
7083
7084 When interpreted, the function @var{proc} is called for every layout object found
7085 in the context, with the following arguments:
7086 @itemize @bullet
7087 @item the layout object itself
7088 @item the context where the layout object was created
7089 @item the context where @code{\applyoutput} is processed.
7090 @end itemize
7091
7092 In addition, the cause of the layout object, i.e.  the music
7093 expression or object that was responsible for creating it, is in the
7094 object property @code{cause}.  For example, for a note head, this is a
7095 @internalsref{NoteHead} event, and for a @internalsref{Stem} object,
7096 this is a @internalsref{NoteHead} object.
7097
7098
7099 @node Outputproperty
7100 @subsection Outputproperty
7101
7102 @cindex @code{\outputproperty}
7103
7104 Another way of tuning objects is the more arcane @code{\outputproperty}
7105 feature.  The syntax is as follows:
7106 @example
7107 \outputproperty @var{predicate} @var{symbol} = @var{value}
7108 @end example
7109 Here @code{predicate} is a Scheme function taking an object argument, and
7110 returning a boolean.  This statement is processed by the
7111 @code{Output_property_engraver}.  It instructs the engraver to feed all
7112 objects that it sees to @var{predicate}. Whenever the predicate returns
7113 true, the object property @var{symbol} will be set to @var{value}.
7114
7115 You will need to combine this statement with @code{\context} to select
7116 the appropriate context to apply this to.
7117 @inputfileref{input/regression,output-property.ly} shows an example of
7118 the use of @code{\outputproperty}.
7119
7120 @refbugs
7121
7122 This command is slated for removal.  Please use the
7123 @code{\applyoutput} command, see @ref{Applyoutput}.
7124
7125
7126 @node Font selection
7127 @subsection Font selection
7128
7129 The most common thing to change about the appearance of fonts is their
7130 size. The font size of any context can be easily changed by setting
7131 the @code{fontSize} property for that context.  Its value is an
7132 integer: negative numbers make the font smaller, positive numbers
7133 larger. An example is given below.
7134 @c
7135 @lilypond[fragment,relative=1,verbatim,quote]
7136   c4 c4 \property Voice.fontSize = #-1
7137   f4 g4
7138 @end lilypond
7139 This command will set @code{font-relative-size} (see below), and does
7140 not change the size of variable symbols, such as beams or slurs.
7141
7142
7143 One of the uses of @code{fontSize} is to get smaller symbol for cue
7144 notes. An elaborate example of those is in
7145 @inputfileref{input/test,cue-notes.ly}.
7146
7147 @cindex magnification
7148
7149 The size of the font may be scaled with the object property
7150 @code{font-magnification}.  For example, @code{2.0} blows up all
7151 letters by a factor 2 in both directions.
7152
7153
7154 @cindex cue notes
7155 @cindex font size
7156 @cindex size
7157 @cindex symbol size
7158 @cindex glyph size
7159
7160 The font used for printing a object can be selected by setting
7161 @code{font-name}, e.g.
7162 @example
7163   \property Staff.TimeSignature
7164     \set #'font-name = #"cmr17"
7165 @end example
7166
7167 @noindent
7168 Any font can be used, as long as it is available to @TeX{}. Possible
7169 fonts include foreign fonts or fonts that do not belong to the
7170 Computer Modern font family.
7171
7172 Font selection for the standard fonts, @TeX{}'s Computer Modern fonts,
7173 can also be adjusted with a more fine-grained mechanism.  By setting
7174 the object properties described below, you can select a different font.
7175 All three mechanisms work for every object that supports
7176 @code{font-interface}.
7177
7178 @table @code
7179 @item font-family
7180  A symbol indicating the general class of the typeface.  Supported are
7181 @code{roman} (Computer Modern), @code{braces} (for piano staff
7182 braces), @code{music} (the standard music font, including ancient
7183 glyphs), @code{dynamic} (for dynamic signs) and @code{typewriter}.
7184   
7185 @item font-shape
7186   A symbol indicating the shape of the font, there are typically several
7187   font shapes available for each font family. Choices are @code{italic},
7188   @code{caps} and @code{upright} 
7189
7190 @item font-series
7191 A  symbol indicating the series of the font. There are typically several
7192 font series for each font family and shape. Choices are @code{medium}
7193 and @code{bold}. 
7194
7195 @item font-relative-size
7196   A number indicating the size relative the standard size.  For example,
7197   with 20pt staff height, relative size -1  corresponds to 16pt staff
7198   height, and relative size +1 corresponds to 23 pt staff height.
7199
7200    There are small differences in design between fonts designed for
7201 different sizes, hence @code{font-relative-size} is preferred over
7202 @code{font-magnification} for changing font sizes.
7203
7204
7205 @item font-design-size
7206 A number indicating  the design size of the font. 
7207
7208 This is a feature of the Computer Modern Font: each point size has a
7209 slightly different design. Smaller design sizes are relatively wider,
7210 which enhances readability.
7211 @end table
7212
7213 For any of these properties, the value @code{*} (i.e. the symbol
7214 @code{*}, entered as @code{#'*}), acts as a wildcard. This can be used
7215 to override default setting, which are always present. For example:
7216 @example
7217   \property Lyrics . LyricText \override #'font-series = #'bold
7218   \property Lyrics . LyricText \override #'font-family = #'typewriter
7219   \property Lyrics . LyricText \override #'font-shape  = #'*
7220 @end example
7221
7222 @cindex @code{font-style}
7223
7224 @refcommands
7225
7226 The following commands set @code{fontSize} for the current voice.
7227
7228 @cindex @code{\tiny}
7229 @code{\tiny}, 
7230 @cindex @code{\small}
7231 @code{\small}, 
7232 @cindex @code{\normalsize}
7233 @code{\normalsize}, 
7234
7235 @refbugs
7236
7237 Relative size is not linked to any real size.
7238
7239 There is no style sheet provided for other fonts besides the @TeX{}
7240 family, and the style sheet cannot be modified easily.
7241
7242 @cindex font selection
7243 @cindex font magnification
7244 @cindex @code{font-interface}
7245
7246
7247 @node Text markup
7248 @subsection Text markup
7249 @cindex text markup
7250 @cindex markup text
7251
7252
7253 @cindex typeset text
7254
7255 LilyPond has an internal mechanism to typeset texts. You can access it
7256 with the keyword @code{\markup}. Within markup mode, you can enter texts
7257 similar to lyrics: simply enter them, surrounded by spaces. 
7258 @cindex markup
7259
7260 @lilypond[verbatim,fragment,relative=1]
7261  c1^\markup { hello }
7262  c1_\markup { hi there }
7263  c1^\markup { hi \bold there, is \italic anyone home? }
7264 @end lilypond
7265
7266 @cindex font switching
7267
7268 The markup in the example demonstrates font switching commands.  The
7269 command @code{\bold} and @code{\italic} only apply to the first
7270 following word; enclose a set of texts with braces to apply a command
7271 to more words.
7272 @example
7273   \markup @{ \bold @{ hi there @} @}
7274 @end example
7275
7276 @noindent
7277 For clarity, you can also do this for single arguments, e.g.
7278 @example
7279   \markup @{ is \italic @{ anyone @} home @}
7280 @end example
7281
7282 @cindex font size, texts
7283
7284 The following size commands set abolute sizes
7285
7286 @cindex @code{\teeny}
7287 @cindex @code{\tiny}
7288 @cindex @code{\small}
7289 @cindex @code{\large}
7290 @cindex @code{\huge}
7291
7292 @table @code
7293 @item \teeny
7294 @item \tiny
7295 @item \small
7296 @item \large
7297 @item \huge
7298 @end table
7299
7300 You can also make letter larger or smaller relative to their neighbors,
7301 with the commands @code{\larger} and @code{\smaller}.
7302 @cindex smaller
7303 @cindex larger
7304
7305 @cindex font style, for texts
7306 @cindex @code{\bold}
7307 @cindex @code{\dynamic}
7308 @cindex @code{\number}
7309 @cindex @code{\italic}
7310
7311 The following font change commands are defined:
7312 @table @code
7313 @item \dynamic
7314 This changes to the font used for dynamic signs.  This font does not
7315 contain all characters of the alphabet, so when producing ``piu f'',
7316 the ``piu'' should be done in a different font.
7317
7318
7319 @item \number
7320 This changes to the font used for time signatures. It only contains
7321 numbers and a few punctuation marks.
7322 @item \italic
7323 Changes @code{font-shape} to @code{italic}
7324 @item \bold
7325 Changes @code{font-series} to @code{bold}
7326 @end table
7327
7328 @cindex raising text
7329 @cindex lowering text
7330 @cindex moving text
7331 @cindex translating text
7332
7333 @cindex @code{\sub}
7334 @cindex @code{\super}
7335
7336 Raising and lowering texts can be done with @code{\super} and
7337 @code{\sub}.
7338
7339 @lilypond[verbatim,fragment,relative=1]
7340  c1^\markup { E "=" mc \super "2" }
7341 @end lilypond
7342
7343 @cindex @code{\raise}
7344
7345 If you want to give an explicit amount for lowering or raising, use
7346 @code{\raise}.  This command takes a Scheme valued first argument, and
7347 a markup object as second argument
7348 @c
7349 @lilypond[verbatim,fragment,relative=1,quote]
7350  c1^\markup { C \small \raise #1.0 \bold { "9/7+" }}
7351 @end lilypond
7352 The argument to @code{\raise} is the vertical displacement amount,
7353 measured in (global) staff spaces.
7354
7355 Other commands taking  single arguments include
7356 @table @code
7357
7358 @item \bracket, \hbracket
7359  Bracket the argument markup with normal and horizontal brackets
7360 respectively.
7361
7362 @item \musicglyph
7363 @cindex @code{\musicglyph}
7364   This is converted to a musical symbol, e.g. @code{\musicglyph
7365 #"accidentals-0"} will select the natural sign from the music font.
7366 See @ref{The Feta font} for  a complete listing of the possible glyphs.
7367 @item \char
7368 This produces a single character, e.g. @code{\char #65} produces the 
7369 letter 'A'.
7370
7371 @item \note  @var{log} @var{dots} @var{dir}
7372 @cindex @code{\note}
7373
7374 This produces a note with a stem pointing in @var{dir} direction, with
7375 duration log @var{log} and @var{dots} augmentation dots. The duration
7376 log is the negative 2-logarithm of the duration denominator. For
7377 example, a quarter note has log 2, an eighth note 3 and a breve has
7378 log -1.
7379
7380 @item \hspace #@var{amount}
7381 @cindex @code{\hspace}
7382 This produces a invisible object taking horizontal space.
7383 @example 
7384 \markup @{ A \hspace #2.0 B @} 
7385 @end example
7386 will put extra space between A and B, on top of the space that is
7387 normally inserted before elements on a line.
7388
7389 @item \fontsize #@var{size}
7390 @cindex @code{\fontsize}
7391 This sets the relative font size, eg.
7392 @example
7393 A \fontsize #2 @{ B C @} D
7394 @end example
7395
7396
7397 This will enlarge the B and the C by two steps.
7398 @item  \translate #(cons @var{x} @var{y})
7399 @cindex  \translate
7400 This translates an object. Its first argument is a cons of numbers
7401 @example
7402 A \translate #(cons 2 -3) @{ B C @} D
7403 @end example
7404 This moves `B C' 2 spaces to the right, and 3 down.
7405
7406 @item \magnify  #@var{mag}
7407 @cindex @code{\magnify}
7408 This sets the font magnification for the its argument. In the following
7409 example, the middle A will be 10% larger.
7410 @example
7411 A \magnify #1.1 @{ A @} A
7412 @end example
7413
7414
7415 @item \override #(@var{key} . @var{value})
7416 @cindex @code{\override}
7417 This overrides a  formatting property for its argument. The argument
7418 should be a key/value pair, e.g.
7419 @example
7420   m \override #'(font-family . math) m m
7421 @end example
7422 @end table
7423
7424 In markup mode you can compose expressions, similar to mathematical
7425 expressions, XML documents and music expressions.  The braces group
7426 notes into horizontal lines. Other types of lists also exist: you can
7427 stack expressions grouped with @code{<<}, and @code{>>} vertically with
7428 the command @code{\column}. Similarly, @code{\center} aligns texts by
7429 their center lines. 
7430
7431 @lilypond[verbatim,fragment,relative=1]
7432  c1^\markup { \column << a bbbb c >> }
7433  c1^\markup { \center << a bbbb c >> }
7434  c1^\markup { \line << a b c >> }
7435 @end lilypond
7436
7437 The markup mechanism is extensible.  Refer to
7438 @file{scm/new-markup.scm} for more information on extending the markup
7439 mode.
7440
7441
7442
7443 @seealso
7444
7445 @internalsref{Markup functions}, @file{scm/new-markup.scm}
7446
7447 @refbugs
7448
7449 @cindex kerning
7450
7451
7452 Text layout is ultimately done by @TeX{}, which does kerning of
7453 letters.  LilyPond does not account for kerning, so texts will be
7454 spaced slightly too wide.
7455
7456 Syntax errors for markup mode are confusing.
7457
7458
7459 @node Global layout
7460 @section Global layout
7461
7462 The global layout determined by three factors: the page layout, the
7463 line breaks and the spacing. These all influence each other. The
7464 choice of spacing determines how densely each system of music is set,
7465 which influences where line breaks breaks are chosen, and thus
7466 ultimately how many pages a piece of music takes. In this section, the
7467 algorithm for spacing music is explained, and how spacing can be
7468 tuned.
7469
7470 Globally spoken, this procedure happens in three steps: first,
7471 flexible distances (``springs'') are chosen, based on durations. All
7472 possible line breaking combination are tried, and the one with the
7473 best results---a layout that has uniform density and requires as
7474 little stretching or cramping as possible---is chosen. When the score
7475 is processed by @TeX{}, each page is filled with systems, and page breaks
7476 are chosen whenever the page gets full.
7477
7478
7479
7480 @menu
7481 * Vertical spacing::            
7482 * Horizontal spacing::          
7483 * Font Size::                   
7484 * Line breaking::               
7485 * Page layout::                 
7486 @end menu
7487
7488
7489 @node Vertical spacing
7490 @subsection Vertical spacing
7491
7492 @cindex vertical spacing
7493 @cindex distance between staves
7494 @cindex staff distance
7495 @cindex between staves, distance
7496 @cindex staffs per page
7497
7498
7499 The height of each system is determined automatically by lilypond, to
7500 keep systems from bumping into each other, some minimum distances are
7501 set.  By changing these, you can put staves closer together, and thus
7502 put more  systems onto one page.
7503
7504 Normally staves are stacked vertically. To make
7505 staves maintain a distance, their vertical size is padded. This is
7506 done with the property @code{minimumVerticalExtent}. It takes a pair
7507 of numbers, so if you want to make it smaller from its, then you could
7508 set
7509 @example
7510   \property Staff.minimumVerticalExtent = #'(-4 . 4)
7511 @end example
7512 This sets the vertical size of the current staff to 4 staff-space on
7513 either side of the center staff line.  The argument of
7514 @code{minimumVerticalExtent} is interpreted as an interval, where the
7515 center line is the 0, so the first number is generally negative.  The
7516 staff can be made larger at the bottom by setting it to @code{(-6
7517 . 4)}.
7518
7519 The piano staves are handled a little differently: to make cross-staff
7520 beaming work correctly, it necessary that the distance between staves
7521 is fixed beforehand.  This is also done with a
7522 @internalsref{VerticalAlignment} object, created in
7523 @internalsref{PianoStaff}. In this object the distance between the
7524 staves is fixed by setting @code{forced-distance}. If you want to
7525 override this, use a @code{\translator} block as follows:
7526 @example
7527   \translator @{
7528     \PianoStaffContext
7529     VerticalAlignment \override #'forced-distance = #9
7530   @}
7531 @end example
7532 This would bring the staves together at a distance of 9 staff spaces,
7533 measured from the center line of each staff.
7534
7535 @seealso
7536
7537 Vertical aligment of staves is handled by the
7538 @internalsref{VerticalAlignment} object.
7539
7540
7541
7542 @node Horizontal spacing
7543 @subsection Horizontal Spacing
7544
7545 The spacing engine translates differences in durations into
7546 stretchable distances (``springs'') of differing lengths. Longer
7547 durations get more space, shorter durations get less.  The shortest
7548 durations get a fixed amount of space (which is controlled by
7549 @code{shortest-duration-space} in the @internalsref{SpacingSpanner}
7550 object). The longer the duration, the more space it gets: doubling a
7551 duration adds a fixed amount (this amount is controlled by
7552 @code{spacing-increment}) of space to the note.
7553
7554 For example, the following piece contains lots of half, quarter and
7555 8th notes, the eighth note is followed by 1 note head width (NHW). 
7556 The quarter note is followed by 2 NHW, the half by 3 NHW, etc.
7557 @lilypond[fragment, verbatim, relative=1] c2 c4. c8 c4. c8 c4. c8 c8
7558 c8 c4 c4 c4
7559 @end lilypond
7560
7561 Normally, @code{shortest-duration-space} is set to 1.2, which is the
7562 width of a note head, and @code{shortest-duration-space} is set to
7563 2.0, meaning that the shortest note gets 2 NHW (2 times
7564 @code{shortest-duration-space}) of space. For normal notes, this space
7565 is always counted from the left edge of the symbol, so the shortest
7566 notes are generally followed by one NHW of space.
7567
7568 If one would follow the above procedure exactly, then adding a single
7569 32th note to a score that uses 8th and 16th notes, would widen up the
7570 entire score a lot. The shortest note is no longer a 16th, but a 32nd,
7571 thus adding 2 noteheads of space to every note. To prevent this, the
7572 shortest duration for spacing is not the shortest note in the score,
7573 but the most commonly found shortest note.  Notes that are even
7574 shorter this are followed by a space that is proportonial to their
7575 duration relative to the common shortest note.  So if we were to add
7576 only a few 16th notes to the example above, they would be followed by
7577 half a NHW:
7578
7579 @lilypond[fragment, verbatim, relative=2]
7580  c2 c4. c8 c4. c16-[ c-] c4. c8 c8 c8 c4 c4 c4
7581 @end lilypond
7582
7583 The most common shortest duration is determined as follows: in every
7584 measure, the shortest duration is determined. The most common short
7585 duration, is taken as the basis for the spacing, with the stipulation
7586 that this shortest duration should always be equal to or shorter than
7587 1/8th note. The shortest duration is printed when you run lilypond
7588 with @code{--verbose}.  These durations may also be customized. If you
7589 set the @code{common-shortest-duration} in
7590 @internalsref{SpacingSpanner}, then this sets the base duration for
7591 spacing. The maximum duration for this base (normally 1/8th), is set
7592 through @code{base-shortest-duration}.
7593
7594 @cindex @code{common-shortest-duration}
7595 @cindex @code{base-shortest-duration}
7596 @cindex @code{stem-spacing-correction}
7597 @cindex @code{spacing}
7598
7599 In the introduction it was explained that stem directions influence
7600 spacing. This is controlled with @code{stem-spacing-correction}
7601 property in @internalsref{NoteSpacing}, which are generated for every
7602 @internalsref{Voice} context. The @code{StaffSpacing} object
7603 (generated at @internalsref{Staff} context) contains the same property
7604 for controlling the stem/barline spacing. The following example
7605 shows these corrections, once with default settings, and once with
7606 exaggerated corrections.
7607
7608 @lilypond
7609     \score { \notes {
7610       c'4 e''4 e'4 b'4 |
7611       b'4 e''4 b'4 e''4|
7612       \property Staff.NoteSpacing \override #'stem-spacing-correction
7613       = #1.5
7614       \property Staff.StaffSpacing \override #'stem-spacing-correction
7615       = #1.5
7616       c'4 e''4 e'4 b'4 |
7617       b'4 e''4 b'4 e''4|      
7618     }
7619     \paper { raggedright = ##t } }
7620 @end lilypond
7621
7622 @cindex SpacingSpanner, overriding properties
7623
7624 Properties of the  @internalsref{SpacingSpanner} must be overridden
7625 from the @code{\paper} block, since the @internalsref{SpacingSpanner}
7626 is created before any @code{\property} statements are interpreted.
7627 @example
7628 \paper @{ \translator  @{
7629   \ScoreContext
7630   SpacingSpanner \override #'spacing-increment = #3.0
7631 @} @}
7632 @end example
7633
7634
7635 @seealso
7636
7637 @internalsref{SpacingSpanner}, @internalsref{NoteSpacing},
7638 @internalsref{StaffSpacing}, @internalsref{SeparationItem},
7639 @internalsref{SeparatingGroupSpanner}.
7640
7641 @refbugs
7642
7643 Spacing is determined on a score wide basis. If you have a score that
7644 changes its character (measured in durations) halfway during the
7645 score, the part containing the longer durations will be spaced too
7646 widely.
7647
7648 There is no convenient mechanism to manually override spacing.
7649
7650
7651
7652 @node Font Size
7653 @subsection Font size
7654 @cindex font size, setting
7655 @cindex staff size, setting
7656 @cindex @code{paper} file
7657
7658 The Feta font provides musical symbols at seven different sizes.
7659 These fonts are 11 point, 13 point, 16 point, 20 point, 23 point, and
7660 26 point.  The point size of a font is the height of the corresponding
7661 staff (excluding line thicknesses).
7662
7663 Definitions for these sizes are the files @file{paperSZ.ly}, where
7664 @code{SZ} is one of 11, 13, 16, 20, 23 and 26.  If you include any
7665 of these files, the variables @code{paperEleven},
7666 @code{paperThirteen}, @code{paperSixteen}, 
7667 @code{paperTwenty}, @code{paperTwentythree}, and @code{paperTwentysix}
7668 are defined respectively.  The default @code{\paper} block is also
7669 set. These files should be imported at toplevel, i.e.
7670 @example
7671         \include "paper26.ly"
7672         \score @{  ... @}
7673 @end example
7674
7675 The default font size settings for each staff heights are generated
7676 from the 20pt style sheet. For more details, see the file
7677 @file{scm/font.scm}.
7678 l
7679
7680
7681 @node Line breaking
7682 @subsection Line breaking
7683
7684 @cindex line breaks
7685 @cindex breaking lines
7686
7687 Line breaks are normally computed automatically. They are chosen such
7688 that lines look neither cramped nor loose, and that consecutive lines
7689 have similar density.
7690
7691 Occasionally you might want to override the automatic breaks; you can
7692 do this by  specifying @code{\break}. This will force a line break at
7693 this point.  Line breaks can only occur at places where there are bar
7694 lines.  If you want to have a line break where there is no bar line,
7695 you can force an invisible bar line by entering @code{\bar
7696 ""}. Similarly, @code{\noBreak} forbids a line break at a 
7697 point.
7698
7699
7700 @cindex regular line breaks
7701 @cindex four bar music. 
7702
7703 For linebreaks at regular intervals  use @code{\break} separated by
7704 skips and repeated with @code{\repeat}:
7705 @example
7706 <  \repeat unfold 7 @{ s1 * 4 \break  @}
7707    @emph{the real music}
7708
7709 @end  example
7710
7711 @noindent
7712 This makes the following 28 measures (assuming 4/4 time) be broken every
7713 4 measures.
7714
7715 @seealso
7716
7717 @internalsref{BreakEvent}
7718
7719
7720 @node Page layout
7721 @subsection Page layout
7722
7723 @cindex page breaks
7724 @cindex breaking pages
7725
7726 @cindex @code{indent}
7727 @cindex @code{linewidth}
7728
7729 The most basic settings influencing the spacing are @code{indent} and
7730 @code{linewidth}. They are set in the @code{\paper} block. They
7731 control the indentation of the first line of music, and the lengths of
7732 the lines.
7733
7734 If  @code{raggedright} is set to true in the @code{\paper}
7735 block, then the lines are justified at their natural length. This
7736 useful for short fragments, and for checking how tight the natural
7737 spacing is.
7738
7739 @cindex page layout
7740 @cindex vertical spacing
7741
7742 The page layout process happens outside the LilyPond formatting
7743 engine: variables controlling page layout are passed to the output,
7744 and are further interpreted by @code{ly2dvi}. @code{ly2dvi} responds
7745 to the following variables in the @code{\paper} block.  The variable
7746 @code{textheight} sets the total height of the music on each page.
7747 The spacing between systems is controlled with @code{interscoreline},
7748 its default is 16pt.  The distance between the score lines will
7749 stretch in order to fill the full page @code{interscorelinefill} is
7750 set to a positive number.  In that case @code{interscoreline}
7751 specifies the minimum spacing.
7752
7753 @cindex @code{textheight}
7754 @cindex @code{interscoreline}
7755 @cindex @code{interscorelinefill}
7756
7757 If the variable @code{lastpagefill} is defined,
7758 @c fixme: this should only be done if lastpagefill == #t 
7759 systems are evenly distributed vertically on the last page.  This
7760 might produce ugly results in case there are not enough systems on the
7761 last page.  The @command{lilypond-book} command ignores
7762 @code{lastpagefill}.  See @ref{lilypond-book manual} for more
7763 information.
7764
7765 @cindex @code{lastpagefill}
7766
7767 Page breaks are normally computed by @TeX{}, so they are not under
7768 direct control of LilyPond.  However, you can insert a commands into
7769 the @file{.tex} output to instruct @TeX{} where to break pages.  This
7770 is done by setting the @code{between-systems-strings} on the
7771 @internalsref{NonMusicalPaperColumn} where the system is broken.
7772 An example is shown in @inputfileref{input/regression,between-systems.ly}.
7773 The predefined command @code{\newpage} also does this.
7774
7775 @cindex paper size
7776 @cindex page size
7777 @cindex @code{papersize}
7778
7779 To change the paper size, you must first set the
7780 @code{papersize} paper variable variable.  Set it to
7781 the strings @code{a4}, @code{letter}, or @code{legal}.  After this
7782 specification, you must set the font as described above.  If you want
7783 the default font, then use the 20 point font.
7784
7785 @example
7786         \paper@{ papersize = "a4" @}
7787         \include "paper16.ly"
7788 @end example
7789
7790 The file @code{paper16.ly}  will now include a file named @file{a4.ly}, which
7791 will set the paper variables @code{hsize} and @code{vsize} (used by
7792 Lilypond and @code{ly2dvi})
7793
7794
7795 @refcommands
7796
7797 @cindex @code{\newpage}
7798 @code{\newpage}, 
7799
7800
7801 @seealso
7802
7803 @ref{Invoking ly2dvi},
7804 @inputfileref{input/regression,between-systems.ly},
7805 @internalsref{NonMusicalPaperColumn}.
7806
7807 @refbugs
7808
7809 LilyPond has no concept of page layout, which makes it difficult to
7810 reliably choose page breaks in longer pieces.
7811
7812
7813
7814
7815 @node Sound
7816 @section Sound
7817 @cindex Sound
7818
7819 Entered music can also be converted to MIDI output.  The performance
7820 is good enough for proof-hearing the music for errors.
7821
7822 Ties, dynamics and tempo changes are interpreted.  Dynamic marks,
7823 crescendi and decrescendi translate into MIDI volume levels.  Dynamic
7824 marks translate to a fixed fraction of the available MIDI volume
7825 range, crescendi and decrescendi make the volume vary linearly between
7826 their two extremities.  The fractions be adjusted by
7827 @code{dynamicAbsoluteVolumeFunction} in @internalsref{Voice} context.
7828 For each type of MIDI instrument, a volume range can be defined.  This
7829 gives a basic equalizer control, which can enhance the quality of
7830 the MIDI output remarkably.  The equalizer can be controlled by
7831 setting @code{instrumentEqualizer}.
7832
7833 @refbugs
7834
7835 Many musically interesting effects, such as swing, articulation,
7836 slurring, etc., are not translated to MIDI.
7837
7838
7839 @menu
7840 * MIDI block::                  
7841 * MIDI instrument names::       
7842 @end menu
7843
7844
7845 @node MIDI block
7846 @subsection MIDI block
7847 @cindex MIDI block
7848
7849
7850 The MIDI block is analogous to the paper block, but it is somewhat
7851 simpler.  The @code{\midi} block can contain:
7852 @cindex MIDI block
7853
7854 @itemize @bullet
7855   @item a @code{\tempo} definition
7856   @item context definitions
7857 @end itemize
7858
7859 Assignments in the @code{\midi} block are not allowed.
7860
7861
7862
7863 @cindex context definition
7864
7865 Context definitions follow precisely the same syntax as within the
7866 \paper block.  Translation modules for sound are called performers.
7867 The contexts for MIDI output are defined in @file{ly/performer-init.ly}.
7868
7869
7870 @node MIDI instrument names
7871 @subsection MIDI instrument names
7872
7873 @cindex instrument names
7874 @cindex @code{Staff.midiInstrument}
7875 @cindex @code{Staff.instrument}
7876
7877 The MIDI instrument name is set by the @code{Staff.midiInstrument}
7878 property or, if that property is not set, the @code{Staff.instrument}
7879 property.  The instrument name should be chosen from the list in
7880 @ref{MIDI instruments}.
7881
7882 @refbugs
7883
7884 If the selected string does not exactly match, then LilyPond uses the
7885 default (Grand Piano). It is not possible to select an instrument by
7886 number.
7887
7888