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