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