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