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