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