]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/instrument-notation.itely
Refine check-translation error message
[lilypond.git] / Documentation / user / instrument-notation.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
3 @ignore
4     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5
6     When revising a translation, copy the HEAD committish of the
7     version that you are working on.  See TRANSLATION for details.
8 @end ignore
9
10
11 @c A menu is needed before every deeper *section nesting of @node's; run
12 @c     M-x texinfo-all-menus-update
13 @c to automatically fill in these menus before saving changes
14
15 @node Instrument-specific notation
16 @chapter Instrument-specific notation
17
18 This chapter explains how to use notation for specific instruments.
19
20 @menu
21 * Piano music::                 
22 * Chord names::                 
23 * Vocal music::                 
24 * Rhythmic music::              
25 * Guitar::                      
26 * Bagpipe::                     
27 * Ancient notation::            
28 * Other instrument specific notation::  
29 @end menu
30
31
32
33 @node Piano music
34 @section Piano music
35
36 Piano staves are two normal staves coupled with a brace.  The staves
37 are largely independent, but sometimes voices can cross between the
38 two staves.  The same notation is also used for harps and other key
39 instruments.  The @internalsref{PianoStaff} is especially built to
40 handle this cross-staffing behavior.  In this section we discuss the
41 @internalsref{PianoStaff} and some other pianistic peculiarities.
42
43 @menu
44 * Automatic staff changes::     
45 * Manual staff switches::       
46 * Pedals::                      
47 * Staff switch lines::          
48 * Cross staff stems::           
49 @end menu
50
51 @refbugs
52
53 Dynamics are not centered, but workarounds do exist.  See the
54 @q{piano centered dynamics} template in @ref{Piano templates}.
55
56 @cindex cross staff stem
57 @cindex stem, cross staff
58 @cindex distance between staves in piano music
59
60
61 @node Automatic staff changes
62 @subsection Automatic staff changes
63 @cindex Automatic staff changes
64
65 Voices can be made to switch automatically between the top and the bottom
66 staff.  The syntax for this is
67
68 @quotation
69 @example
70 \autochange @dots{}@var{music}@dots{}
71 @end example
72 @end quotation
73
74 @noindent
75 This will create two staves inside the current PianoStaff, called
76 @code{up} and @code{down}.  The lower staff will be in bass clef by
77 default.
78
79 A @code{\relative} section that is outside of @code{\autochange} has
80 no effect on the pitches of @var{music}, so, if necessary, put
81 @code{\relative} inside @code{\autochange} like
82
83 @quotation
84 @example
85 \autochange \relative @dots{} @dots{}
86 @end example
87 @end quotation
88
89
90 The autochanger switches on basis of the pitch (middle C is the turning
91 point), and it looks ahead skipping over rests to switch in
92 advance.  Here is a practical example
93
94 @lilypond[quote,verbatim,ragged-right]
95 \new PianoStaff
96   \autochange \relative c'
97   {
98     g4 a b c d r4 a g
99   }
100 @end lilypond
101
102
103 @seealso
104
105 In this manual: @ref{Manual staff switches}.
106
107 Program reference: @internalsref{AutoChangeMusic}.
108
109
110
111 @refbugs
112
113 The staff switches may not end up in optimal places.  For high
114 quality output, staff switches should be specified manually.
115
116
117 @code{\autochange} cannot be inside @code{\times}.
118
119
120 @node Manual staff switches
121 @subsection Manual staff switches
122
123 @cindex manual staff switches
124 @cindex staff switch, manual
125
126 Voices can be switched between staves manually, using the command
127 @example
128 \change Staff = @var{staffname} @var{music}
129 @end example
130
131 @noindent
132 The string @var{staffname} is the name of the staff.  It switches the
133 current voice from its current staff to the Staff called
134 @var{staffname}.  Typically @var{staffname} is @code{"up"} or
135 @code{"down"}.  The @context{Staff} referred to must already exist, so
136 usually the setup for a score will start with a setup of the staves,
137
138 @example
139 <<
140   \new Staff = "up" @{
141     \skip 1 * 10  % @emph{keep staff alive}
142     @}
143   \new Staff = "down" @{
144     \skip 1 * 10  % @emph{idem}
145     @}
146 >>
147 @end example
148
149
150 and the @context{Voice} is inserted afterwards
151
152 @example
153 \context Staff = down
154   \new Voice @{ @dots{} \change Staff = up @dots{} @}
155 @end example
156
157
158 @node Pedals
159 @subsection Pedals
160 @cindex Pedals
161
162 Pianos have pedals that alter the way sound is produced.  Generally, a
163 piano has three pedals, sustain, una corda, and sostenuto.
164
165
166 Piano pedal instruction can be expressed by attaching
167 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
168 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
169 note or chord
170
171 @lilypond[quote,ragged-right,fragment,verbatim]
172 c'4\sustainDown c'4\sustainUp
173 @end lilypond
174
175 What is printed can be modified by setting @code{pedal@var{X}Strings},
176 where @var{X} is one of the pedal types: @code{Sustain},
177 @code{Sostenuto} or @code{UnaCorda}.  Refer to
178 @internalsref{SustainPedal} in the program reference for more
179 information.
180
181 Pedals can also be indicated by a sequence of brackets, by setting the
182 @code{pedalSustainStyle} property to bracket objects
183
184 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
185 \set Staff.pedalSustainStyle = #'bracket
186 c\sustainDown d e
187 b\sustainUp\sustainDown
188 b g \sustainUp a \sustainDown \bar "|."
189 @end lilypond
190
191 A third style of pedal notation is a mixture of text and brackets,
192 obtained by setting the @code{pedalSustainStyle} property to
193 @code{mixed}
194
195 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
196 \set Staff.pedalSustainStyle = #'mixed
197 c\sustainDown d e
198 b\sustainUp\sustainDown
199 b g \sustainUp a \sustainDown \bar "|."
200 @end lilypond
201
202 The default @q{*Ped.} style for sustain and damper pedals corresponds to
203 style @code{#'text}.  The sostenuto pedal uses @code{mixed} style by
204 default.
205
206 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
207 c\sostenutoDown d e c, f g a\sostenutoUp
208 @end lilypond
209
210 For fine-tuning the appearance of a pedal bracket, the properties
211 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
212 @code{PianoPedalBracket} objects (see
213 @internalsref{PianoPedalBracket} in the Program reference) can be
214 modified.  For example, the bracket may be extended to the right edge
215 of the note head
216
217 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
218 \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0)
219 c\sostenutoDown d e c, f g a\sostenutoUp
220 @end lilypond
221
222 @seealso
223
224 In this manual: @ref{Laissez vibrer ties}.
225
226 @node Staff switch lines
227 @subsection Staff switch lines
228
229
230 @cindex follow voice
231 @cindex staff switching
232 @cindex cross staff
233
234 @funindex followVoice
235
236 Whenever a voice switches to another staff, a line connecting the notes
237 can be printed automatically.  This is switched on by setting
238 @code{followVoice} to true
239
240 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
241 \new PianoStaff <<
242   \new Staff="one" {
243     \set followVoice = ##t
244     c1
245     \change Staff=two
246     b2 a
247   }
248   \new Staff="two" { \clef bass \skip 1*2 }
249 >>
250 @end lilypond
251
252 @seealso
253
254 Program reference: @internalsref{VoiceFollower}.
255
256 @refcommands
257
258 @funindex \showStaffSwitch
259 @code{\showStaffSwitch},
260 @funindex \hideStaffSwitch
261 @code{\hideStaffSwitch}.
262
263
264 @node Cross staff stems
265 @subsection Cross staff stems
266
267 Chords that cross staves may be produced by increasing the length
268 of the stem in the lower staff, so it reaches the stem in the upper
269 staff, or vice versa.
270
271 @lilypond[ragged-right,verbatim,quote]
272 stemExtend = {
273   \once \override Stem #'length = #10
274   \once \override Stem #'cross-staff = ##t
275 }
276 noFlag = \once \override Stem #'flag-style = #'no-flag
277 \new PianoStaff <<
278   \new Staff {
279     \stemDown \stemExtend
280     f'4
281     \stemExtend \noFlag
282     f'8
283   }
284   \new Staff {
285     \clef bass
286     a4 a8
287   }
288 >>
289 @end lilypond
290
291
292
293 @node Chord names
294 @section Chord names
295
296 @menu
297 * Introducing chord names::     
298 * Chords mode::                 
299 * Printing chord names::        
300 @end menu
301
302
303 @c  awkward name; awkward section name.
304 @c  still, the Basic "chords" seems like a good name...  :(
305 @node Introducing chord names
306 @subsection Introducing chord names
307 @cindex chord names
308
309 LilyPond has support for printing chord names.  Chords may be entered
310 in musical chord notation, i.e., @code{< .. >}, but they can also be
311 entered by name.  Internally, the chords are represented as a set of
312 pitches, so they can be transposed
313
314
315 @lilypond[quote,ragged-right,verbatim,ragged-right]
316 twoWays = \transpose c c' {
317   \chordmode {
318     c1 f:sus4 bes/f
319   }
320   <c e g>
321   <f bes c'>
322   <f bes d'>
323 }
324
325 << \new ChordNames \twoWays
326    \new Voice \twoWays >>
327 @end lilypond
328
329 This example also shows that the chord printing routines do not try to
330 be intelligent.  The last chord (@code{f bes d}) is not interpreted as
331 an inversion.
332
333 Note that the duration of chords must be specified outside the
334 @code{<>}.
335
336 @example
337 <c e g>2
338 @end example
339
340
341 @node Chords mode
342 @subsection Chords mode
343 @cindex Chords mode
344
345 In chord mode sets of pitches (chords) are entered with normal note
346 names.  A chord is entered by the root, which is entered like a
347 normal pitch
348
349 @lilypond[quote,ragged-right,fragment,verbatim]
350 \chordmode { es4. d8 c2 }
351 @end lilypond
352
353 @noindent
354 The mode is introduced by the keyword @code{\chordmode}.
355
356 @cindex chord entry
357 @cindex chord mode
358
359 Other chords may be entered by suffixing a colon and introducing a
360 modifier (which may include a number if desired)
361 @lilypond[quote,fragment,verbatim]
362 \chordmode { e1:m e1:7 e1:m7 }
363 @end lilypond
364 The first number following the root is taken to be the @q{type} of the
365 chord, thirds are added to the root until it reaches the specified
366 number
367 @lilypond[quote,fragment,verbatim]
368 \chordmode { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
369 @end lilypond
370
371 @cindex root of chord
372 @cindex additions, in chords
373 @cindex removals, in chords
374
375 More complex chords may also be constructed adding separate steps
376 to a chord.  Additions are added after the number following
377 the colon and are separated by dots
378 @lilypond[quote,verbatim,fragment]
379 \chordmode { c:5.6 c:3.7.8 c:3.6.13 }
380 @end lilypond
381 Chord steps can be altered by suffixing a @code{-} or @code{+} sign
382 to the number
383 @lilypond[quote,verbatim,fragment]
384 \chordmode { c:7+ c:5+.3- c:3-.5-.7- }
385 @end lilypond
386 Removals are specified similarly and are introduced by a caret.  They
387 must come after the additions
388 @lilypond[quote,verbatim,fragment]
389 \chordmode { c^3 c:7^5 c:9^3.5 }
390 @end lilypond
391
392 Modifiers can be used to change pitches.  The following modifiers are
393 supported
394
395 @table @code
396 @item m
397 The minor chord.  This modifier lowers the 3rd and (if present) the 7th step.
398
399 @item dim
400 The diminished chord.  This modifier lowers the 3rd, 5th and (if present)
401 the 7th step.
402
403 @item aug
404 The augmented chord.  This modifier raises the 5th step.
405
406 @item maj
407 The major 7th chord.  This modifier raises the 7th step if present.
408
409 @item sus
410 The suspended 4th or 2nd.  This modifier removes the 3rd
411 step.  Append either @code{2} or @code{4} to add the 2nd or 4th step to
412 the chord.
413 @end table
414
415 Modifiers can be mixed with additions
416 @lilypond[quote,verbatim,fragment]
417   \chordmode { c:sus4 c:7sus4 c:dim7 c:m6 }
418 @end lilypond
419
420 @cindex modifiers, in chords.
421 @funindex aug
422 @funindex dim
423 @funindex maj
424 @funindex sus
425 @funindex m
426
427 Since an unaltered 11 does not sound good when combined with an
428 unaltered 13, the 11 is removed in this case (unless it is added
429 explicitly)
430 @lilypond[quote,ragged-right,fragment,verbatim]
431 \chordmode { c:13 c:13.11 c:m13 }
432 @end lilypond
433
434 @funindex /
435
436 An inversion (putting one pitch of the chord on the bottom), as well
437 as bass notes, can be specified by appending
438 @code{/}@var{pitch} to the chord
439 @lilypond[quote,ragged-right,fragment,verbatim]
440 \chordmode { c1 c/g c/f }
441 @end lilypond
442 @funindex /+
443
444 A bass note can be added instead of transposed out of the chord,
445 by using @code{/+}@var{pitch}.
446
447 @lilypond[quote,ragged-right,fragment,verbatim]
448 \chordmode { c1 c/+g c/+f }
449 @end lilypond
450
451 Chords is a mode similar to @code{\lyricmode}, etc.  Most
452 of the commands continue to work, for example, @code{r} and
453 @code{\skip} can be used to insert rests and spaces, and property
454 commands may be used to change various settings.
455
456
457
458 @refbugs
459
460 Each step can only be present in a chord once.  The following
461 simply produces the augmented chord, since @code{5+} is interpreted
462 last
463 @cindex clusters
464 @lilypond[quote,ragged-right,verbatim,fragment]
465 \chordmode { c:5.5-.5+ }
466 @end lilypond
467
468
469 @node Printing chord names
470 @subsection Printing chord names
471
472 @cindex printing chord names
473 @cindex chord names
474 @cindex chords
475
476 For displaying printed chord names, use the @internalsref{ChordNames} context.
477 The chords may be entered either using the notation
478 described above, or directly using @code{<} and @code{>}
479
480 @lilypond[quote,verbatim,ragged-right]
481 harmonies = {
482   \chordmode {a1 b c} <d' f' a'> <e' g' b'>
483 }
484 <<
485   \new ChordNames \harmonies
486   \new Staff \harmonies
487 >>
488 @end lilypond
489
490 You can make the chord changes stand out by setting
491 @internalsref{ChordNames}.@code{chordChanges} to true.  This will only
492 display chord names when there is a change in the chords scheme and at
493 the start of a new line
494
495 @lilypond[quote,verbatim,ragged-right]
496 harmonies = \chordmode {
497   c1:m c:m \break c:m c:m d
498 }
499 <<
500   \new ChordNames {
501     \set chordChanges = ##t
502     \harmonies }
503   \new Staff \transpose c c' \harmonies
504 >>
505 @end lilypond
506
507 The previous examples all show chords over a staff.  This is not
508 necessary.  Chords may also be printed separately.  It may be necessary
509 to add @internalsref{Volta_engraver} and @internalsref{Bar_engraver}
510 for showing repeats.
511
512 @lilypond[ragged-right,verbatim]
513 \new ChordNames \with {
514   \override BarLine #'bar-size = #4
515   \consists Bar_engraver
516   \consists "Volta_engraver"
517 }
518 \chordmode { \repeat volta 2 {
519   f1:maj7 f:7 bes:7
520   c:maj7
521 } \alternative {
522   es e
523 }
524 }
525 @end lilypond
526
527
528 The default chord name layout is a system for Jazz music, proposed by
529 Klaus Ignatzek (see @ref{Literature list}).  It can be tuned through the
530 following properties
531
532 @table @code
533 @funindex chordNameExceptions
534 @item chordNameExceptions
535 This is a list that contains the chords that have special formatting.
536
537 The exceptions list should be encoded as
538 @example
539 @{ <c f g bes>1 \markup @{ \super "7" "wahh" @} @}
540 @end example
541
542 To get this information into @code{chordNameExceptions} takes a little
543 manoeuvring.  The following code transforms @code{chExceptionMusic}
544 (which is a sequential music) into a list of exceptions.
545 @example
546 (sequential-music-to-chord-exceptions chExceptionMusic #t)
547 @end example
548 Then,
549 @example
550 (append
551  (sequential-music-to-chord-exceptions chExceptionMusic #t)
552  ignatzekExceptions)
553 @end example
554 adds the new exceptions to the default ones, which are defined in
555 @file{ly/@/chord@/-modifier@/-init@/.ly}.
556
557 For an example of tuning this property, see also
558 @lsr{chords,chord@/-name@/-exceptions@/.ly}
559 @cindex exceptions, chord names.
560
561
562 @funindex majorSevenSymbol
563 @item majorSevenSymbol
564 This property contains the markup object used for the 7th step, when
565 it is major.  Predefined options are @code{whiteTriangleMarkup} and
566 @code{blackTriangleMarkup}.  See
567 @lsr{chords,chord@/-name@/-major7@/.ly} for an example.
568
569 @funindex chordNameSeparator
570 @item chordNameSeparator
571 Different parts of a chord name are normally separated by a
572 slash.  By setting @code{chordNameSeparator}, you can specify other
573 separators, e.g.,
574 @lilypond[quote,ragged-right,fragment,verbatim]
575 \new ChordNames \chordmode {
576   c:7sus4
577   \set chordNameSeparator
578     = \markup { \typewriter "|" }
579   c:7sus4
580 }
581 @end lilypond
582
583 @funindex chordRootNamer
584 @item chordRootNamer
585 The root of a chord is usually printed as a letter with an optional
586 alteration.  The transformation from pitch to letter is done by this
587 function.  Special note names (for example, the German @q{H} for a
588 B-chord) can be produced by storing a new function in this property.
589
590 @funindex chordNoteNamer
591 @item chordNoteNamer
592 The default is to print single pitch, e.g., the bass note, using the
593 @code{chordRootNamer}.  The @code{chordNoteNamer} property can be set
594 to a specialized function to change this behavior.  For example, the
595 base can be printed in lower case.
596
597 @funindex chordPrefixSpacer
598 @item chordPrefixSpacer
599 The @q{m} for minor chords is usually printed right after the root of
600 the chord. By setting @code{chordPrefixSpacer}, you can fix a spacer
601 between the root and @q{m}. The spacer is not used when the root
602 is altered.
603
604 @end table
605
606 The predefined variables @code{\germanChords},
607 @code{\semiGermanChords}, @code{\italianChords} and @code{\frenchChords}
608 set these variables.  The effect is
609 demonstrated here,
610
611 @lilypondfile[ragged-right]{chord-names-languages.ly}
612
613 There are also two other chord name schemes implemented: an alternate
614 Jazz chord notation, and a systematic scheme called Banter chords.  The
615 alternate Jazz notation is also shown on the chart in @ref{Chord name
616 chart}.  Turning on these styles is demonstrated in
617 @lsr{chords,chord-names-jazz.ly}.
618
619 @cindex Banter
620 @cindex jazz chords
621 @cindex chords, jazz
622
623
624 @refcommands
625
626 @funindex \germanChords
627 @code{\germanChords},
628 @funindex \semiGermanChords
629 @code{\semiGermanChords}.
630 @funindex \italianChords
631 @code{\italianChords}.
632 @funindex \frenchChords
633 @code{\frenchChords}.
634
635
636
637
638 @seealso
639
640 Examples:
641 @lsrdir{chords}
642
643 Init files: @file{scm/@/chords@/-ignatzek@/.scm}, and
644 @file{scm/@/chord@/-entry@/.scm}.
645
646
647 @refbugs
648
649 Chord names are determined solely from the list of pitches.  Chord
650 inversions are not identified, and neither are added bass notes.  This
651 may result in strange chord names when chords are entered with the
652 @code{< .. >} syntax.
653
654
655
656 @node Vocal music
657 @section Vocal music
658
659 Since LilyPond input files are text, there are two issues to
660 consider when working with vocal music:
661
662 @itemize @bullet
663 @item
664 Song texts must be entered as text, not notes.  For example, the
665 input@tie{}@code{d} should be interpreted as a one letter syllable, not the
666 note@tie{}D.
667
668 @item
669 Song texts must be aligned with the notes of their melody.
670 @end itemize
671
672 There are a few different ways to define lyrics; we shall begin
673 by examining the simplest method, and gradually increase complexity.
674
675 @menu
676 * Setting simple songs::        
677 * Entering lyrics::             
678 * Aligning lyrics to a melody::  
679 * Working with lyrics and identifiers::  
680 * Flexibility in placement::    
681 * Spacing lyrics::              
682 * More about stanzas::          
683 * Ambitus::                     
684 * Other vocal issues::          
685 @end menu
686
687
688 @commonprop
689
690 Checking to make sure that text scripts and lyrics are within the margins is
691 a relatively large computational task.  To speed up processing, lilypond does
692 not perform such calculations by default; to enable it, use
693
694 @example
695 \override Score.PaperColumn #'keep-inside-line = ##t
696 @end example
697
698 To make lyrics avoid barlines as well, use
699 @example
700 \layout @{
701   \context @{
702     \Lyrics
703       \consists "Bar_engraver"
704       \consists "Separating_line_group_engraver"
705       \override BarLine #'transparent = ##t
706   @}
707 @}
708 @end example
709
710
711 @node Setting simple songs
712 @subsection Setting simple songs
713
714 @cindex \addlyrics
715
716 The easiest way to add lyrics to a melody is to append
717
718 @example
719 \addlyrics @{ @var{the lyrics} @}
720 @end example
721
722 @noindent
723 to a melody.  Here is an example,
724
725 @lilypond[ragged-right,verbatim,fragment,quote]
726 \time 3/4
727 \relative { c2 e4 g2. }
728 \addlyrics { play the game }
729 @end lilypond
730
731 More stanzas can be added by adding more
732 @code{\addlyrics} sections
733
734 @lilypond[ragged-right,verbatim,fragment,quote]
735 \time 3/4
736 \relative { c2 e4 g2. }
737 \addlyrics { play the game }
738 \addlyrics { speel het spel }
739 \addlyrics { joue le jeu }
740 @end lilypond
741
742 The command @code{\addlyrics} cannot handle polyphony settings.  For these
743 cases you should use @code{\lyricsto} and @code{\lyricmode}, as will be
744 introduced in @ref{Entering lyrics}.
745
746
747
748 @node Entering lyrics
749 @subsection Entering lyrics
750
751 @cindex lyrics
752 @funindex \lyricmode
753 @cindex punctuation
754 @cindex spaces, in lyrics
755 @cindex quotes, in lyrics
756
757 Lyrics are entered in a special input mode, which can be introduced
758 by the keyword @code{\lyricmode}, or by using @code{\addlyrics} or
759 @code{\lyricsto}.  In this mode you can enter lyrics,
760 with punctuation and accents, and the input @code{d} is not parsed as
761 a pitch, but rather as a one letter syllable.  Syllables are entered
762 like notes, but with pitches replaced by text.  For example,
763
764 @example
765 \lyricmode @{ Twin-4 kle4 twin- kle litt- le star2 @}
766 @end example
767
768 There are two main methods to specify the horizontal placement
769 of the syllables, either by specifying the duration of each syllable
770 explicitly, like in the example above, or by automatically aligning
771 the lyrics to a melody or other voice of music, using @code{\addlyrics}
772 or @code{\lyricsto}.
773 @c  TODO: broken
774 @c For more details see @ref{The Lyrics context}.
775
776 A word or syllable of lyrics begins with an alphabetic character, and ends
777 with
778 any space or digit.  The following characters can be any character
779 that is not a digit or white space.
780
781 Any character that is not a digit or white space will be regarded as
782 part of the syllable; one important consequence of this is that a word
783 can end with @code{@}}, which often leads to the following mistake:
784
785 @example
786 \lyricmode @{ lah- lah@}
787 @end example
788
789 In this example, the @code{@}} is included in the final syllable, so the
790 opening brace is not balanced and the input file will probably not
791 compile.
792
793
794 @funindex \property in \lyricmode
795
796 @noindent
797 Similarly, a period which follows an alphabetic sequence is included in
798 the resulting string.  As a consequence, spaces must be inserted around
799 property commands: do @emph{not} write
800
801 @example
802 \override Score.LyricText #'font-shape = #'italic
803 @end example
804
805 @noindent
806 but instead use
807
808 @example
809 \override Score . LyricText #'font-shape = #'italic
810 @end example
811
812 @funindex _
813 @cindex spaces, in lyrics
814 @cindex quotes, in lyrics
815 @cindex ties, in lyrics
816
817 In order to assign more than one syllable to a single note, you can
818 surround them with quotes or use a @code{_} character, to get spaces
819 between syllables, or use tilde  symbol (@code{~}) to get a lyric tie.
820
821 @lilypond[quote,relative=2,ragged-right,fragment,verbatim]
822 \time 3/4
823 \relative { c2 e4 g2 e4 }
824 \addlyrics { gran- de_a- mi- go }
825 \addlyrics { pu- "ro y ho-" nes- to }
826 \addlyrics { pu- ro~y~ho- nes- to }
827 @end lilypond
828
829 The lyric ties is implemented with the Unicode character U+203F, so be
830 sure to have a font (Like DejaVuLGC) installed that includes this
831 glyph.
832
833
834 To enter lyrics with characters from non-English languages, or with
835 accented and special characters (such as the heart symbol or slanted quotes),
836 simply insert the characters directly into the input file and save
837 it with utf-8 encoding.  See @ref{Text encoding}, for more info.
838
839 @lilypond[quote,ragged-right,fragment,verbatim]
840 \relative { e4 f e d e f e2 }
841 \addlyrics { He said: “Let my peo ple go”. }
842 @end lilypond
843
844 To use normal quotes in lyrics, add a backslash before the
845 quotes.  For example,
846
847 @lilypond[quote,ragged-right,fragment,verbatim]
848 \relative c' { \time 3/4 e4 e4. e8 d4 e d c2. }
849 \addlyrics { "\"I" am so lone- "ly\"" said she }
850 @end lilypond
851
852 The full definition of a word start in Lyrics mode is somewhat more
853 complex.
854
855 A word in Lyrics mode begins with: an alphabetic character, @code{_},
856 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
857 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
858 any 8-bit character with ASCII code over 127, or a two-character
859 combination of a backslash followed by one of @code{`}, @code{'},
860 @code{"}, or @code{^}.
861
862 To define identifiers containing lyrics, the function @code{lyricmode}
863 must be used.
864
865 @example
866 verseOne = \lyricmode @{ Joy to the world the Lord is come @}
867 \score @{
868   <<
869     \new Voice = "one" \relative c'' @{
870       \autoBeamOff
871       \time 2/4
872       c4 b8. a16 g4. f8 e4 d c2
873     @}
874     \addlyrics @{ \verseOne @}
875   >>
876 @}
877 @end example
878
879
880 @seealso
881
882 Program reference: @internalsref{LyricText}, @internalsref{LyricSpace}.
883
884
885
886 @node Aligning lyrics to a melody
887 @subsection Aligning lyrics to a melody
888
889 @funindex \lyricmode
890 @funindex \addlyrics
891 @funindex \lyricsto
892
893
894 Lyrics are printed by interpreting them in the context called
895 @internalsref{Lyrics}.
896
897 @example
898 \new Lyrics \lyricmode @dots{}
899 @end example
900
901 There are two main methods to specify the horizontal placement
902 of the syllables:
903
904 @itemize @bullet
905 @item
906 by automatically aligning
907 the lyrics to a melody or other voice of music, using @code{\addlyrics}
908 or @code{\lyricsto}.
909
910 @item
911 or by specifying the duration of each syllable
912 explicitly, using @code{\lyricmode}
913 @end itemize
914
915 @menu
916 * Automatic syllable durations::  
917 * Another way of entering lyrics::  
918 * Assigning more than one syllable to a single note::  
919 * More than one note on a single syllable::  
920 * Extenders and hyphens::       
921 @end menu
922
923 @node Automatic syllable durations
924 @subsubsection Automatic syllable durations
925
926 @cindex automatic syllable durations
927 @cindex lyrics and melodies
928
929 The lyrics can be aligned under a given melody
930 automatically.  This is achieved by combining the
931 melody and the lyrics with the @code{\lyricsto} expression
932
933 @example
934 \new Lyrics \lyricsto @var{name} @dots{}
935 @end example
936
937 This aligns the lyrics to the
938 notes of the @internalsref{Voice} context called @var{name}, which must
939 already exist.  Therefore normally the @code{Voice} is specified first, and
940 then the lyrics are specified with @code{\lyricsto}.  The command
941 @code{\lyricsto} switches to @code{\lyricmode} mode automatically, so the
942 @code{\lyricmode} keyword may be omitted.
943
944 The following example uses different commands for entering lyrics.
945
946 @lilypond[quote,fragment,ragged-right,verbatim]
947 <<
948   \new Voice = "one" \relative c'' {
949     \autoBeamOff
950     \time 2/4
951     c4 b8. a16 g4. f8 e4 d c2
952   }
953   \new Lyrics \lyricmode { Joy4 to8. the16 world!4. the8 Lord4 is come.2 }
954   \new Lyrics \lyricmode { Joy to the earth! the Sa -- viour reigns. }
955   \new Lyrics \lyricsto "one" { No more let sins and sor -- rows grow. }
956 >>
957 @end lilypond
958
959 The second stanza is not properly aligned because the durations
960 were not specified.  A solution for that would be to use @code{\lyricsto}.
961
962 The @code{\addlyrics} command is actually just a convenient way
963 to write a more complicated LilyPond structure that sets up the
964 lyrics.
965
966 @example
967 @{ MUSIC @}
968 \addlyrics @{ LYRICS @}
969 @end example
970
971 @noindent
972 is the same as
973
974 @example
975 \new Voice = "blah" @{ music @}
976 \new Lyrics \lyricsto "blah" @{ LYRICS @}
977 @end example
978
979 @node Another way of entering lyrics
980 @subsubsection Another way of entering lyrics
981
982 Lyrics can also be entered without @code{\addlyrics} or
983 @code{\lyricsto}.  In this case,
984 syllables are entered like notes -- but with pitches replaced by text -- and the
985 duration of each syllable must be entered explicitly. For example:
986  
987 @example
988 play2 the4 game2.
989 sink2 or4 swim2.
990 @end example
991  
992 The alignment to a melody can be specified with the
993 @code{associatedVoice} property,
994  
995  @example
996 \set associatedVoice = #"lala"
997  @end example
998  
999  @noindent
1000 The value of the property (here: @code{"lala"}) should be the name of
1001 a @internalsref{Voice} context.  Without this setting, extender lines
1002 will not be formatted properly.
1003  
1004 Here is an example demonstrating manual lyric durations,
1005  
1006 @lilypond[relative=1,ragged-right,verbatim,fragment,quote]
1007 << \new Voice = "melody" {
1008     \time 3/4
1009     c2 e4 g2.
1010  }
1011  \new Lyrics \lyricmode {
1012    \set associatedVoice = #"melody"
1013    play2 the4 game2.
1014  } >>
1015 @end lilypond
1016
1017 @seealso
1018  
1019 Program reference: @internalsref{Lyrics}.
1020
1021
1022 @node Assigning more than one syllable to a single note
1023 @subsubsection Assigning more than one syllable to a single note
1024
1025
1026 @funindex _
1027 @cindex ties, in lyrics
1028
1029 In order to assign more than one syllable to a single note, you can
1030 surround them with quotes or use a @code{_} character, to get spaces
1031 between syllables, or use tilde  symbol (@code{~}) to get a lyric
1032 tie@footnote{The lyric ties is implemented with the Unicode character
1033 U+203F, so be
1034 sure to have a font (Like DejaVuLGC) installed that includes this
1035 glyph.}.
1036
1037 @lilypond[quote,relative=2,ragged-right,fragment,verbatim]
1038 \time 3/4
1039 \relative { c2 e4 g2 e4 }
1040 \addlyrics { gran- de_a- mi- go }
1041 \addlyrics { pu- "ro y ho-" nes- to }
1042 \addlyrics { pu- ro~y~ho- nes- to }
1043 @end lilypond
1044
1045 @seealso
1046
1047 Program reference: @internalsref{LyricCombineMusic}.
1048
1049 @c Here come the section which used to be "Melismata"
1050 @c the new title might be more self-explanatory
1051
1052
1053 @node More than one note on a single syllable
1054 @subsubsection More than one note on a single syllable
1055
1056 @cindex melisma
1057 @cindex melismata
1058 @cindex phrasing, in lyrics
1059
1060 Sometimes, particularly in Medieval music, several notes are to be sung on one
1061 single syllable; such vocalises are called melismas, or melismata.
1062
1063 @c this method seems to be the simplest; therefore
1064 @c it might be better to present it first - vv
1065
1066 You can define melismata entirely in the lyrics, by entering @code{_}
1067 for every note
1068 that is part of the melisma.
1069
1070 @lilypond[relative=1,verbatim,fragment,quote]
1071 { \set melismaBusyProperties = #'()
1072  c d( e) f f( e) e e  }
1073 \addlyrics
1074  { Ky -- _ _ ri __ _ _ _  e }
1075 @end lilypond
1076
1077 In this case, you can also have ties and slurs in the melody if you
1078 set @code{melismaBusyProperties}, as is done in the example above.
1079
1080 However, the @code{\lyricsto} command can also
1081 detect melismata automatically: it only puts one
1082 syllable under a tied or slurred group of notes.  If you want to force
1083 an unslurred group of notes to be a melisma, insert @code{\melisma}
1084 after the first note of the group, and @code{\melismaEnd} after the
1085 last one, e.g.,
1086
1087 @lilypond[quote,relative=2,ragged-right,fragment,verbatim]
1088 <<
1089   \new Voice = "lala" {
1090     \time 3/4
1091     f4 g8
1092     \melisma
1093     f e f
1094     \melismaEnd
1095     e2
1096   }
1097   \new Lyrics \lyricsto "lala" {
1098     la di __ daah
1099   }
1100 >>
1101 @end lilypond
1102
1103 In addition, notes are considered a melisma if they are manually
1104 beamed, and automatic beaming (see @ref{Setting automatic beam
1105 behavior}) is switched off.
1106
1107 @c TODO: there might be some more relevant place for 
1108 @c the following link (?)
1109
1110 @cindex SATB
1111 @cindex choral score
1112
1113 A complete example of a SATB score setup is in section
1114 @ref{Vocal ensembles}.
1115
1116
1117 @refcommands
1118
1119 @code{\melisma}, @code{\melismaEnd}
1120 @funindex \melismaEnd
1121 @funindex \melisma
1122
1123 @seealso
1124
1125 Program reference: @internalsref{Melisma_translator}.
1126
1127 @lsr{vocal,lyric@/-combine.ly}.
1128
1129 @refbugs
1130
1131 Melismata are not detected automatically, and extender lines must be
1132 inserted by hand.
1133
1134 @node Extenders and hyphens
1135 @subsubsection Extenders and hyphens
1136
1137 @cindex melisma
1138 @cindex extender
1139
1140 Melismata are indicated with a horizontal line centered between a syllable
1141 and the next one.  Such a line is called an extender line, and it is entered
1142 as @samp{ __ } (note the spaces before and after the two underscore
1143 characters).
1144
1145 @cindex hyphens
1146
1147 Centered hyphens are entered as @samp{ -- } between syllables of a same word
1148 (note the spaces before and after the two hyphen characters).  The hyphen
1149 will be centered between the syllables, and its length will be adjusted
1150 depending on the space between the syllables.
1151
1152 In tighly engraved music, hyphens can be removed.  Whether this
1153 happens can be controlled with the @code{minimum-distance} (minimum
1154 distance between two syllables) and the @code{minimum-length}
1155 (threshold below which hyphens are removed).
1156
1157 @seealso
1158
1159 Program reference: @internalsref{LyricExtender},
1160 @internalsref{LyricHyphen}
1161
1162
1163 @node Working with lyrics and identifiers
1164 @subsection Working with lyrics and identifiers
1165 @cindex lyrics, identifiers
1166
1167 To define identifiers containing lyrics, the function @code{\lyricmode}
1168 must be used. You do not have to enter durations though, if you add
1169 @code{\addlyrics} or @code{\lyricsto}
1170 when invoking your identifier.
1171  
1172 @example
1173 verseOne = \lyricmode @{ Joy to the world the Lord is come @}
1174 \score @{
1175  <<
1176    \new Voice = "one" \relative c'' @{
1177      \autoBeamOff
1178      \time 2/4
1179      c4 b8. a16 g4. f8 e4 d c2
1180    @}
1181    \addlyrics @{ \verseOne @}
1182  >>
1183 @}
1184 @end example
1185  
1186 @c TODO: Move the following section to 
1187 @c "Working with lyrics and identifiers"
1188  
1189 For different or more complex orderings, the best way is to setup the
1190 hierarchy of staves and lyrics first, e.g.,
1191 @example
1192 \new ChoirStaff <<
1193   \new Voice = "soprano" @{ @emph{music} @}
1194   \new Lyrics = "sopranoLyrics" @{ s1 @}
1195   \new Lyrics = "tenorLyrics" @{ s1 @}
1196   \new Voice = "tenor" @{ @emph{music} @}
1197 >>
1198 @end example
1199  
1200 and then combine the appropriate melodies and lyric lines
1201  
1202 @example
1203 \context Lyrics = sopranoLyrics \lyricsto "soprano"
1204 @emph{the lyrics}
1205 @end example
1206  
1207 @noindent
1208
1209 The final input would resemble
1210  
1211 @example
1212 <<\new ChoirStaff << @emph{setup the music} >>
1213  \lyricsto "soprano" @emph{etc}
1214  \lyricsto "alto" @emph{etc}
1215 @emph{etc}
1216 >>
1217 @end example
1218  
1219 @seealso
1220  
1221 @c TODO: document \new Staff << Voice \lyricsto >> bug
1222 Program reference: @internalsref{LyricCombineMusic},
1223 @internalsref{Lyrics}.  
1224
1225 @node Flexibility in placement
1226 @subsection Flexibility in placement
1227
1228 Often, different stanzas of one song are put to one melody in slightly
1229 differing ways.  Such variations can still be captured with
1230 @code{\lyricsto}.
1231
1232 @menu
1233 * Lyrics to multiple notes of a melisma::  
1234 * Divisi lyrics::               
1235 * Switching the melody associated with a lyrics line::  
1236 * Lyrics independent of notes::  
1237 @end menu
1238
1239 @node Lyrics to multiple notes of a melisma
1240 @subsubsection Lyrics to multiple notes of a melisma
1241
1242
1243 One possibility is that the text has a melisma in one stanza, but
1244 multiple syllables in another one.  One solution is to make the faster
1245 voice ignore the melisma.  This is done by setting
1246 @code{ignoreMelismata} in the Lyrics context.
1247
1248 There is one tricky aspect: the setting for @code{ignoreMelismata}
1249 must be set one syllable @emph{before} the non-melismatic syllable
1250 in the text, as shown here,
1251
1252 @c  FIXME: breaks compile
1253 @lilypond[verbatim,ragged-right,quote]
1254 %{
1255 <<
1256   \relative \new Voice = "lahlah" {
1257     \set Staff.autoBeaming = ##f
1258     c4
1259     \slurDotted
1260     f8.[( g16])
1261     a4
1262   }
1263   \new Lyrics \lyricsto "lahlah" {
1264     more slow -- ly
1265   }
1266   \new Lyrics \lyricsto "lahlah" {
1267     \set ignoreMelismata = ##t % applies to "fas"
1268     go fas -- ter
1269     \unset ignoreMelismata
1270     still
1271   }
1272 >>
1273 %}
1274 @end lilypond
1275
1276
1277 The @code{ignoreMelismata} applies to the syllable @q{fas}, so it
1278 should be entered before @q{go}.
1279
1280 The reverse is also possible: making a lyric line slower than the
1281 standard.  This can be achieved by insert @code{\skip}s into the
1282 lyrics.  For every @code{\skip}, the text will be delayed another note.
1283 For example,
1284
1285 @lilypond[verbatim,ragged-right,quote]
1286 \relative { c c g' }
1287 \addlyrics {
1288   twin -- \skip 4
1289   kle
1290 }
1291 @end lilypond
1292
1293
1294 @node Divisi lyrics
1295 @subsubsection Divisi lyrics
1296
1297 You can display alternate (or divisi) lyrics by naming voice
1298 contexts and attaching lyrics to those specific contexts.
1299
1300 @lilypond[verbatim,ragged-right,quote]
1301 \score{ <<
1302   \new Voice = "melody" {
1303     \relative c' {
1304       c4
1305       <<
1306         { \voiceOne c8 e }
1307         \new Voice = "splitpart" { \voiceTwo c4 }
1308       >>
1309       \oneVoice c4 c | c
1310     }
1311   }
1312   \new Lyrics \lyricsto "melody" { we shall not o- ver- come }
1313   \new Lyrics \lyricsto "splitpart" { will }
1314 >> }
1315 @end lilypond
1316
1317
1318 You can use this trick to display different lyrics for a repeated
1319 section.
1320
1321 @lilypond[verbatim,ragged-right,quote]
1322 \score{ <<
1323   \new Voice = "melody" \relative c' {
1324     c2 e | g e | c1 |
1325     \new Voice = "verse" \repeat volta 2 {c4 d e f | g1 | }
1326     a2 b | c1}
1327   \new Lyrics = "mainlyrics" \lyricsto melody \lyricmode {
1328     do mi sol mi do
1329     la si do }
1330   \context Lyrics = "mainlyrics" \lyricsto verse \lyricmode {
1331    do re mi fa sol }
1332   \new Lyrics = "repeatlyrics" \lyricsto verse \lyricmode {
1333    dodo rere mimi fafa solsol }
1334 >>
1335 }
1336 @end lilypond
1337
1338
1339
1340 @node Switching the melody associated with a lyrics line
1341 @subsubsection Switching the melody associated with a lyrics line
1342
1343 More complex variations in text underlay are possible.  It is possible
1344 to switch the melody for a line of lyrics during the text.  This is
1345 done by setting the @code{associatedVoice} property.  In the example
1346
1347 @lilypond[ragged-right,quote]
1348 <<
1349   \relative \new Voice = "lahlah" {
1350     \set Staff.autoBeaming = ##f
1351     c4
1352     <<
1353       \new Voice = "alternative" {
1354         \voiceOne
1355         \times 2/3 {
1356           % show associations clearly.
1357           \override NoteColumn #'force-hshift = #-3
1358           f8 f g
1359         }
1360       }
1361       {
1362         \voiceTwo
1363         f8.[ g16]
1364         \oneVoice
1365       } >>
1366     a8( b) c
1367   }
1368   \new Lyrics \lyricsto "lahlah" {
1369     Ju -- ras -- sic Park
1370   }
1371   \new Lyrics \lyricsto "lahlah" {
1372     % Tricky: need to set associatedVoice
1373     % one syllable too soon!
1374     \set associatedVoice = alternative % applies to "ran"
1375     Ty --
1376     ran --
1377     no --
1378     \set associatedVoice = lahlah % applies to "rus"
1379     sau -- rus Rex
1380   } >>
1381 @end lilypond
1382
1383 @noindent
1384 the text for the first stanza is set to a melody called @q{lahlah},
1385
1386 @example
1387 \new Lyrics \lyricsto "lahlah" @{
1388   Ju -- ras -- sic Park
1389 @}
1390 @end example
1391
1392
1393 The second stanza initially is set to the @code{lahlah} context, but
1394 for the syllable @q{ran}, it switches to a different melody.
1395 This is achieved with
1396 @example
1397 \set associatedVoice = alternative
1398 @end example
1399
1400 @noindent
1401 Here, @code{alternative} is the name of the @code{Voice} context
1402 containing the triplet.
1403
1404 Again, the command must be one syllable too early, before @q{Ty} in
1405 this case.
1406
1407 @example
1408 \new Lyrics \lyricsto "lahlah" @{
1409   \set associatedVoice = alternative % applies to "ran"
1410   Ty --
1411   ran --
1412   no --
1413   \set associatedVoice = lahlah % applies to "rus"
1414   sau -- rus Rex
1415 @}
1416 @end example
1417
1418 @noindent
1419 The underlay is switched back to the starting situation by assigning
1420 @code{lahlah} to @code{associatedVoice}.
1421
1422
1423 @node Lyrics independent of notes
1424 @subsubsection Lyrics independent of notes
1425
1426 In some complex vocal music, it may be desirable to place
1427 lyrics completely independently of notes.  Music defined
1428 inside @code{lyricrhythm} disappears into the
1429 @code{Devnull} context, but the rhythms can still be used
1430 to place the lyrics.
1431
1432 @lilypond[quote,verbatim,ragged-right]
1433 voice = {
1434   c''2
1435   \tag #'music { c''2 }
1436   \tag #'lyricrhythm { c''4. c''8 }
1437   d''1
1438 }
1439
1440 lyr = \lyricmode { I like my cat! }
1441
1442 <<
1443   \new Staff \keepWithTag #'music \voice
1444   \new Devnull="nowhere" \keepWithTag #'lyricrhythm \voice
1445   \new Lyrics \lyricsto "nowhere" \lyr
1446   \new Staff { c'8 c' c' c' c' c' c' c'
1447   c' c' c' c' c' c' c' c' }
1448 >>
1449 @end lilypond
1450
1451
1452 @node Spacing lyrics
1453 @subsection Spacing lyrics
1454
1455 @cindex Spacing lyrics
1456 @cindex Lyrics, increasing space between
1457
1458 To increase the spacing between lyrics, set the minimum-distance property of
1459 LyricSpace.
1460
1461 @lilypond[relative,verbatim,fragment,quote,ragged-right]
1462 {
1463   c c c c
1464   \override Lyrics.LyricSpace #'minimum-distance = #1.0
1465   c c c c
1466 }
1467 \addlyrics {
1468   longtext longtext longtext longtext
1469   longtext longtext longtext longtext
1470 }
1471 @end lilypond
1472
1473 To make this change for all lyrics in the score, set the property in the
1474 layout.
1475
1476 @lilypond[relative,verbatim,quote,ragged-right]
1477 \score {
1478   \relative c' {
1479   c c c c
1480   c c c c
1481   }
1482   \addlyrics {
1483   longtext longtext longtext longtext
1484   longtext longtext longtext longtext
1485   }
1486   \layout {
1487     \context {
1488       \Lyrics
1489       \override LyricSpace #'minimum-distance = #1.0
1490     }
1491   }
1492 }
1493 @end lilypond
1494
1495
1496 @node More about stanzas
1497 @subsection More about stanzas
1498
1499 @cindex stanza number
1500 @subsubsection Adding stanza numbers 
1501
1502 Stanza numbers can be added by setting @code{stanza}, e.g.,
1503
1504 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
1505 \new Voice {
1506   \time 3/4 g2 e4 a2 f4 g2.
1507 } \addlyrics {
1508   \set stanza = "1. "
1509   Hi, my name is Bert.
1510 } \addlyrics {
1511   \set stanza = "2. "
1512   Oh, che -- ri, je t'aime
1513 }
1514 @end lilypond
1515
1516 @noindent
1517 These numbers are put just before the start of the first syllable.
1518
1519
1520 @subsubsection Adding dynamics marks
1521
1522 Stanzas differing in loudness may be indicated by putting a
1523 dynamics mark before each stanza.  In Lilypond, everthing coming in
1524 front of a stanza goes into the @code{StanzaNumber} object; dynamics marks
1525 are no different.  For technical reasons, you have to set the stanza
1526 outside @code{\lyricmode}:
1527
1528 @lilypond[quote,ragged-right,verbatim]
1529 text = {
1530   \set stanza = \markup { \dynamic "ff" "1. " }
1531   \lyricmode {
1532     Big bang
1533   }
1534 }
1535
1536 <<
1537   \new Voice = "tune" {
1538     \time 3/4
1539     g'4 c'2
1540   }
1541 \new Lyrics \lyricsto "tune" \text
1542 >>
1543 @end lilypond
1544
1545 @cindex singer name
1546 @cindex name of singer
1547 @subsubsection Adding singer names
1548
1549 Names of singers can also be added.  They are printed at the start of
1550 the line, just like instrument names.  They are created by setting
1551 @code{vocalName}.  A short version may be entered as @code{shortVocalName}.
1552
1553 @lilypond[fragment,ragged-right,quote,verbatim,relative=2]
1554 \new Voice {
1555   \time 3/4 g2 e4 a2 f4 g2.
1556 } \addlyrics {
1557   \set vocalName = "Bert "
1558   Hi, my name is Bert.
1559 } \addlyrics {
1560   \set vocalName = "Ernie "
1561   Oh, che -- ri, je t'aime
1562 }
1563 @end lilypond
1564
1565
1566 @subsubsection Printing stanzas at the end 
1567
1568 Sometimes it is appropriate to have one stanza set
1569 to the music, and the rest added in verse form at
1570 the end of the piece.  This can be accomplished by adding
1571 the extra verses into a @code{\markup} section outside
1572 of the main score block.  Notice that there are two
1573 different ways to force linebreaks when using
1574 @code{\markup}.
1575
1576 @lilypond[ragged-right,verbatim,quote]
1577 melody = \relative c' {
1578 e d c d | e e e e |
1579 d d e d | c1 |
1580 }
1581
1582 text = \lyricmode {
1583 \set stanza = "1." Ma- ry had a lit- tle lamb,
1584 its fleece was white as snow.
1585 }
1586
1587 \score{ <<
1588   \new Voice = "one" { \melody }
1589   \new Lyrics \lyricsto "one" \text
1590 >>
1591   \layout { }
1592 }
1593 \markup { \column{
1594   \line{ Verse 2. }
1595   \line{ All the children laughed and played }
1596   \line{ To see a lamb at school. }
1597   }
1598 }
1599 \markup{
1600   \wordwrap-string #"
1601   Verse 3.
1602
1603   Mary took it home again,
1604
1605   It was against the rule."
1606 }
1607 @end lilypond
1608
1609
1610 @subsubsection Printing stanzas at the end in multiple columns 
1611
1612 When a piece of music has many verses, they are often printed in
1613 multiple columns across the page. An outdented verse number often
1614 introduces each verse. The following example shows how to produce such
1615 output in Lilypond.
1616
1617 @lilypond[ragged-right,quote,verbatim]
1618 melody = \relative c' {
1619   c c c c | d d d d
1620 }
1621  
1622 text = \lyricmode {
1623   \set stanza = "1." This is verse one.
1624   It has two lines.
1625 }
1626
1627 \score{ <<
1628     \new Voice = "one" { \melody }
1629     \new Lyrics \lyricsto "one" \text
1630    >>
1631   \layout { }
1632 }
1633
1634 \markup {
1635   \fill-line {
1636     \hspace #0.1 % moves the column off the left margin; can be removed if
1637         % space on the page is tight
1638      \column {
1639       \line { \bold "2."
1640         \column {
1641           "This is verse two."
1642           "It has two lines."
1643         }
1644       }
1645       \hspace #0.1 % adds vertical spacing between verses
1646       \line { \bold "3."
1647         \column {
1648           "This is verse three."
1649           "It has two lines."
1650         }
1651       }
1652     }
1653     \hspace #0.1  % adds horizontal spacing between columns; if they are
1654         % still too close, add more " " pairs until the result 
1655         % looks good
1656      \column {
1657       \line { \bold "4."
1658         \column {
1659           "This is verse four."
1660           "It has two lines."
1661         }
1662       }
1663       \hspace #0.1 % adds vertical spacing between verses
1664       \line { \bold "5."
1665         \column {
1666           "This is verse five."
1667           "It has two lines."
1668         }
1669       }
1670     }
1671   \hspace #0.1 % gives some extra space on the right margin; can
1672       % be removed if page space is tight
1673   }
1674 }
1675 @end lilypond
1676
1677
1678 @seealso
1679
1680 Program reference: @internalsref{LyricText}, @internalsref{StanzaNumber},
1681 @internalsref{VocalName}.
1682
1683
1684
1685 @node Ambitus
1686 @subsection Ambitus
1687 @cindex ambitus
1688
1689 The term @emph{ambitus} denotes a range of pitches for a given voice
1690 in a part of music.  It may also denote the pitch range that a musical
1691 instrument is capable of playing.  Ambits are printed on vocal parts,
1692 so performers can easily determine it meets their capabilities.
1693
1694 Ambits are denoted at the beginning of a piece near the initial clef.
1695 The range is graphically specified by two note heads that represent the
1696 minimum and maximum pitch.  To print such ambits, add the
1697 @internalsref{Ambitus_engraver} to the @internalsref{Voice} context,
1698 for example,
1699
1700 @example
1701 \layout @{
1702   \context @{
1703     \Voice
1704     \consists Ambitus_engraver
1705   @}
1706 @}
1707 @end example
1708
1709 This results in the following output
1710
1711 @lilypond[quote,ragged-right]
1712 \layout {
1713   \context {
1714     \Staff
1715     \consists Ambitus_engraver
1716   }
1717 }
1718
1719 \relative \new Staff {
1720   as'' c e2 cis,2
1721 }
1722 @end lilypond
1723
1724 If you have multiple voices in a single staff and you want a single
1725 ambitus per staff rather than per each voice, add the
1726 @internalsref{Ambitus_engraver} to the @internalsref{Staff} context
1727 rather than to the @internalsref{Voice} context.  Here is an example,
1728
1729 @lilypond[verbatim,ragged-right,quote]
1730 \new Staff \with {
1731   \consists "Ambitus_engraver"
1732 }
1733 <<
1734   \new Voice \with {
1735     \remove "Ambitus_engraver"
1736   } \relative c'' {
1737     \override Ambitus #'X-offset = #-1.0
1738     \voiceOne
1739     c4 a d e f2
1740   }
1741   \new Voice \with {
1742     \remove "Ambitus_engraver"
1743   } \relative c' {
1744     \voiceTwo
1745     es4 f g as b2
1746   }
1747 >>
1748 @end lilypond
1749
1750 @noindent
1751 This example uses one advanced feature,
1752
1753 @example
1754 \override Ambitus #'X-offset = #-1.0
1755 @end example
1756
1757 @noindent
1758 This code moves the ambitus to the left.  The same effect could have
1759 been achieved with @code{extra-offset}, but then the formatting system
1760 would not reserve space for the moved object.
1761
1762 @seealso
1763
1764 Program reference: @internalsref{Ambitus},
1765 @internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
1766 @internalsref{AmbitusAccidental}.
1767
1768 Examples:
1769 @lsr{vocal,ambitus@/.ly}.
1770
1771 @refbugs
1772
1773 There is no collision handling in the case of multiple per-voice
1774 ambitus.
1775
1776
1777 @node Other vocal issues
1778 @subsection Other vocal issues
1779
1780 @ignore
1781 yeah, I'm giving up somewhat by stuffing a bunch of things in
1782 here.  But at least they're in the manual now; it's easier to
1783 move them around in the manual once they're already here.
1784
1785 Besides, if users complain about everything stuffed in here, I
1786 can ask them for specific instructions about where to move these
1787 examples, and that might get them more involved in the docs.  -gp
1788 @end ignore
1789
1790 @q{Parlato} is spoken without pitch but still with rhythm; it is
1791 notated by cross noteheads.  This is demonstrated in
1792 @ref{Special noteheads}.
1793
1794
1795
1796
1797
1798 @node Rhythmic music
1799 @section Rhythmic music
1800
1801 Rhythmic music is primarily used for percussion and drum notation, but it can
1802 also be used to show the rhythms of melodies.
1803
1804 @menu
1805 * Showing melody rhythms::      
1806 * Entering percussion::         
1807 * Percussion staves::           
1808 * Ghost notes::                 
1809 @end menu
1810
1811
1812 @node Showing melody rhythms
1813 @subsection Showing melody rhythms
1814
1815 Sometimes you might want to show only the rhythm of a melody.  This
1816 can be done with the rhythmic staff.  All pitches of notes on such a
1817 staff are squashed, and the staff itself has a single line
1818
1819 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
1820 \new RhythmicStaff {
1821   \time 4/4
1822   c4 e8 f g2 | r4 g r2 | g1:32 | r1 |
1823 }
1824 @end lilypond
1825
1826 @seealso
1827
1828 Program reference: @internalsref{RhythmicStaff}.
1829
1830
1831 @node Entering percussion
1832 @subsection Entering percussion
1833
1834 @cindex percussion
1835 @cindex drums
1836
1837
1838 Percussion notes may be entered in @code{\drummode} mode, which is
1839 similar to the standard mode for entering notes.  Each piece of
1840 percussion has a full name and an abbreviated name, and both can be used
1841 in input files
1842
1843 @lilypond[quote,ragged-right,verbatim]
1844 \drums {
1845   hihat hh bassdrum bd
1846 }
1847 @end lilypond
1848
1849 The complete list of drum names is in the init file
1850 @file{ly/@/drumpitch@/-init@/.ly}.
1851 @c TODO: properly document this.
1852
1853 @seealso
1854
1855 Program reference: @internalsref{note-event}.
1856
1857 @node Percussion staves
1858 @subsection Percussion staves
1859 @cindex percussion
1860 @cindex drums
1861
1862 A percussion part for more than one instrument typically uses a
1863 multiline staff where each position in the staff refers to one piece
1864 of percussion.
1865
1866
1867 To typeset the music, the notes must be interpreted in a
1868 @internalsref{DrumStaff} and @internalsref{DrumVoice} contexts
1869
1870 @lilypond[quote,ragged-right,verbatim]
1871 up = \drummode { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
1872 down = \drummode { bassdrum4 snare8 bd r bd sn4 }
1873   \new DrumStaff <<
1874     \new DrumVoice { \voiceOne \up }
1875     \new DrumVoice { \voiceTwo \down }
1876   >>
1877 @end lilypond
1878
1879 The above example shows verbose polyphonic notation.  The short
1880 polyphonic notation, described in @ref{Basic polyphony}, can also be used if
1881 the @internalsref{DrumVoice}s are instantiated by hand first.  For example,
1882
1883 @lilypond[quote,ragged-right,fragment,verbatim]
1884 \new DrumStaff <<
1885   \new DrumVoice = "1" { s1 *2 }
1886   \new DrumVoice = "2" { s1 *2 }
1887   \drummode {
1888     bd4 sn4 bd4 sn4
1889     <<
1890       { \repeat unfold 16 hh16 }
1891       \\
1892       { bd4 sn4 bd4 sn4 }
1893     >>
1894   }
1895 >>
1896 @end lilypond
1897
1898
1899 There are also other layout possibilities.  To use these, set the
1900 property @code{drumStyleTable} in context @internalsref{DrumVoice}.
1901 The following variables have been predefined
1902
1903 @table @code
1904 @item drums-style
1905 This is the default.  It typesets a typical drum kit on a five-line staff
1906
1907 @lilypond[quote,line-width=10.0\cm]
1908 nam = \lyricmode {
1909   cymc cyms cymr hh hhc hho hhho hhp
1910   cb hc bd sn ss tomh tommh tomml toml tomfh tomfl }
1911 mus = \drummode {
1912   cymc cyms cymr hh hhc hho hhho hhp \break
1913   cb hc bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
1914 \score {
1915   << \new DrumStaff \with {
1916        \remove Bar_engraver
1917        \remove Time_signature_engraver
1918        \override Stem #'transparent = ##t
1919        \override Stem #'Y-extent-callback = ##f
1920        \override VerticalAxisGroup #'minimum-Y-extent = #'(-4.0 . 5.0)
1921      } \mus
1922      \new Lyrics \nam
1923   >>
1924   \layout {
1925     \context {
1926       \Score
1927       \override LyricText #'font-family = #'typewriter
1928       \override BarNumber #'transparent =##T
1929     }
1930   }
1931 }
1932 @end lilypond
1933
1934 The drum scheme supports six different toms.  When there are fewer toms,
1935 simply select the toms that produce the desired result, i.e., to get toms
1936 on the three middle lines you use @code{tommh}, @code{tomml}, and
1937 @code{tomfh}.
1938
1939 @item timbales-style
1940 This typesets timbales on a two line staff
1941
1942 @lilypond[quote,ragged-right]
1943 nam = \lyricmode { timh ssh timl ssl cb }
1944 mus = \drummode { timh ssh timl ssl cb s16 }
1945
1946 <<
1947   \new DrumStaff \with {
1948     \remove Bar_engraver
1949     \remove Time_signature_engraver
1950     \override Stem #'transparent = ##t
1951     \override Stem #'Y-extent-callback = ##f
1952     \override StaffSymbol #'line-count = #2
1953     \override StaffSymbol #'staff-space = #2
1954     \override VerticalAxisGroup #'minimum-Y-extent = #'(-3.0 . 4.0)
1955     drumStyleTable = #timbales-style
1956   } \mus
1957   \new Lyrics {
1958     \override LyricText #'font-family = #'typewriter
1959     \nam
1960   }
1961 >>
1962 @end lilypond
1963
1964 @item congas-style
1965 This typesets congas on a two line staff
1966
1967 @lilypond[quote,ragged-right]
1968 nam = \lyricmode { cgh cgho cghm ssh cgl cglo cglm ssl }
1969 mus = \drummode { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
1970
1971 <<
1972   \new DrumStaff \with {
1973     \remove Bar_engraver
1974     \remove Time_signature_engraver
1975     drumStyleTable = #congas-style
1976     \override StaffSymbol #'line-count = #2
1977
1978     %% this sucks; it will lengthen stems.
1979     \override StaffSymbol #'staff-space = #2
1980     \override Stem #'transparent = ##t
1981     \override Stem #'Y-extent-callback = ##f
1982   } \mus
1983   \new Lyrics {
1984     \override LyricText #'font-family = #'typewriter
1985     \nam
1986   }
1987 >>
1988 @end lilypond
1989
1990 @item bongos-style
1991 This typesets bongos on a two line staff
1992
1993 @lilypond[quote,ragged-right]
1994 nam = \lyricmode { boh boho bohm ssh bol bolo bolm ssl }
1995 mus = \drummode { boh boho bohm ssh bol bolo bolm ssl s16 }
1996
1997 <<
1998   \new DrumStaff \with {
1999     \remove Bar_engraver
2000     \remove Time_signature_engraver
2001     \override StaffSymbol #'line-count = #2
2002     drumStyleTable = #bongos-style
2003
2004     %% this sucks; it will lengthen stems.
2005     \override StaffSymbol #'staff-space = #2
2006     \override Stem #'transparent = ##t
2007     \override Stem #'Y-extent-callback = ##f
2008   } \mus
2009   \new Lyrics {
2010     \override LyricText #'font-family = #'typewriter
2011     \nam
2012   }
2013 >>
2014 @end lilypond
2015
2016 @item percussion-style
2017 To typeset all kinds of simple percussion on one line staves.
2018
2019 @lilypond[quote,ragged-right]
2020 nam = \lyricmode { tri trio trim gui guis guil cb cl tamb cab mar hc }
2021 mus = \drummode { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
2022
2023 <<
2024   \new DrumStaff \with{
2025     \remove Bar_engraver
2026     drumStyleTable = #percussion-style
2027     \override StaffSymbol #'line-count = #1
2028     \remove Time_signature_engraver
2029     \override Stem #'transparent = ##t
2030     \override Stem #'Y-extent-callback = ##f
2031   } \mus
2032   \new Lyrics {
2033     \override LyricText #'font-family = #'typewriter
2034     \nam
2035   }
2036 >>
2037 @end lilypond
2038 @end table
2039
2040 If you do not like any of the predefined lists you can define your own
2041 list at the top of your file
2042
2043 @lilypond[quote,ragged-right,verbatim]
2044 #(define mydrums '(
2045          (bassdrum     default   #f         -1)
2046          (snare        default   #f         0)
2047          (hihat        cross     #f         1)
2048          (pedalhihat   xcircle   "stopped"  2)
2049          (lowtom       diamond   #f         3)))
2050 up = \drummode { hh8 hh hh hh hhp4 hhp }
2051 down = \drummode { bd4 sn bd toml8 toml }
2052
2053 \new DrumStaff <<
2054   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
2055   \new DrumVoice { \voiceOne \up }
2056   \new DrumVoice { \voiceTwo \down }
2057 >>
2058 @end lilypond
2059
2060
2061 @seealso
2062
2063 Init files: @file{ly/@/drumpitch@/-init@/.ly}.
2064
2065 Program reference: @internalsref{DrumStaff}, @internalsref{DrumVoice}.
2066
2067 @refbugs
2068
2069 Because general MIDI does not contain rim shots, the sidestick is used
2070 for this purpose instead.
2071
2072
2073 @c FIXME: check name -gp
2074 @node Ghost notes
2075 @subsection Ghost notes
2076
2077 Ghost notes for drums and percussion may be created using the
2078 @code{\parenthesize} command detailed in @ref{Parentheses}.  However,
2079 the default @code{\drummode} does
2080 not include the @code{Parenthesis_engraver} plugin which allows
2081 this.  You
2082 must add the plugin explicitly in the context definition as
2083 detailed in @ref{Changing context properties on the fly}.
2084
2085 @lilypond[quote,ragged-right,verbatim,fragment]
2086 \new DrumStaff \with {
2087   \consists "Parenthesis_engraver"
2088 } <<
2089   \context DrumVoice  = "1"  { s1 *2 }
2090   \context DrumVoice  = "2" { s1 *2 }
2091   \drummode {
2092     <<
2093       {
2094         hh8[ hh] <hh sn> hh16
2095         < \parenthesize sn > hh < \parenthesize
2096         sn > hh8 <hh sn> hh
2097       } \\ {
2098         bd4 r4 bd8 bd r8 bd
2099       }
2100     >>
2101   }
2102 >>
2103 @end lilypond
2104
2105 @noindent
2106 Also note that you must add chords (@code{< >} brackets)
2107 around each @code{\parenthesize} statement.
2108
2109
2110 @node Guitar
2111 @section Guitar
2112
2113 @cindex tablature
2114 @cindex guitar tablature
2115
2116 @menu
2117 * String number indications::   
2118 * Tablatures basic::            
2119 * Non-guitar tablatures::       
2120 * Banjo tablatures::            
2121 * Fret diagrams::               
2122 * Right hand fingerings::       
2123 * Other guitar issues::         
2124 @end menu
2125
2126 @node String number indications
2127 @subsection String number indications
2128
2129 @cindex String numbers
2130
2131 String numbers can be added to chords, by indicating the string number
2132 with @code{\}@var{number},
2133
2134 @lilypond[relative,relative=1,ragged-right,fragment]
2135 <c\1 e\2 g\3>
2136 @end lilypond
2137
2138
2139 @seealso
2140
2141 Program reference: @internalsref{StringNumber},
2142 @lsr{guitar/,string-number.ly}.
2143
2144
2145 @node Tablatures basic
2146 @subsection Tablatures basic
2147 @cindex Tablatures basic
2148
2149 Tablature notation is used for notating music for plucked string
2150 instruments.  Pitches are not denoted with note heads, but by
2151 numbers indicating on which string and fret a note must be played.  LilyPond
2152 offers limited support for tablature.
2153
2154 The string number associated to a note is given as a backslash
2155 followed by a number, e.g., @code{c4\3} for a C quarter on the third
2156 string.  By default, string 1 is the highest one, and the tuning
2157 defaults to the standard guitar tuning (with 6 strings).  The notes
2158 are printed as tablature, by using @internalsref{TabStaff} and
2159 @internalsref{TabVoice} contexts
2160
2161 @lilypond[quote,ragged-right,fragment,verbatim]
2162 \new TabStaff {
2163   a,4\5 c'\2 a\3 e'\1
2164   e\4 c'\2 a\3 e'\1
2165 }
2166 @end lilypond
2167
2168 @funindex minimumFret
2169 @cindex fret
2170
2171 When no string is specified, the first string that does not give a
2172 fret number less than @code{minimumFret} is selected.  The default
2173 value for @code{minimumFret} is 0
2174
2175
2176 @example
2177 e16 fis gis a b4
2178 \set TabStaff.minimumFret = #8
2179 e16 fis gis a b4
2180 @end example
2181 @lilypond[quote,ragged-right]
2182 frag = {
2183   \key e \major
2184   e16 fis gis a b4
2185   \set TabStaff.minimumFret = #8
2186   e16 fis gis a b4
2187 }
2188   \new StaffGroup <<
2189     \new Staff { \clef "G_8" \frag }
2190     \new TabStaff { \frag }
2191   >>
2192 @end lilypond
2193
2194
2195 @commonprop
2196
2197 To print tablatures with stems down and horizontal beams,
2198 initialize the @code{TabStaff} with this code:
2199
2200 @example
2201 \stemDown
2202 \override Beam #'damping = #100000
2203 @end example
2204
2205 @seealso
2206
2207 Program reference: @internalsref{TabStaff}, @internalsref{TabVoice}.
2208
2209 @refbugs
2210
2211 Chords are not handled in a special way, and hence the automatic
2212 string selector may easily select the same string to two notes in a
2213 chord.
2214
2215
2216 @node Non-guitar tablatures
2217 @subsection Non-guitar tablatures
2218 @cindex Non-guitar tablatures
2219
2220 You can change the tuning of the strings.  A string tuning is given as
2221 a Scheme list with one integer number for each string, the number
2222 being the pitch (measured in semitones relative to middle C) of an
2223 open string.  The numbers specified for @code{stringTuning} are the
2224 numbers of semitones to subtract or add, starting the specified pitch
2225 by default middle C, in string order.  LilyPond automatically calculates
2226 the number of strings by looking at @code{stringTuning}.
2227
2228 In the next example,
2229 @code{stringTunings} is set for the pitches e, a, d, and g
2230
2231 @lilypond[quote,ragged-right,fragment,verbatim]
2232 \new TabStaff <<
2233   \set TabStaff.stringTunings = #'(-5 -10 -15 -20)
2234   {
2235     a,4 c' a e' e c' a e'
2236   }
2237 >>
2238 @end lilypond
2239
2240 LilyPond comes with predefined string tunings for banjo, mandolin, guitar
2241 and bass guitar.
2242
2243 @example
2244 \set TabStaff.stringTunings = #bass-tuning
2245 @end example
2246
2247 The default string tuning is @code{guitar-tuning} (the standard EADGBE
2248 tuning).
2249 Some other predefined tunings are @code{guitar-open-g-tuning},
2250 @code{mandolin-tuning} and @code{banjo-open-g-tuning}.
2251
2252 @seealso
2253
2254 The file @file{scm/@/output@/-lib@/.scm} contains the predefined string
2255 tunings.
2256 Program reference: @internalsref{Tab_note_heads_engraver}.
2257
2258 @refbugs
2259
2260 No guitar special effects have been implemented.
2261
2262
2263
2264 @node Banjo tablatures
2265 @subsection Banjo tablatures
2266 @cindex Banjo tablatures
2267
2268 LilyPond has basic support for five stringed banjo.  When making tablatures
2269 for five stringed banjo, use the banjo tablature format function to get
2270 correct
2271 fret numbers for the fifth string:
2272
2273 @lilypond[quote,ragged-right,fragment,verbatim]
2274 \new TabStaff <<
2275   \set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo
2276   \set TabStaff.stringTunings = #banjo-open-g-tuning
2277   {
2278     \stemDown
2279     g8 d' g'\5 a b g e d' |
2280     g4 d''8\5 b' a'\2 g'\5 e'\2 d' |
2281     g4
2282   }
2283 >>
2284 @end lilypond
2285
2286 A number of common tunings for banjo are predefined in LilyPond:
2287 @code{banjo-c-tuning} (gCGBD), @code{banjo-modal-tuning} (gDGCD),
2288 @code{banjo-open-d-tuning} (aDF#AD) and @code{banjo-open-dm-tuning}
2289 (aDFAD).
2290
2291 These tunings may be converted to four string banjo tunings using the
2292 @code{four-string-banjo} function:
2293
2294 @example
2295 \set TabStaff.stringTunings = #(four-string-banjo banjo-c-tuning)
2296 @end example
2297
2298 @seealso
2299
2300 The file @file{scm/@/output@/-lib@/.scm} contains predefined banjo tunings.
2301
2302
2303 @node Fret diagrams
2304 @subsection Fret diagrams
2305 @cindex fret diagrams
2306 @cindex chord diagrams
2307
2308 Fret diagrams can be added to music as a markup to the desired note.  The
2309 markup contains information about the desired fret diagram, as shown in the
2310 following example
2311
2312 @lilypond[verbatim, ragged-right, quote]
2313 \new Voice {
2314   d'^\markup \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;"
2315   d' d' d'
2316   fis'^\markup \override #'(size . 0.75) {
2317     \override #'(finger-code . below-string) {
2318       \fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2)
2319                                (place-fret 5 4 3) (place-fret 4 4 4)
2320                                (place-fret 3 3 2) (place-fret 2 2 1)
2321                                (place-fret 1 2 1))
2322     }
2323   }
2324   fis' fis' fis'
2325   c'^\markup \override #'(dot-radius . 0.35) {
2326     \override #'(finger-code . in-dot) {
2327       \override #'(dot-color . white) {
2328         \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);"
2329       }
2330     }
2331   }
2332   c' c' c'
2333 }
2334 @end lilypond
2335
2336
2337 There are three different fret-diagram markup interfaces: standard, terse,
2338 and verbose.  The three interfaces produce equivalent markups, but have
2339 varying amounts of information in the markup string.  Details about the
2340 markup interfaces are found at @ref{Overview of text markup commands}.
2341
2342 You can set a number of graphical properties according to your preference.
2343 Details about the property interface to fret diagrams are found at
2344 @internalsref{fret-diagram-interface}.
2345
2346
2347 @seealso
2348
2349 Examples: @lsrdir{guitar}
2350
2351
2352 @node Right hand fingerings
2353 @subsection Right hand fingerings
2354
2355 Right hand fingerings in chords can be entered using
2356 @code{@var{note}-\rightHandFinger @var{finger}}
2357
2358 @lilypond[verbatim,fragment,relative=2]
2359   <c-\rightHandFinger #1 e-\rightHandFinger #2 >
2360 @end lilypond
2361
2362 for brevity, you can abbreviate @code{\rightHandFinger} to something
2363 short, for example @code{RH},
2364
2365 @example
2366 #(define RH rightHandFinger)
2367 @end example
2368
2369 @cindex fingerings, right hand, for guitar 
2370 @cindex right hand fingerings for guitar
2371  
2372 @commonprop
2373
2374 You may exercise greater control over right handing fingerings by
2375 setting @code{strokeFingerOrientations},
2376
2377 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
2378 #(define RH rightHandFinger)
2379 {
2380   \set strokeFingerOrientations = #'(up down)
2381   <c-\RH #1 es-\RH #2 g-\RH #4 > 4
2382   \set strokeFingerOrientations = #'(up right down)
2383   <c-\RH #1 es-\RH #2 g-\RH #4 > 4
2384 }
2385 @end lilypond
2386
2387 The letters used for the fingerings are contained in the property
2388 @code{digit-names}, but they can also be set individually by supplying
2389 @code{\rightHandFinger} with a string argument, as in the following example
2390
2391
2392 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
2393 #(define RH rightHandFinger)
2394 {
2395   \set strokeFingerOrientations = #'(right)
2396   \override StrokeFinger #'digit-names = ##("x" "y" "z" "!" "@") 
2397   <c-\RH #5 >4
2398   <c-\RH "@">4  
2399 }
2400 @end lilypond
2401
2402 @seealso
2403
2404 Internalls: @internalsref{StrokeFinger}
2405
2406
2407
2408 @node Other guitar issues
2409 @subsection Other guitar issues
2410
2411 This example demonstrates how to include guitar position and
2412 barring indications.
2413
2414 @lilypond[quote,ragged-right,fragment,verbatim,relative=0]
2415 \clef "G_8"
2416 b16 d16 g16 b16 e16
2417 \textSpannerDown
2418 \override TextSpanner #'bound-details #'left #'text = #"XII "
2419   g16\startTextSpan
2420   b16 e16 g16 e16 b16 g16\stopTextSpan
2421 e16 b16 g16 d16
2422 @end lilypond
2423
2424
2425 Stopped (X) note heads are used in guitar music to signal a place where the
2426 guitarist must play a certain note or chord, with its fingers just
2427 touching the strings instead of fully pressing them.  This gives the sound a
2428 percussive noise-like sound that still maintains part of the original
2429 pitch.  It is notated with cross noteheads; this is
2430 demonstrated in @ref{Special noteheads}.
2431
2432
2433 @node Bagpipe
2434 @section Bagpipe
2435
2436 @cindex Bagpipe
2437
2438 @menu
2439 * Bagpipe definitions::         
2440 * Bagpipe example::             
2441 @end menu
2442
2443
2444 @node Bagpipe definitions
2445 @subsection Bagpipe definitions
2446
2447 LilyPond contains special definitions for music for the Scottish
2448 highland bagpipe; to use them, add
2449
2450 @example
2451 \include "bagpipe.ly"
2452 @end example
2453
2454 @noindent
2455 at the top of your input file.  This lets you add the special gracenotes
2456 common to bagpipe music with short commands.  For example, you could
2457 write @code{\taor} instead of
2458
2459 @example
2460 \grace @{ \small G32[ d G e] @}
2461 @end example
2462
2463 @code{bagpipe.ly} also contains pitch definitions for the bagpipe
2464 notes in the appropiate octaves, so you do not need to worry about
2465 @code{\relative} or @code{\transpose}.
2466
2467 @lilypond[ragged-right,verbatim,quote,notime]
2468 \include "bagpipe.ly"
2469 { \grg G4 \grg a \grg b \grg c \grg d \grg e \grg f \grA g A }
2470 @end lilypond
2471
2472 Bagpipe music nominally uses the key of D Major (even though that
2473 isn't really true). However, since that is the only key that can be used,
2474 the key signature is normally not written out. To set this up correctly,
2475 always start your music with @code{\hideKeySignature}. If you for some
2476 reason want to show the key signature, you can use @code{\showKeySignature}
2477 instead.
2478
2479 Some modern music use cross fingering on c and f to flatten those notes.
2480 This can be indicated by @code{cflat} or @code{fflat}. Similarly, the
2481 piobaireachd high g can be written @code{gflat} when it occurs in light
2482 music.
2483
2484
2485 @node Bagpipe example
2486 @subsection Bagpipe example
2487
2488 This is what the well known tune Amazing Grace looks like in bagpipe
2489 notation.
2490
2491 @lilypond[verbatim,quote]
2492 \include "bagpipe.ly"
2493 \layout {
2494   indent = 0.0\cm
2495   \context { \Score \remove "Bar_number_engraver" }
2496 }
2497
2498 \header {
2499   title = "Amazing Grace"
2500   meter = "Hymn"
2501   arranger = "Trad. arr."
2502 }
2503
2504 {
2505   \hideKeySignature
2506   \time 3/4
2507   \grg \partial 4 a8. d16
2508   \slurd d2 \grg f8[ e32 d16.]
2509   \grg f2 \grg f8 e
2510   \thrwd d2 \grg b4
2511   \grG a2 \grg a8. d16
2512   \slurd d2 \grg f8[ e32 d16.]
2513   \grg f2 \grg e8. f16
2514   \dblA A2 \grg A4
2515   \grg A2 f8. A16
2516   \grg A2 \hdblf f8[ e32 d16.]
2517   \grg f2 \grg f8 e
2518   \thrwd d2 \grg b4
2519   \grG a2 \grg a8. d16
2520   \slurd d2 \grg f8[ e32 d16.]
2521   \grg f2 e4
2522   \thrwd d2.
2523   \slurd d2
2524   \bar "|."
2525 }
2526 @end lilypond
2527
2528
2529 @node Ancient notation
2530 @section Ancient notation
2531
2532 @cindex Vaticana, Editio
2533 @cindex Medicaea, Editio
2534 @cindex hufnagel
2535 @cindex Petrucci
2536 @cindex mensural
2537
2538 Support for ancient notation includes features for mensural notation
2539 and Gregorian Chant notation.  There is also limited support for
2540 figured bass notation.
2541
2542 Many graphical objects provide a @code{style} property, see
2543 @itemize @bullet
2544 @item
2545 @ref{Ancient note heads},
2546 @item
2547 @ref{Ancient accidentals},
2548 @item
2549 @ref{Ancient rests},
2550 @item
2551 @ref{Ancient clefs},
2552 @item
2553 @ref{Ancient flags},
2554 @item
2555 @ref{Ancient time signatures}.
2556 @end itemize
2557
2558 By manipulating such a grob property, the typographical appearance of
2559 the affected graphical objects can be accommodated for a specific
2560 notation flavor without the need for introducing any new notational
2561 concept.
2562
2563 In addition to the standard articulation signs described in section
2564 @ref{Articulations}, specific articulation signs for ancient notation
2565 are provided.
2566
2567 @itemize @bullet
2568 @item
2569 @ref{Ancient articulations}
2570 @end itemize
2571
2572 Other aspects of ancient notation can not that easily be expressed
2573 in terms of just changing a style property of a graphical object or
2574 adding articulation signs.  Some notational concepts are introduced
2575 specifically for ancient notation,
2576
2577 @itemize @bullet
2578 @item
2579 @ref{Custodes},
2580 @item
2581 @ref{Divisiones},
2582 @item
2583 @ref{Ligatures}.
2584 @end itemize
2585
2586 If this all is too much of documentation for you, and you just want to
2587 dive into typesetting without worrying too much about the details on
2588 how to customize a context, you may have a look at the predefined
2589 contexts.  Use them to set up predefined style-specific voice and
2590 staff contexts, and directly go ahead with the note entry,
2591
2592 @itemize @bullet
2593 @item
2594 @ref{Gregorian Chant contexts},
2595 @item
2596 @ref{Mensural contexts}.
2597 @end itemize
2598
2599 There is limited support for figured bass notation which came
2600 up during the baroque period.
2601
2602 @itemize @bullet
2603 @item
2604 @ref{Figured bass}
2605 @end itemize
2606
2607 Here are all subtopics at a glance:
2608
2609 @menu
2610 * Ancient note heads::          
2611 * Ancient accidentals::         
2612 * Ancient rests::               
2613 * Ancient clefs::               
2614 * Ancient flags::               
2615 * Ancient time signatures::     
2616 * Ancient articulations::       
2617 * Custodes::                    
2618 * Divisiones::                  
2619 * Ligatures::                   
2620 * Gregorian Chant contexts::    
2621 * Mensural contexts::           
2622 * Musica ficta accidentals::    
2623 * Figured bass::                
2624 @end menu
2625
2626
2627
2628 @node Ancient note heads
2629 @subsection Ancient note heads
2630
2631 @cindex note heads, ancient
2632
2633 For ancient notation, a note head style other than the @code{default}
2634 style may be chosen.  This is accomplished by setting the @code{style}
2635 property of the @internalsref{NoteHead} object to @code{baroque},
2636 @code{neomensural}, @code{mensural} or @code{petrucci}.  The
2637 @code{baroque} style differs from the @code{default} style only in
2638 using a square shape for @code{\breve} note heads.  The
2639 @code{neomensural} style differs from the @code{baroque} style in that
2640 it uses rhomboidal heads for whole notes and all smaller durations.
2641 Stems are centered on the note heads.  This style is particularly
2642 useful when transcribing mensural music, e.g., for the incipit.  The
2643 @code{mensural} style produces note heads that mimic the look of note
2644 heads in historic printings of the 16th century.  Finally, the
2645 @code{petrucci} style also mimicks historic printings, but uses bigger
2646 note heads.
2647
2648 The following example demonstrates the @code{neomensural} style
2649
2650 @lilypond[quote,fragment,ragged-right,verbatim]
2651 \set Score.skipBars = ##t
2652 \override NoteHead #'style = #'neomensural
2653 a'\longa a'\breve a'1 a'2 a'4 a'8 a'16
2654 @end lilypond
2655
2656 When typesetting a piece in Gregorian Chant notation, the
2657 @internalsref{Gregorian_ligature_engraver} will automatically select
2658 the proper note heads, so there is no need to explicitly set the
2659 note head style.  Still, the note head style can be set, e.g., to
2660 @code{vaticana_punctum} to produce punctum neumes.  Similarly, a
2661 @internalsref{Mensural_ligature_engraver} is used to automatically
2662 assemble mensural ligatures.  See @ref{Ligatures}, for how ligature
2663 engravers work.
2664
2665 @seealso
2666
2667 @ref{Note head styles}, gives an overview over all available note head styles.
2668
2669
2670 @node Ancient accidentals
2671 @subsection Ancient accidentals
2672
2673 @cindex accidentals
2674
2675
2676 Use the @code{glyph-name-alist} property of grob
2677 @internalsref{Accidental} and @internalsref{KeySignature} to select
2678 ancient accidentals. 
2679
2680 @lilypond[quote,ragged-right,staffsize=26]
2681 \score {
2682 {
2683   \fatText
2684   s^\markup {
2685     \column {
2686       "vaticana"
2687       \line { " " \musicglyph #"accidentals.vaticana-1"
2688         " " \musicglyph #"accidentals.vaticana0" }
2689     }
2690     \column {
2691       "medicaea"
2692       \line { " " \musicglyph #"accidentals.medicaea-1" }
2693     }
2694     \column {
2695       "hufnagel"
2696       \line { " " \musicglyph #"accidentals.hufnagel-1" }
2697     }
2698     \column {
2699       "mensural"
2700       \line { " " \musicglyph #"accidentals.mensural-1"
2701         " " \musicglyph #"accidentals.mensural1" }
2702     }
2703   }
2704 }
2705 \layout {
2706   interscoreline = 1
2707   \context { \Score \remove "Bar_number_engraver" }
2708   \context { \Staff
2709       \remove "Clef_engraver"
2710       \remove "Key_engraver"
2711       \remove "Time_signature_engraver"
2712       \remove "Staff_symbol_engraver"
2713       \override VerticalAxisGroup #'minimum-Y-extent = ##f
2714     }
2715   }
2716 }
2717 @end lilypond
2718
2719 As shown, not all accidentals are supported by each style.  When
2720 trying to access an unsupported accidental, LilyPond will switch to a
2721 different style, as demonstrated in
2722 @lsr{ancient,ancient-accidentals.ly}.
2723
2724 Similarly to local accidentals, the style of the key signature can be
2725 controlled by the @code{glyph-name-alist} property of the
2726 @internalsref{KeySignature} grob.
2727
2728 @seealso
2729
2730 In this manual: @ref{Pitches}, @ref{Cautionary accidentals}, and
2731 @ref{Automatic accidentals}, give a general introduction of the use of
2732 accidentals.  @ref{Key signature}, gives a general introduction of
2733 the use of key signatures.
2734
2735 Program reference: @internalsref{KeySignature}.
2736
2737 Examples: @lsrdir{ancient}
2738
2739 @node Ancient rests
2740 @subsection Ancient rests
2741
2742 @cindex rests, ancient
2743
2744
2745 Use the @code{style} property of grob @internalsref{Rest} to select
2746 ancient rests.   Supported styles are @code{classical},
2747 @code{neomensural}, and @code{mensural}.  @code{classical} differs
2748 from the @code{default} style only in that the quarter rest looks like
2749 a horizontally mirrored 8th rest.  The @code{neomensural} style suits
2750 well for, e.g., the incipit of a transcribed mensural piece of music.
2751 The @code{mensural} style finally mimics the appearance of rests as
2752 in historic prints of the 16th century.
2753
2754 The following example demonstrates the @code{neomensural} style
2755
2756 @lilypond[quote,fragment,ragged-right,verbatim]
2757 \set Score.skipBars = ##t
2758 \override Rest #'style = #'neomensural
2759 r\longa r\breve r1 r2 r4 r8 r16
2760 @end lilypond
2761
2762 There are no 32th and 64th rests specifically for the mensural or
2763 neo-mensural style.  Instead, the rests from the default style will be
2764 taken.  See @lsr{pitches,rests} for a chart of all rests.
2765
2766 There are no rests in Gregorian Chant notation; instead, it uses
2767 @ref{Divisiones}.
2768
2769 @seealso
2770
2771 In this manual: @ref{Rests}, gives a general introduction into the use of
2772 rests.
2773
2774
2775 @node Ancient clefs
2776 @subsection Ancient clefs
2777
2778 @cindex clefs
2779
2780
2781 LilyPond supports a variety of clefs, many of them ancient.
2782
2783 The following table shows all ancient clefs that are supported via the
2784 @code{\clef} command.  Some of the clefs use the same glyph, but
2785 differ only with respect to the line they are printed on.  In such
2786 cases, a trailing number in the name is used to enumerate these clefs.
2787 Still, you can manually force a clef glyph to be typeset on an
2788 arbitrary line, as described in @ref{Clef}.  The note printed to the
2789 right side of each clef in the example column denotes the @code{c'}
2790 with respect to that clef.
2791
2792 @multitable @columnfractions .4 .4 .2
2793 @item
2794 @b{Description}
2795 @tab
2796 @b{Supported Clefs}
2797 @tab
2798 @b{Example}
2799
2800 @item
2801 modern style mensural C clef
2802 @tab
2803 @code{neomensural-c1}, @code{neomensural-c2},@*
2804 @code{neomensural-c3}, @code{neomensural-c4}
2805 @tab
2806 @lilypond[fragment,relative=1,notime]
2807   \clef "neomensural-c2" c
2808 @end lilypond
2809
2810 @item
2811 petrucci style mensural C clefs, for use on different staff lines
2812 (the examples show the 2nd staff line C clef)
2813 @tab
2814 @code{petrucci-c1}, @code{petrucci-c2},@*
2815 @code{petrucci-c3}, @code{petrucci-c4},@*
2816 @code{petrucci-c5}
2817 @tab
2818 @lilypond[fragment,relative=1,notime]
2819   \clef "petrucci-c2"
2820   \override NoteHead #'style = #'mensural
2821   c
2822 @end lilypond
2823
2824 @item
2825 petrucci style mensural F clef
2826 @tab
2827 @code{petrucci-f}
2828 @tab
2829 @lilypond[fragment,relative=1,notime]
2830   \clef "petrucci-f"
2831   \override NoteHead #'style = #'mensural
2832   c
2833 @end lilypond
2834
2835 @item
2836 petrucci style mensural G clef
2837 @tab
2838 @code{petrucci-g}
2839 @tab
2840 @lilypond[fragment,relative=1,notime]
2841   \clef "petrucci-g"
2842   \override NoteHead #'style = #'mensural
2843   c
2844 @end lilypond
2845
2846 @item
2847 historic style mensural C clef
2848 @tab
2849 @code{mensural-c1}, @code{mensural-c2},@*
2850 @code{mensural-c3}, @code{mensural-c4}
2851 @tab
2852 @lilypond[fragment,relative=1,notime]
2853   \clef "mensural-c2"
2854   \override NoteHead #'style = #'mensural
2855   c
2856 @end lilypond
2857
2858 @item
2859 historic style mensural F clef
2860 @tab
2861 @code{mensural-f}
2862 @tab
2863 @lilypond[fragment,relative=1,notime]
2864   \clef "mensural-f"
2865   \override NoteHead #'style = #'mensural
2866   c
2867 @end lilypond
2868
2869 @item
2870 historic style mensural G clef
2871 @tab
2872 @code{mensural-g}
2873 @tab
2874 @lilypond[fragment,relative=1,notime]
2875   \clef "mensural-g"
2876   \override NoteHead #'style = #'mensural
2877   c
2878 @end lilypond
2879
2880 @item
2881 Editio Vaticana style do clef
2882 @tab
2883 @code{vaticana-do1}, @code{vaticana-do2},@*
2884 @code{vaticana-do3}
2885 @tab
2886 @lilypond[fragment,relative=1,notime]
2887   \override Staff.StaffSymbol #'line-count = #4
2888   \override Staff.StaffSymbol #'color = #red
2889   \override Staff.LedgerLineSpanner #'color = #red
2890   \override Voice.Stem #'transparent = ##t
2891   \override NoteHead #'style = #'vaticana.punctum
2892   \clef "vaticana-do2"
2893   c
2894 @end lilypond
2895
2896 @item
2897 Editio Vaticana style fa clef
2898 @tab
2899 @code{vaticana-fa1}, @code{vaticana-fa2}
2900 @tab
2901 @lilypond[fragment,relative=1,notime]
2902   \override Staff.StaffSymbol #'line-count = #4
2903   \override Staff.StaffSymbol #'color = #red
2904   \override Staff.LedgerLineSpanner #'color = #red
2905   \override Voice.Stem #'transparent = ##t
2906   \override NoteHead #'style = #'vaticana.punctum
2907   \clef "vaticana-fa2"
2908   c
2909 @end lilypond
2910
2911 @item
2912 Editio Medicaea style do clef
2913 @tab
2914 @code{medicaea-do1}, @code{medicaea-do2},@*
2915 @code{medicaea-do3}
2916 @tab
2917 @lilypond[fragment,relative=1,notime]
2918   \override Staff.StaffSymbol #'line-count = #4
2919   \override Staff.StaffSymbol #'color = #red
2920   \override Staff.LedgerLineSpanner #'color = #red
2921   \override Voice.Stem #'transparent = ##t
2922   \override NoteHead #'style = #'medicaea.punctum
2923   \clef "medicaea-do2"
2924   c
2925 @end lilypond
2926
2927 @item
2928 Editio Medicaea style fa clef
2929 @tab
2930 @code{medicaea-fa1}, @code{medicaea-fa2}
2931 @tab
2932 @lilypond[fragment,relative=1,notime]
2933   \override Staff.StaffSymbol #'line-count = #4
2934   \override Staff.StaffSymbol #'color = #red
2935   \override Staff.LedgerLineSpanner #'color = #red
2936   \override Voice.Stem #'transparent = ##t
2937   \override NoteHead #'style = #'medicaea.punctum
2938   \clef "medicaea-fa2"
2939   c
2940 @end lilypond
2941
2942 @item
2943 historic style hufnagel do clef
2944 @tab
2945 @code{hufnagel-do1}, @code{hufnagel-do2},@*
2946 @code{hufnagel-do3}
2947 @tab
2948 @lilypond[fragment,relative=1,notime]
2949   \override Staff.StaffSymbol #'line-count = #4
2950   \override Staff.StaffSymbol #'color = #red
2951   \override Staff.LedgerLineSpanner #'color = #red
2952   \override Voice.Stem #'transparent = ##t
2953   \override NoteHead #'style = #'hufnagel.punctum
2954   \clef "hufnagel-do2"
2955   c
2956 @end lilypond
2957
2958 @item
2959 historic style hufnagel fa clef
2960 @tab
2961 @code{hufnagel-fa1}, @code{hufnagel-fa2}
2962 @tab
2963 @lilypond[fragment,relative=1,notime]
2964   \override Staff.StaffSymbol #'line-count = #4
2965   \override Staff.StaffSymbol #'color = #red
2966   \override Staff.LedgerLineSpanner #'color = #red
2967   \override Voice.Stem #'transparent = ##t
2968   \override NoteHead #'style = #'hufnagel.punctum
2969   \clef "hufnagel-fa2"
2970   c
2971 @end lilypond
2972
2973 @item
2974 historic style hufnagel combined do/fa clef
2975 @tab
2976 @code{hufnagel-do-fa}
2977 @tab
2978 @lilypond[fragment,relative=1,notime]
2979   \override Staff.StaffSymbol #'color = #red
2980   \override Staff.LedgerLineSpanner #'color = #red
2981   \override Voice.Stem #'transparent = ##t
2982   \override NoteHead #'style = #'hufnagel.punctum
2983   \clef "hufnagel-do-fa"
2984   c
2985 @end lilypond
2986 @end multitable
2987
2988
2989
2990 @emph{Modern style} means @qq{as is typeset in contemporary editions of
2991 transcribed mensural music.}
2992
2993 @emph{Petrucci style} means @qq{inspired by printings published by the
2994 famous engraver Petrucci (1466-1539).}
2995
2996 @emph{Historic style} means @qq{as was typeset or written in historic
2997 editions (other than those of Petrucci).}
2998
2999 @emph{Editio XXX style} means @qq{as is/was printed in Editio XXX.}
3000
3001 Petrucci used C clefs with differently balanced left-side vertical
3002 beams, depending on which staff line it is printed.
3003
3004 @seealso
3005
3006 In this manual: see @ref{Clef}.
3007
3008 @refbugs
3009
3010 The mensural g clef is mapped to the Petrucci g clef.
3011
3012
3013
3014 @node Ancient flags
3015 @subsection Ancient flags
3016
3017 @cindex flags
3018
3019
3020 Use the @code{flag-style} property of grob @internalsref{Stem} to
3021 select ancient flags.  Besides the @code{default} flag style,
3022 only the @code{mensural} style is supported
3023
3024 @lilypond[quote,fragment,ragged-right,verbatim]
3025 \override Stem #'flag-style = #'mensural
3026 \override Stem #'thickness = #1.0
3027 \override NoteHead #'style = #'mensural
3028 \autoBeamOff
3029 c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8
3030 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
3031 @end lilypond
3032
3033 Note that the innermost flare of each mensural flag always is
3034 vertically aligned with a staff line.
3035
3036 There is no particular flag style for neo-mensural notation.  Hence,
3037 when typesetting the incipit of a transcribed piece of mensural
3038 music, the default flag style should be used.  There are no flags in
3039 Gregorian Chant notation.
3040
3041 @refbugs
3042
3043 The attachment of ancient flags to stems is slightly off due to a
3044 change in early 2.3.x.
3045
3046 Vertically aligning each flag with a staff line assumes that stems
3047 always end either exactly on or exactly in the middle between two
3048 staff lines.  This may not always be true when using advanced layout
3049 features of classical notation (which however are typically out of
3050 scope for mensural notation).
3051
3052 @node Ancient time signatures
3053 @subsection Ancient time signatures
3054
3055 @cindex time signatures
3056
3057
3058 There is limited support for mensural time signatures.   The
3059 glyphs are hard-wired to particular time fractions.  In other words,
3060 to get a particular mensural signature glyph with the @code{\time n/m}
3061 command, @code{n} and @code{m} have to be chosen according to the
3062 following table
3063
3064 @lilypond[quote,ragged-right]
3065 \layout {
3066   indent = 0.0
3067   \context {
3068     \Staff
3069     \remove Staff_symbol_engraver
3070     \remove Clef_engraver
3071     \remove Time_signature_engraver
3072   }
3073 }
3074 {
3075   \set Score.timing = ##f
3076   \set Score.barAlways = ##t
3077   s_\markup { "\\time 4/4" }^\markup { "       " \musicglyph
3078 #"timesig.neomensural44" }
3079   s
3080   s_\markup { "\\time 2/2" }^\markup { "       " \musicglyph
3081 #"timesig.neomensural22" }
3082   s
3083   s_\markup { "\\time 6/4" }^\markup { "       " \musicglyph
3084 #"timesig.neomensural64" }
3085   s
3086   s_\markup { "\\time 6/8" }^\markup { "       " \musicglyph
3087 #"timesig.neomensural68" }
3088   \break
3089   s_\markup { "\\time 3/2" }^\markup { "       " \musicglyph
3090 #"timesig.neomensural32" }
3091   s
3092   s_\markup { "\\time 3/4" }^\markup { "       " \musicglyph
3093 #"timesig.neomensural34" }
3094   s
3095   s_\markup { "\\time 9/4" }^\markup { "       " \musicglyph
3096 #"timesig.neomensural94" }
3097   s
3098   s_\markup { "\\time 9/8" }^\markup { "       " \musicglyph
3099 #"timesig.neomensural98" }
3100   \break
3101   s_\markup { "\\time 4/8" }^\markup { "       " \musicglyph
3102 #"timesig.neomensural48" }
3103   s
3104   s_\markup { "\\time 2/4" }^\markup { "       " \musicglyph
3105 #"timesig.neomensural24" }
3106 }
3107 @end lilypond
3108
3109 Use the @code{style} property of grob @internalsref{TimeSignature} to
3110 select ancient time signatures.  Supported styles are
3111 @code{neomensural} and @code{mensural}.  The above table uses the
3112 @code{neomensural} style.  This style is appropriate for the
3113 incipit of transcriptions of mensural pieces.  The @code{mensural}
3114 style mimics the look of historical printings of the 16th century.
3115
3116 The following examples show the differences in style,
3117
3118 @lilypond[ragged-right,fragment,relative=1,quote]
3119 {
3120   \fatText
3121
3122   \time 2/2
3123   c1^\markup { \hspace #-2.0 \typewriter default }
3124
3125   \override Staff.TimeSignature #'style = #'numbered
3126   \time 2/2
3127   c1^\markup { \hspace #-2.0 \typewriter numbered }
3128
3129   \override Staff.TimeSignature #'style = #'mensural
3130   \time 2/2
3131   c1^\markup { \hspace #-2.0 \typewriter mensural }
3132
3133   \override Staff.TimeSignature #'style = #'neomensural
3134   \time 2/2
3135   c1^\markup { \hspace #-2.0 \typewriter neomensural }
3136   \override Staff.TimeSignature #'style = #'single-digit
3137   \time 2/2
3138   c1^\markup { \hspace #-2.0 \typewriter single-digit }
3139 }
3140 @end lilypond
3141
3142 @seealso
3143
3144 This manual: @ref{Time signature}, gives a general introduction to
3145 the use of time signatures.
3146
3147 @refbugs
3148
3149 Ratios of note durations do not change with the time signature.  For
3150 example, the ratio of 1 brevis = 3 semibrevis (tempus perfectum) must
3151 be made by hand, by setting
3152
3153 @example
3154 breveTP = #(ly:make-duration -1 0 3 2)
3155 @dots{}
3156 @{ c\breveTP f1 @}
3157 @end example
3158
3159 @noindent
3160 This sets @code{breveTP} to 3/2 times 2 = 3 times a whole note.
3161
3162 The @code{old6/8alt} symbol (an alternate symbol for 6/8) is not
3163 addressable with @code{\time}.  Use a @code{\markup} instead
3164
3165 @node Ancient articulations
3166 @subsection Ancient articulations
3167
3168 @cindex articulations
3169
3170 In addition to the standard articulation signs described in section
3171 @ref{Articulations}, articulation signs for ancient notation are
3172 provided.  These are specifically designed for use with notation in
3173 Editio Vaticana style.
3174
3175 @lilypond[quote,ragged-right,verbatim]
3176 \include "gregorian-init.ly"
3177 \score {
3178   \new VaticanaVoice {
3179     \override TextScript #'font-family = #'typewriter
3180     \override TextScript #'font-shape = #'upright
3181     \override Script #'padding = #-0.1
3182     a\ictus_"ictus" \break
3183     a\circulus_"circulus" \break
3184     a\semicirculus_"semicirculus" \break
3185     a\accentus_"accentus" \break
3186     \[ a_"episem" \episemInitium \pes b \flexa a b \episemFinis \flexa a \]
3187   }
3188 }
3189 @end lilypond
3190
3191 @refbugs
3192
3193 Some articulations are vertically placed too closely to the
3194 corresponding note heads.
3195
3196 The episem line is not displayed in many cases.  If it is displayed,
3197 the right end of the episem line is often too far to the right.
3198
3199 @node Custodes
3200 @subsection Custodes
3201
3202 @cindex custos
3203 @cindex custodes
3204
3205 A @emph{custos} (plural: @emph{custodes}; Latin word for @q{guard}) is a
3206 symbol that appears at the end of a staff.  It anticipates the pitch
3207 of the first note(s) of the following line thus helping the performer
3208 to manage line breaks during performance.
3209
3210 Custodes were frequently used in music notation until the 17th
3211 century.  Nowadays, they have survived only in a few particular forms
3212 of musical notation such as contemporary editions of Gregorian chant
3213 like the @emph{editio vaticana}.  There are different custos glyphs
3214 used in different flavors of notational style.
3215
3216 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
3217 @internalsref{Staff} context when declaring the @code{\layout} block,
3218 as shown in the following example
3219
3220 @example
3221 \layout @{
3222   \context @{
3223     \Staff
3224     \consists Custos_engraver
3225     Custos \override #'style = #'mensural
3226   @}
3227 @}
3228 @end example
3229
3230 The result looks like this
3231
3232 @lilypond[quote,ragged-right]
3233 \score {
3234 {
3235   a'1
3236   \override Staff.Custos #'style = #'mensural
3237   \break
3238   g'
3239 }
3240 \layout {
3241   \context { \Staff \consists Custos_engraver }
3242   }
3243 }
3244 @end lilypond
3245
3246 The custos glyph is selected by the @code{style} property.  The styles
3247 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel}, and
3248 @code{mensural}.  They are demonstrated in the following fragment
3249
3250 @lilypond[quote,ragged-right,fragment]
3251 \new Lyrics \lyricmode {
3252   \markup { \column {
3253     \typewriter "vaticana"
3254     \line { " " \musicglyph #"custodes.vaticana.u0" }
3255   } }
3256   \markup { \column {
3257     \typewriter "medicaea"
3258     \line { " " \musicglyph #"custodes.medicaea.u0" }
3259   }}
3260   \markup { \column {
3261     \typewriter "hufnagel"
3262     \line { " " \musicglyph #"custodes.hufnagel.u0" }
3263   }}
3264   \markup { \column {
3265     \typewriter "mensural"
3266     \line { " " \musicglyph #"custodes.mensural.u0" }
3267   }}
3268 }
3269 @end lilypond
3270
3271 @seealso
3272
3273 Program reference: @internalsref{Custos}.
3274
3275 Examples:
3276 @lsr{ancient,custodes@/.ly}.
3277
3278
3279 @node Divisiones
3280 @subsection Divisiones
3281
3282 @cindex divisio
3283 @cindex divisiones
3284 @cindex finalis
3285
3286 A @emph{divisio} (plural: @emph{divisiones}; Latin word for
3287 @q{division}) is a staff context symbol that is used to structure
3288 Gregorian music into phrases and sections.  The musical meaning of
3289 @emph{divisio minima}, @emph{divisio maior}, and @emph{divisio maxima}
3290 can be characterized as short, medium, and long pause, somewhat like
3291 the breathmarks from @ref{Breath marks}.  The @emph{finalis} sign not
3292 only marks the end of a chant, but is also frequently used within a
3293 single antiphonal/responsorial chant to mark the end of each section.
3294
3295
3296 To use divisiones, include the file @file{gregorian@/-init@/.ly}.  It
3297 contains definitions that you can apply by just inserting
3298 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
3299 and @code{\finalis} at proper places in the input.  Some editions use
3300 @emph{virgula} or @emph{caesura} instead of divisio minima.
3301 Therefore, @file{gregorian@/-init@/.ly} also defines @code{\virgula} and
3302 @code{\caesura}
3303
3304 @lilypondfile[quote,ragged-right]{divisiones.ly}
3305
3306 @refcommands
3307
3308 @funindex \virgula
3309 @code{\virgula},
3310 @funindex \caesura
3311 @code{\caesura},
3312 @funindex \divisioMinima
3313 @code{\divisioMinima},
3314 @funindex \divisioMaior
3315 @code{\divisioMaior},
3316 @funindex \divisioMaxima
3317 @code{\divisioMaxima},
3318 @funindex \finalis
3319 @code{\finalis}.
3320
3321 @seealso
3322
3323 In this manual: @ref{Breath marks}.
3324
3325 Program reference: @internalsref{BreathingSign}.
3326
3327 Examples: @lsr{expressive,breathing-sign.ly}.
3328
3329
3330 @node Ligatures
3331 @subsection Ligatures
3332
3333 @cindex Ligatures
3334
3335 @c TODO: Should double check if I recalled things correctly when I wrote
3336 @c down the following paragraph by heart.
3337
3338 A ligature is a graphical symbol that represents at least two distinct
3339 notes.  Ligatures originally appeared in the manuscripts of Gregorian
3340 chant notation to denote ascending or descending sequences of notes.
3341
3342 Ligatures are entered by enclosing them in @code{\[} and @code{\]}.
3343 Some ligature styles may need additional input syntax specific for
3344 this particular type of ligature.  By default, the
3345 @internalsref{LigatureBracket} engraver just puts a square bracket
3346 above the ligature
3347
3348 @lilypond[quote,ragged-right,verbatim]
3349 \transpose c c' {
3350   \[ g c a f d' \]
3351   a g f
3352   \[ e f a g \]
3353 }
3354 @end lilypond
3355
3356 To select a specific style of ligatures, a proper ligature engraver
3357 has to be added to the @internalsref{Voice} context, as explained in
3358 the following subsections.   Only white mensural ligatures
3359 are supported with certain limitations.
3360
3361
3362
3363 @refbugs
3364
3365 Ligatures need special spacing that has not yet been implemented.  As
3366 a result, there is too much space between ligatures most of the time,
3367 and line breaking often is unsatisfactory.  Also, lyrics do not
3368 correctly align with ligatures.
3369
3370 Accidentals must not be printed within a ligature, but instead need to
3371 be collected and printed in front of it.
3372
3373 The syntax still uses the deprecated infix style @code{\[ music expr
3374 \]}.  For consistency reasons, it will eventually be changed to
3375 postfix style @code{note\[ ... note\]}.  Alternatively, the file
3376 @file{gregorian@/-init@/.ly} can be included; it provides a scheme
3377 function
3378 @example
3379 \ligature @var{music expr}
3380 @end example
3381 with the same effect and is believed to be stable.
3382
3383 @menu
3384 * White mensural ligatures::    
3385 * Gregorian square neumes ligatures::  
3386 @end menu
3387
3388 @node White mensural ligatures
3389 @subsubsection White mensural ligatures
3390
3391 @cindex Mensural ligatures
3392 @cindex White mensural ligatures
3393
3394 There is limited support for white mensural ligatures.
3395
3396 To engrave white mensural ligatures, in the layout block put the
3397 @internalsref{Mensural_ligature_engraver} into the
3398 @internalsref{Voice} context, and remove the
3399 @internalsref{Ligature_bracket_engraver}, like this
3400
3401 @example
3402 \layout @{
3403   \context @{
3404     \Voice
3405     \remove Ligature_bracket_engraver
3406     \consists Mensural_ligature_engraver
3407   @}
3408 @}
3409 @end example
3410
3411 There is no additional input language to describe the shape of a
3412 white mensural ligature.  The shape is rather determined solely from
3413 the pitch and duration of the enclosed notes.  While this approach may
3414 take a new user a while to get accustomed to, it has the great advantage
3415 that the full musical information of the ligature is known internally.
3416 This is not only required for correct MIDI output, but also allows for
3417 automatic transcription of the ligatures.
3418
3419 For example,
3420
3421 @example
3422 \set Score.timing = ##f
3423 \set Score.defaultBarType = "empty"
3424 \override NoteHead #'style = #'neomensural
3425 \override Staff.TimeSignature #'style = #'neomensural
3426 \clef "petrucci-g"
3427 \[ c'\maxima g \]
3428 \[ d\longa c\breve f e d \]
3429 \[ c'\maxima d'\longa \]
3430 \[ e'1 a g\breve \]
3431 @end example
3432 @lilypond[quote,ragged-right]
3433 \score {
3434   \transpose c c' {
3435     \set Score.timing = ##f
3436     \set Score.defaultBarType = "empty"
3437     \override NoteHead #'style = #'neomensural
3438     \override Staff.TimeSignature #'style = #'neomensural
3439     \clef "petrucci-g"
3440     \[ c'\maxima g \]
3441     \[ d\longa c\breve f e d \]
3442     \[ c'\maxima d'\longa \]
3443     \[ e'1 a g\breve \]
3444   }
3445   \layout {
3446     \context {
3447       \Voice
3448       \remove Ligature_bracket_engraver
3449       \consists Mensural_ligature_engraver
3450     }
3451   }
3452 }
3453 @end lilypond
3454
3455 Without replacing @internalsref{Ligature_bracket_engraver} with
3456 @internalsref{Mensural_ligature_engraver}, the same music transcribes
3457 to the following
3458
3459 @lilypond[quote,ragged-right]
3460 \transpose c c' {
3461   \set Score.timing = ##f
3462   \set Score.defaultBarType = "empty"
3463   \override NoteHead #'style = #'neomensural
3464   \override Staff.TimeSignature #'style = #'neomensural
3465   \clef "petrucci-g"
3466   \[ c'\maxima g \]
3467   \[ d\longa c\breve f e d \]
3468   \[ c'\maxima d'\longa \]
3469   \[ e'1 a g\breve \]
3470 }
3471 @end lilypond
3472
3473 @refbugs
3474
3475 Horizontal spacing is poor.
3476
3477 @node Gregorian square neumes ligatures
3478 @subsubsection Gregorian square neumes ligatures
3479
3480 @cindex Square neumes ligatures
3481 @cindex Gregorian square neumes ligatures
3482
3483 There is limited support for Gregorian square neumes notation
3484 (following the style of the Editio Vaticana).  Core ligatures can
3485 already be typeset, but essential issues for serious typesetting are
3486 still lacking, such as (among others) horizontal alignment of multiple
3487 ligatures, lyrics alignment and proper handling of accidentals.
3488
3489
3490 The following table contains the extended neumes table of the 2nd
3491 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
3492 1983 by the monks of Solesmes.
3493
3494 @multitable @columnfractions .4 .2 .2 .2
3495
3496 @item
3497 @b{Neuma aut@*
3498 Neumarum Elementa}
3499 @tab
3500 @b{Figurae@*
3501 Rectae}
3502 @tab
3503 @b{Figurae@*
3504 Liquescentes@*
3505 Auctae}
3506 @tab
3507 @b{Figurae@*
3508 Liquescentes@*
3509 Deminutae}
3510
3511 @c TODO: \layout block is identical in all of the below examples.
3512 @c Therefore, it should somehow be included rather than duplicated all
3513 @c the time. --jr
3514
3515 @c why not make identifiers in ly/engraver-init.ly? --hwn
3516
3517 @c Because it's just used to typeset plain notes without
3518 @c a staff for demonstration purposes rather than something
3519 @c special of Gregorian chant notation. --jr
3520
3521 @item
3522 @code{1. Punctum}
3523 @tab
3524 @lilypond[staffsize=26,line-width=1.5\cm]
3525 \include "gregorian-init.ly"
3526 \score {
3527   \transpose c c' {
3528     % Punctum
3529     \[ b \]
3530     \noBreak s^\markup {"a"} \noBreak
3531
3532     % Punctum Inclinatum
3533     \[ \inclinatum b \]
3534     \noBreak s^\markup {"b"}
3535   }
3536 \layout { \neumeDemoLayout }}
3537 @end lilypond
3538 @tab
3539 @lilypond[staffsize=26,line-width=2.5\cm]
3540 \include "gregorian-init.ly"
3541 \score {
3542   \transpose c c' {
3543     % Punctum Auctum Ascendens
3544     \[ \auctum \ascendens b \]
3545     \noBreak s^\markup {"c"} \noBreak
3546
3547     % Punctum Auctum Descendens
3548     \[ \auctum \descendens b \]
3549     \noBreak s^\markup {"d"} \noBreak
3550
3551     % Punctum Inclinatum Auctum
3552     \[ \inclinatum \auctum b \]
3553     \noBreak s^\markup {"e"}
3554   }
3555 \layout { \neumeDemoLayout }}
3556 @end lilypond
3557 @tab
3558 @lilypond[staffsize=26,line-width=1.0\cm]
3559 \include "gregorian-init.ly"
3560 \score {
3561   \transpose c c' {
3562     % Punctum Inclinatum Parvum
3563     \[ \inclinatum \deminutum b \]
3564     \noBreak s^\markup {"f"}
3565   }
3566 \layout { \neumeDemoLayout }}
3567 @end lilypond
3568
3569 @item
3570 @code{2. Virga}
3571 @tab
3572 @lilypond[staffsize=26,line-width=1.0\cm]
3573 \include "gregorian-init.ly"
3574 \score {
3575   \transpose c c' {
3576     % Virga
3577     \[ \virga b \]
3578     \noBreak s^\markup {"g"}
3579   }
3580 \layout { \neumeDemoLayout }}
3581 @end lilypond
3582 @tab
3583 @tab
3584
3585 @item
3586 @code{3. Apostropha vel Stropha}
3587 @tab
3588 @lilypond[staffsize=26,line-width=1.0\cm]
3589 \include "gregorian-init.ly"
3590 \score {
3591   \transpose c c' {
3592     % Stropha
3593     \[ \stropha b \]
3594     \noBreak s^\markup {"h"}
3595   }
3596 \layout { \neumeDemoLayout }}
3597 @end lilypond
3598 @tab
3599 @lilypond[staffsize=26,line-width=1.0\cm]
3600 \include "gregorian-init.ly"
3601 \score {
3602   \transpose c c' {
3603     % Stropha Aucta
3604     \[ \stropha \auctum b \]
3605     \noBreak s^\markup {"i"}
3606   }
3607 \layout { \neumeDemoLayout }}
3608 @end lilypond
3609 @tab
3610
3611 @item
3612 @code{4. Oriscus}
3613 @tab
3614 @lilypond[staffsize=26,line-width=1.0\cm]
3615 \include "gregorian-init.ly"
3616 \score {
3617   \transpose c c' {
3618     % Oriscus
3619     \[ \oriscus b \]
3620     \noBreak s^\markup {"j"}
3621   }
3622 \layout { \neumeDemoLayout }}
3623 @end lilypond
3624 @tab
3625 @tab
3626
3627 @item
3628 @code{5. Clivis vel Flexa}
3629 @tab
3630 @lilypond[staffsize=26,line-width=1.0\cm]
3631 \include "gregorian-init.ly"
3632 \score {
3633   \transpose c c' {
3634     % Clivis vel Flexa
3635     \[ b \flexa g \]
3636     s^\markup {"k"}
3637   }
3638 \layout { \neumeDemoLayout }}
3639 @end lilypond
3640 @tab
3641 @lilypond[staffsize=26,line-width=2.0\cm]
3642 \include "gregorian-init.ly"
3643 \score {
3644   \transpose c c' {
3645     % Clivis Aucta Descendens
3646     \[ b \flexa \auctum \descendens g \]
3647     \noBreak s^\markup {"l"} \noBreak
3648
3649     % Clivis Aucta Ascendens
3650     \[ b \flexa \auctum \ascendens g \]
3651     \noBreak s^\markup {"m"}
3652   }
3653 \layout { \neumeDemoLayout }}
3654 @end lilypond
3655 @tab
3656 @lilypond[staffsize=26,line-width=1.0\cm]
3657 \include "gregorian-init.ly"
3658 \score {
3659   \transpose c c' {
3660     % Cephalicus
3661     \[ b \flexa \deminutum g \]
3662     s^\markup {"n"}
3663   }
3664 \layout { \neumeDemoLayout }}
3665 @end lilypond
3666
3667 @item
3668 @code{6. Podatus vel Pes}
3669 @tab
3670 @lilypond[staffsize=26,line-width=1.0\cm]
3671 \include "gregorian-init.ly"
3672 \score {
3673   \transpose c c' {
3674     % Podatus vel Pes
3675     \[ g \pes b \]
3676     s^\markup {"o"}
3677   }
3678 \layout { \neumeDemoLayout }}
3679 @end lilypond
3680 @tab
3681 @lilypond[staffsize=26,line-width=2.0\cm]
3682 \include "gregorian-init.ly"
3683 \score {
3684   \transpose c c' {
3685     % Pes Auctus Descendens
3686     \[ g \pes \auctum \descendens b \]
3687     \noBreak s^\markup {"p"} \noBreak
3688
3689     % Pes Auctus Ascendens
3690     \[ g \pes \auctum \ascendens b \]
3691     \noBreak s^\markup {"q"}
3692   }
3693 \layout { \neumeDemoLayout }}
3694 @end lilypond
3695 @tab
3696 @lilypond[staffsize=26,line-width=1.0\cm]
3697 \include "gregorian-init.ly"
3698 \score {
3699   \transpose c c' {
3700     % Epiphonus
3701     \[ g \pes \deminutum b \]
3702     s^\markup {"r"}
3703   }
3704 \layout { \neumeDemoLayout }}
3705 @end lilypond
3706
3707 @item
3708 @code{7. Pes Quassus}
3709 @tab
3710 @lilypond[staffsize=26,line-width=1.0\cm]
3711 \include "gregorian-init.ly"
3712 \score {
3713   \transpose c c' {
3714     % Pes Quassus
3715     \[ \oriscus g \pes \virga b \]
3716     s^\markup {"s"}
3717   }
3718 \layout { \neumeDemoLayout }}
3719 @end lilypond
3720 @tab
3721 @lilypond[staffsize=26,line-width=1.0\cm]
3722 \include "gregorian-init.ly"
3723 \score {
3724   \transpose c c' {
3725     % Pes Quassus Auctus Descendens
3726     \[ \oriscus g \pes \auctum \descendens b \]
3727     s^\markup {"t"}
3728   }
3729 \layout { \neumeDemoLayout }}
3730 @end lilypond
3731 @tab
3732
3733 @item
3734 @code{8. Quilisma Pes}
3735 @tab
3736 @lilypond[staffsize=26,line-width=1.0\cm]
3737 \include "gregorian-init.ly"
3738 \score {
3739   \transpose c c' {
3740     % Quilisma Pes
3741     \[ \quilisma g \pes b \]
3742     s^\markup {"u"}
3743   }
3744 \layout { \neumeDemoLayout }}
3745 @end lilypond
3746 @tab
3747 @lilypond[staffsize=26,line-width=1.0\cm]
3748 \include "gregorian-init.ly"
3749 \score {
3750   \transpose c c' {
3751     % Quilisma Pes Auctus Descendens
3752     \[ \quilisma g \pes \auctum \descendens b \]
3753     s^\markup {"v"}
3754   }
3755 \layout { \neumeDemoLayout }}
3756 @end lilypond
3757 @tab
3758
3759 @item
3760 @code{9. Podatus Initio Debilis}
3761 @tab
3762 @lilypond[staffsize=26,line-width=1.0\cm]
3763 \include "gregorian-init.ly"
3764 \score {
3765   \transpose c c' {
3766     % Pes Initio Debilis
3767     \[ \deminutum g \pes b \]
3768     s^\markup {"w"}
3769   }
3770 \layout { \neumeDemoLayout }}
3771 @end lilypond
3772 @tab
3773 @lilypond[staffsize=26,line-width=1.0\cm]
3774 \include "gregorian-init.ly"
3775 \score {
3776   \transpose c c' {
3777     % Pes Auctus Descendens Initio Debilis
3778     \[ \deminutum g \pes \auctum \descendens b \]
3779     s^\markup {"x"}
3780   }
3781 \layout { \neumeDemoLayout }}
3782 @end lilypond
3783 @tab
3784
3785 @item
3786 @code{10. Torculus}
3787 @tab
3788 @lilypond[staffsize=26,line-width=1.0\cm]
3789 \include "gregorian-init.ly"
3790 \score {
3791   \transpose c c' {
3792     % Torculus
3793     \[ a \pes b \flexa g \]
3794     s^\markup {"y"}
3795   }
3796 \layout { \neumeDemoLayout }}
3797 @end lilypond
3798 @tab
3799 @lilypond[staffsize=26,line-width=1.0\cm]
3800 \include "gregorian-init.ly"
3801 \score {
3802   \transpose c c' {
3803     % Torculus Auctus Descendens
3804     \[ a \pes b \flexa \auctum \descendens g \]
3805     s^\markup {"z"}
3806   }
3807 \layout { \neumeDemoLayout }}
3808 @end lilypond
3809 @tab
3810 @lilypond[staffsize=26,line-width=1.0\cm]
3811 \include "gregorian-init.ly"
3812 \score {
3813   \transpose c c' {
3814     % Torculus Deminutus
3815     \[ a \pes b \flexa \deminutum g \]
3816     s^\markup {"A"}
3817   }
3818 \layout { \neumeDemoLayout }}
3819 @end lilypond
3820
3821 @item
3822 @code{11. Torculus Initio Debilis}
3823 @tab
3824 @lilypond[staffsize=26,line-width=1.0\cm]
3825 \include "gregorian-init.ly"
3826 \score {
3827   \transpose c c' {
3828     % Torculus Initio Debilis
3829     \[ \deminutum a \pes b \flexa g \]
3830     s^\markup {"B"}
3831   }
3832 \layout { \neumeDemoLayout }}
3833 @end lilypond
3834 @tab
3835 @lilypond[staffsize=26,line-width=1.0\cm]
3836 \include "gregorian-init.ly"
3837 \score {
3838   \transpose c c' {
3839     % Torculus Auctus Descendens Initio Debilis
3840     \[ \deminutum a \pes b \flexa \auctum \descendens g \]
3841     s^\markup {"C"}
3842   }
3843 \layout { \neumeDemoLayout }}
3844 @end lilypond
3845 @tab
3846 @lilypond[staffsize=26,line-width=1.0\cm]
3847 \include "gregorian-init.ly"
3848 \score {
3849   \transpose c c' {
3850     % Torculus Deminutus Initio Debilis
3851     \[ \deminutum a \pes b \flexa \deminutum g \]
3852     s^\markup {"D"}
3853   }
3854 \layout { \neumeDemoLayout }}
3855 @end lilypond
3856
3857 @item
3858 @code{12. Porrectus}
3859 @tab
3860 @lilypond[staffsize=26,line-width=1.0\cm]
3861 \include "gregorian-init.ly"
3862 \score {
3863   \transpose c c' {
3864     % Porrectus
3865     \[ a \flexa g \pes b \]
3866     s^\markup {"E"}
3867   }
3868 \layout { \neumeDemoLayout }}
3869 @end lilypond
3870 @tab
3871 @lilypond[staffsize=26,line-width=1.0\cm]
3872 \include "gregorian-init.ly"
3873 \score {
3874   \transpose c c' {
3875     % Porrectus Auctus Descendens
3876     \[ a \flexa g \pes \auctum \descendens b \]
3877     s^\markup {"F"}
3878   }
3879 \layout { \neumeDemoLayout }}
3880 @end lilypond
3881 @tab
3882 @lilypond[staffsize=26,line-width=1.0\cm]
3883 \include "gregorian-init.ly"
3884 \score {
3885   \transpose c c' {
3886     % Porrectus Deminutus
3887     \[ a \flexa g \pes \deminutum b \]
3888     s^\markup {"G"}
3889   }
3890 \layout { \neumeDemoLayout }}
3891 @end lilypond
3892
3893 @item
3894 @code{13. Climacus}
3895 @tab
3896 @lilypond[staffsize=26,line-width=1.0\cm]
3897 \include "gregorian-init.ly"
3898 \score {
3899   \transpose c c' {
3900     % Climacus
3901     \[ \virga b \inclinatum a \inclinatum g \]
3902     s^\markup {"H"}
3903   }
3904   \layout { \neumeDemoLayout }
3905 }
3906 @end lilypond
3907 @tab
3908 @lilypond[staffsize=26,line-width=1.0\cm]
3909 \include "gregorian-init.ly"
3910 \score {
3911   \transpose c c' {
3912     % Climacus Auctus
3913     \[ \virga b \inclinatum a \inclinatum \auctum g \]
3914     s^\markup {"I"}
3915   }
3916 \layout { \neumeDemoLayout }}
3917 @end lilypond
3918 @tab
3919 @lilypond[staffsize=26,line-width=1.0\cm]
3920 \include "gregorian-init.ly"
3921 \score {
3922   \transpose c c' {
3923     % Climacus Deminutus
3924     \[ \virga b \inclinatum a \inclinatum \deminutum g \]
3925     s^\markup {"J"}
3926   }
3927 \layout { \neumeDemoLayout }}
3928 @end lilypond
3929
3930 @item
3931 @code{14. Scandicus}
3932 @tab
3933 @lilypond[staffsize=26,line-width=1.0\cm]
3934 \include "gregorian-init.ly"
3935 \score {
3936   \transpose c c' {
3937     % Scandicus
3938     \[ g \pes a \virga b \]
3939     s^\markup {"K"}
3940   }
3941 \layout { \neumeDemoLayout }}
3942 @end lilypond
3943 @tab
3944 @lilypond[staffsize=26,line-width=1.0\cm]
3945 \include "gregorian-init.ly"
3946 \score {
3947   \transpose c c' {
3948     % Scandicus Auctus Descendens
3949     \[ g \pes a \pes \auctum \descendens b \]
3950     s^\markup {"L"}
3951   }
3952 \layout { \neumeDemoLayout }}
3953 @end lilypond
3954 @tab
3955 @lilypond[staffsize=26,line-width=1.0\cm]
3956 \include "gregorian-init.ly"
3957 \score {
3958   \transpose c c' {
3959     % Scandicus Deminutus
3960     \[ g \pes a \pes \deminutum b \]
3961     s^\markup {"M"}
3962   }
3963 \layout { \neumeDemoLayout }}
3964 @end lilypond
3965
3966 @item
3967 @code{15. Salicus}
3968 @tab
3969 @lilypond[staffsize=26,line-width=1.0\cm]
3970 \include "gregorian-init.ly"
3971 \score {
3972   \transpose c c' {
3973     % Salicus
3974     \[ g \oriscus a \pes \virga b \]
3975     s^\markup {"N"}
3976   }
3977 \layout { \neumeDemoLayout }}
3978 @end lilypond
3979 @tab
3980 @lilypond[staffsize=26,line-width=1.0\cm]
3981 \include "gregorian-init.ly"
3982 \score {
3983   \transpose c c' {
3984     % Salicus Auctus Descendens
3985     \[ g \oriscus a \pes \auctum \descendens b \]
3986     s^\markup {"O"}
3987   }
3988 \layout { \neumeDemoLayout }}
3989 @end lilypond
3990 @tab
3991
3992 @item
3993 @code{16. Trigonus}
3994 @tab
3995 @lilypond[staffsize=26,line-width=1.0\cm]
3996 \include "gregorian-init.ly"
3997 \score {
3998   \transpose c c' {
3999     % Trigonus
4000     \[ \stropha b \stropha b \stropha a \]
4001     s^\markup {"P"}
4002   }
4003   \layout { \neumeDemoLayout }
4004 }
4005 @end lilypond
4006 @tab
4007 @tab
4008
4009 @end multitable
4010
4011
4012 Unlike most other neumes notation systems, the input language for
4013 neumes does not reflect the typographical appearance, but is designed
4014 to focus on musical meaning.  For example, @code{\[ a \pes b
4015 \flexa g \]} produces a Torculus consisting of three Punctum heads,
4016 while @code{\[ a \flexa g \pes b \]} produces a Porrectus with a
4017 curved flexa shape and only a single Punctum head.  There is no
4018 command to explicitly typeset the curved flexa shape; the decision of
4019 when to typeset a curved flexa shape is based on the musical
4020 input.  The idea of this approach is to separate the musical aspects
4021 of the input from the notation style of the output.  This way, the
4022 same input can be reused to typeset the same music in a different
4023 style of Gregorian chant notation.
4024
4025 The following table shows the code fragments that produce the
4026 ligatures in the above neumes table.  The letter in the first column
4027 in each line of the below table indicates to which ligature in the
4028 above table it refers.  The second column gives the name of the
4029 ligature.  The third column shows the code fragment that produces this
4030 ligature, using @code{g}, @code{a}, and @code{b} as example pitches.
4031
4032 @multitable @columnfractions .02 .31 .67
4033 @item
4034 @b{#}
4035 @tab
4036 @b{Name}
4037 @tab
4038 @b{Input Language}
4039
4040 @item
4041 a
4042 @tab
4043 Punctum
4044 @tab
4045 @code{\[ b \]}
4046
4047 @item
4048 b
4049 @tab
4050 Punctum Inclinatum
4051 @tab
4052 @code{\[ \inclinatum b \]}
4053
4054 @item
4055 c
4056 @tab
4057 Punctum Auctum@*
4058 Ascendens
4059 @tab
4060 @code{\[ \auctum \ascendens b \]}
4061
4062 @item
4063 d
4064 @tab
4065 Punctum Auctum@*
4066 Descendens
4067 @tab
4068 @code{\[ \auctum \descendens b \]}
4069
4070 @item
4071 e
4072 @tab
4073 Punctum Inclinatum@*
4074 Auctum
4075 @tab
4076 @code{\[ \inclinatum \auctum b \]}
4077
4078 @item
4079 f
4080 @tab
4081 Punctum Inclinatum@*
4082 Parvum @tab
4083 @code{\[ \inclinatum \deminutum b \]}
4084
4085 @item
4086 g
4087 @tab
4088 Virga
4089 @tab
4090 @code{\[ \virga b \]}
4091
4092 @item
4093 h
4094 @tab
4095 Stropha
4096 @tab
4097 @code{\[ \stropha b \]}
4098
4099 @item
4100 i
4101 @tab
4102 Stropha Aucta
4103 @tab
4104 @code{\[ \stropha \auctum b \]}
4105
4106 @item
4107 j
4108 @tab
4109 Oriscus
4110 @tab
4111 @code{\[ \oriscus b \]}
4112
4113 @item
4114 k
4115 @tab
4116 Clivis vel Flexa
4117 @tab
4118 @code{\[ b \flexa g \]}
4119
4120 @item
4121 l
4122 @tab
4123 Clivis Aucta@*
4124 Descendens
4125 @tab
4126 @code{\[ b \flexa \auctum \descendens g \]}
4127
4128 @item
4129 m
4130 @tab
4131 Clivis Aucta@*
4132 Ascendens
4133 @tab
4134 @code{\[ b \flexa \auctum \ascendens g \]}
4135
4136 @item
4137 n
4138 @tab
4139 Cephalicus
4140 @tab
4141 @code{\[ b \flexa \deminutum g \]}
4142
4143 @item
4144 o
4145 @tab
4146 Podatus vel Pes
4147 @tab
4148 @code{\[ g \pes b \]}
4149
4150 @item
4151 p
4152 @tab
4153 Pes Auctus@*
4154 Descendens
4155 @tab
4156 @code{\[ g \pes \auctum \descendens b \]}
4157
4158 @item
4159 q
4160 @tab
4161 Pes Auctus@*
4162 Ascendens
4163 @tab
4164 @code{\[ g \pes \auctum \ascendens b \]}
4165
4166 @item
4167 r
4168 @tab
4169 Epiphonus
4170 @tab
4171 @code{\[ g \pes \deminutum b \]}
4172
4173 @item
4174 s
4175 @tab
4176 Pes Quassus
4177 @tab
4178 @code{\[ \oriscus g \pes \virga b \]}
4179
4180 @item
4181 t
4182 @tab
4183 Pes Quassus@*
4184 Auctus Descendens @tab
4185 @code{\[ \oriscus g \pes \auctum \descendens b \]}
4186
4187 @item
4188 u
4189 @tab
4190 Quilisma Pes
4191 @tab
4192 @code{\[ \quilisma g \pes b \]}
4193
4194 @item
4195 v
4196 @tab
4197 Quilisma Pes@*
4198 Auctus Descendens
4199 @tab
4200 @code{\[ \quilisma g \pes \auctum \descendens b \]}
4201
4202 @item
4203 w
4204 @tab
4205 Pes Initio Debilis
4206 @tab
4207 @code{\[ \deminutum g \pes b \]}
4208
4209 @item
4210 x
4211 @tab
4212 Pes Auctus Descendens@*
4213 Initio Debilis
4214 @tab
4215 @code{\[ \deminutum g \pes \auctum \descendens b \]}
4216
4217 @item
4218 y
4219 @tab
4220 Torculus
4221 @tab
4222 @code{\[ a \pes b \flexa g \]}
4223
4224 @item
4225 z
4226 @tab
4227 Torculus Auctus@*
4228 Descendens
4229 @tab
4230 @code{\[ a \pes b \flexa \auctum \descendens g \]}
4231
4232 @item
4233 A
4234 @tab
4235 Torculus Deminutus
4236 @tab
4237 @code{\[ a \pes b \flexa \deminutum g \]}
4238
4239 @item
4240 B
4241 @tab
4242 Torculus Initio Debilis
4243 @tab
4244 @code{\[ \deminutum a \pes b \flexa g \]}
4245
4246 @item
4247 C
4248 @tab
4249 Torculus Auctus@*
4250 Descendens Initio Debilis
4251 @tab
4252 @code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}
4253
4254 @item
4255 D
4256 @tab
4257 Torculus Deminutus@*
4258 Initio Debilis
4259 @tab
4260 @code{\[ \deminutum a \pes b \flexa \deminutum g \]}
4261
4262 @item
4263 E
4264 @tab
4265 Porrectus
4266 @tab
4267 @code{\[ a \flexa g \pes b \]}
4268
4269 @item
4270 F
4271 @tab
4272 Porrectus Auctus@*
4273 Descendens
4274 @tab
4275 @code{\[ a \flexa g \pes \auctum \descendens b \]}
4276
4277 @item
4278 G
4279 @tab
4280 Porrectus Deminutus
4281 @tab
4282 @code{\[ a \flexa g \pes \deminutum b \]}
4283
4284 @item
4285 H
4286 @tab
4287 Climacus
4288 @tab
4289 @code{\[ \virga b \inclinatum a \inclinatum g \]}
4290
4291 @item
4292 I
4293 @tab
4294 Climacus Auctus
4295 @tab
4296 @code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}
4297
4298 @item
4299 J
4300 @tab
4301 Climacus Deminutus
4302 @tab
4303 @code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}
4304
4305 @item
4306 K
4307 @tab
4308 Scandicus
4309 @tab
4310 @code{\[ g \pes a \virga b \]}
4311
4312 @item
4313 L
4314 @tab
4315 Scandicus Auctus@*
4316 Descendens
4317 @tab
4318 @code{\[ g \pes a \pes \auctum \descendens b \]}
4319
4320 @item
4321 M
4322 @tab
4323 Scandicus Deminutus
4324 @tab
4325 @code{\[ g \pes a \pes \deminutum b \]}
4326
4327 @item
4328 N
4329 @tab
4330 Salicus
4331 @tab
4332 @code{\[ g \oriscus a \pes \virga b \]}
4333
4334 @item
4335 O
4336 @tab
4337 Salicus Auctus Descendens
4338 @tab
4339 @code{\[ g \oriscus a \pes \auctum \descendens b \]}
4340
4341 @item
4342 P
4343 @tab
4344 Trigonus
4345 @tab
4346 @code{\[ \stropha b \stropha b \stropha a \]}
4347 @end multitable
4348
4349 The ligatures listed above mainly serve as a limited, but still
4350 representative pool of Gregorian ligature examples.  Virtually, within
4351 the ligature delimiters @code{\[} and @code{\]}, any number of heads
4352 may be accumulated to form a single ligature, and head prefixes like
4353 @code{\pes}, @code{\flexa}, @code{\virga}, @code{\inclinatum},
4354 etc. may be mixed in as desired.  The use of the set of rules that
4355 underlies the construction of the ligatures in the above table is
4356 accordingly extrapolated.  This way, infinitely many different
4357 ligatures can be created.
4358
4359 Augmentum dots, also called @emph{morae}, are added with the music
4360 function @code{\augmentum}.  Note that @code{\augmentum} is
4361 implemented as a unary music function rather than as head prefix.  It
4362 applies to the immediately following music expression only.  That is,
4363 @code{\augmentum \virga c} will have no visible effect.  Instead, say
4364 @code{\virga \augmentum c} or @code{\augmentum @{\virga c@}}.  Also
4365 note that you can say @code{\augmentum @{a g@}} as a shortcut for
4366 @code{\augmentum a \augmentum g}.
4367
4368 @lilypond[quote,ragged-right,verbatim]
4369 \include "gregorian-init.ly"
4370 \score {
4371   \new VaticanaVoice {
4372     \[ \augmentum a \flexa \augmentum g \]
4373     \augmentum g
4374   }
4375 }
4376 @end lilypond
4377
4378 @refcommands
4379
4380 The following head prefixes are supported
4381
4382 @funindex \virga
4383 @code{\virga},
4384 @funindex \stropha
4385 @code{\stropha},
4386 @funindex \inclinatum
4387 @code{\inclinatum},
4388 @funindex \auctum
4389 @code{\auctum},
4390 @funindex \descendens
4391 @code{\descendens},
4392 @funindex \ascendens
4393 @code{\ascendens},
4394 @funindex \oriscus
4395 @code{\oriscus},
4396 @funindex \quilisma
4397 @code{\quilisma},
4398 @funindex \deminutum
4399 @code{\deminutum},
4400 @funindex \cavum
4401 @code{\cavum},
4402 @funindex \linea
4403 @code{\linea}.
4404
4405 Head prefixes can be accumulated, though restrictions apply.  For
4406 example, either @code{\descendens} or @code{\ascendens} can be applied
4407 to a head, but not both to the same head.
4408
4409 @funindex \pes
4410 @funindex \flexa
4411 Two adjacent heads can be tied together with the @code{\pes} and
4412 @code{\flexa} infix commands for a rising and falling line of melody,
4413 respectively.
4414
4415 @funindex \augmentum
4416 Use the unary music function @code{\augmentum} to add augmentum dots.
4417
4418 @refbugs
4419
4420 When an @code{\augmentum} dot appears at the end of the last staff
4421 within a ligature, it is sometimes vertically placed wrong.  As a
4422 workaround, add an additional skip note (e.g. @code{s8}) as last note
4423 of the staff.
4424
4425 @code{\augmentum} should be implemented as a head prefix rather than a
4426 unary music function, such that @code{\augmentum} can be intermixed
4427 with head prefixes in arbitrary order.
4428
4429 @node Gregorian Chant contexts
4430 @subsection Gregorian Chant contexts
4431
4432 @cindex VaticanaVoiceContext
4433 @cindex VaticanaStaffContext
4434
4435 The predefined @code{VaticanaVoiceContext} and
4436 @code{VaticanaStaffContext} can be used to engrave a piece of
4437 Gregorian Chant in the style of the Editio Vaticana.  These contexts
4438 initialize all relevant context properties and grob properties to
4439 proper values, so you can immediately go ahead entering the chant, as
4440 the following excerpt demonstrates
4441
4442 @lilypond[quote,ragged-right,packed,verbatim]
4443 \include "gregorian-init.ly"
4444 \score {
4445   <<
4446     \new VaticanaVoice = "cantus" {
4447       \[ c'\melisma c' \flexa a \]
4448       \[ a \flexa \deminutum g\melismaEnd \]
4449       f \divisioMinima
4450       \[ f\melisma \pes a c' c' \pes d'\melismaEnd \]
4451       c' \divisioMinima \break
4452       \[ c'\melisma c' \flexa a \]
4453       \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima
4454     }
4455     \new Lyrics \lyricsto "cantus" {
4456       San- ctus, San- ctus, San- ctus
4457     }
4458   >>
4459 }
4460 @end lilypond
4461
4462
4463 @node Mensural contexts
4464 @subsection Mensural contexts
4465
4466 @cindex MensuralVoiceContext
4467 @cindex MensuralStaffContext
4468
4469 The predefined @code{MensuralVoiceContext} and
4470 @code{MensuralStaffContext} can be used to engrave a piece in mensural
4471 style.  These contexts initialize all relevant context properties and
4472 grob properties to proper values, so you can immediately go ahead
4473 entering the chant, as the following excerpt demonstrates
4474
4475 @lilypond[quote,ragged-right,verbatim]
4476 \score {
4477   <<
4478     \new MensuralVoice = "discantus" \transpose c c' {
4479       \override Score.BarNumber #'transparent = ##t {
4480         c'1\melisma bes a g\melismaEnd
4481         f\breve
4482         \[ f1\melisma a c'\breve d'\melismaEnd \]
4483         c'\longa
4484         c'\breve\melisma a1 g1\melismaEnd
4485         fis\longa^\signumcongruentiae
4486       }
4487     }
4488     \new Lyrics \lyricsto "discantus" {
4489       San -- ctus, San -- ctus, San -- ctus
4490     }
4491   >>
4492 }
4493 @end lilypond
4494
4495 @node Musica ficta accidentals
4496 @subsection Musica ficta accidentals
4497
4498 In European music from before about 1600, singers were often expected
4499 to chromatically alter notes at their own initiative. This is called
4500 @q{Musica Ficta}. In modern transcriptions, these accidentals are
4501 usually printed over the note.
4502
4503 @cindex Accidental, musica ficta
4504 @cindex Musica ficta
4505
4506 Support for such suggested accidentals is included, and can be
4507 switched on by setting @code{suggestAccidentals} to true.
4508
4509 @funindex suggestAccidentals
4510
4511 @lilypond[verbatim,fragment,relative=1]
4512 fis gis
4513 \set suggestAccidentals = ##t
4514 ais bis
4515 @end lilypond
4516
4517 @seealso
4518
4519 Program reference: @internalsref{Accidental_engraver} engraver and the
4520 @internalsref{AccidentalSuggestion} object.
4521
4522 @node Figured bass
4523 @subsection Figured bass
4524
4525 @cindex Basso continuo
4526
4527 @c TODO: musicological blurb about FB
4528
4529
4530 LilyPond has support for figured bass
4531
4532 @lilypond[quote,ragged-right,verbatim,fragment]
4533 <<
4534   \new Voice { \clef bass dis4 c d ais g fis}
4535   \new FiguredBass \figuremode {
4536     < 6 >4 < 7\+ >8 < 6+ [_!] >
4537     < 6 >4 <6 5 [3+] >
4538     < _ >4 < 6 5/>4
4539   }
4540 >>
4541 @end lilypond
4542
4543 The support for figured bass consists of two parts: there is an input
4544 mode, introduced by @code{\figuremode}, where you can enter bass figures
4545 as numbers, and there is a context called @internalsref{FiguredBass} that
4546 takes care of making @internalsref{BassFigure} objects.
4547
4548 In figures input mode, a group of bass figures is delimited by
4549 @code{<} and @code{>}.  The duration is entered after the @code{>}
4550 @example
4551 <4 6>
4552 @end example
4553 @lilypond[quote,ragged-right,fragment]
4554 \new FiguredBass
4555 \figuremode { <4 6> }
4556 @end lilypond
4557
4558 Accidentals are added when you append @code{-}, @code{!}, and @code{+}
4559 to the numbers.  A plus sign is added when you append @code{\+}, and
4560 diminished fifths and sevenths can be obtained with @code{5/} and @code{7/}.
4561
4562 @example
4563 <4- 6+ 7!> <5++> <3--> <7/> r <6\+ 5/>
4564 @end example
4565 @lilypond[quote,ragged-right,fragment]
4566 \figures { <4- 6+ 7!> <5++> <3--> <7/> r <6\+ 5/> }
4567 @end lilypond
4568
4569 Spaces may be inserted by using @code{_}.  Brackets are
4570 introduced with @code{[} and @code{]}. You can also include text
4571 strings and text markups, see @ref{Overview of text markup commands}.
4572
4573 @example
4574 < [4 6] 8 [_! 12] > < 5 \markup @{ \number 6 \super (1) @} >
4575 @end example
4576 @lilypond[quote,ragged-right,fragment]
4577 \new FiguredBass
4578 \figuremode { < [4 6] 8 [_! 12] > < 5 \markup{ \tiny \number 6 \super (1)} > }
4579 @end lilypond
4580
4581
4582 It is also possible to use continuation lines for repeated figures,
4583
4584 @lilypond[verbatim,relative=1]
4585 <<
4586   \new Staff {
4587     \clef bass
4588     c4 c c
4589   }
4590   \figures {
4591     \set useBassFigureExtenders = ##t
4592     <4 6> <3 6> <3 7>
4593   }
4594 >>
4595 @end lilypond
4596
4597 @noindent
4598 In this case, the extender lines always replace existing figures.
4599
4600 The @code{FiguredBass} context doesn't pay attention to the actual
4601 bass line. As a consequence, you may have to insert extra figures to
4602 get extender lines below all notes, and you may have to add @code{\!}
4603 to avoid getting an extender line, e.g.
4604
4605 @lilypond[relative=1]
4606 <<
4607   \new Voice
4608   \figures {
4609     \set useBassFigureExtenders = ##t
4610     <6 4->4. <6 4->16. <6 4->32 <5>8. r16 <6>8 <6\! 5->
4611   }
4612   {
4613     \clef bass
4614     f16. g32 f16. g32 f16. g32 f16. g32 f8. es16 d8 es
4615   }
4616 >>
4617 @end lilypond
4618
4619 When using continuation lines, common figures are always put in the
4620 same vertical position. When this is unwanted, you can insert a rest
4621 with @code{r}. The rest will clear any previous alignment.  For
4622 example, you can write
4623
4624 @example
4625   <4 6>8 r8
4626 @end example
4627
4628 @noindent
4629 instead of
4630 @example
4631   <4 6>4
4632 @end example
4633
4634 Accidentals and plus signs can appear before or after the numbers,
4635 depending on the @code{figuredBassAlterationDirection} and
4636 @code{figuredBassPlusDirection}
4637 properties
4638
4639 @lilypond
4640   \figures {
4641     <6\+> <5+> <6 4-> r
4642     \set figuredBassAlterationDirection = #1
4643     <6\+> <5+> <6 4-> r
4644     \set figuredBassPlusDirection = #1
4645     <6\+> <5+> <6 4-> r
4646     \set figuredBassAlterationDirection = #-1
4647     <6\+> <5+> <6 4-> r
4648   }
4649 @end lilypond
4650
4651
4652 Although the support for figured bass may superficially resemble chord
4653 support, it is much simpler.  The @code{\figuremode} mode simply
4654 stores the numbers and @internalsref{FiguredBass} context prints them
4655 as entered.  There is no conversion to pitches and no realizations of
4656 the bass are played in the MIDI file.
4657
4658 Internally, the code produces markup texts.  You can use any of the
4659 markup text properties to override formatting.  For example, the
4660 vertical spacing of the figures may be set with @code{baseline-skip}.
4661
4662
4663 Figured bass can also be added to @code{Staff} contexts
4664 directly.  In this case, their vertical position is adjusted
4665 automatically.
4666
4667 @lilypond[ragged-right,fragment,quote]
4668 <<
4669   \new Staff = someUniqueName
4670   \relative c'' {
4671     c4 c'8 r8 c,4 c'
4672   }
4673
4674   %% send to existing Staff.
4675   \context Staff = someUniqueName 
4676   \figuremode {
4677     <4>4 <6 10>8 s8
4678     
4679     \set Staff.useBassFigureExtenders = ##t
4680     <4 6>4 <4 6>
4681   }
4682 >>
4683 @end lilypond
4684
4685
4686 @commonprop
4687
4688 By default, this method produces figures above the notes.  To get
4689 figures below the notes, use
4690
4691 @example
4692 \override Staff.BassFigureAlignmentPositioning #'direction = #DOWN
4693 @end example
4694
4695
4696 @refbugs
4697
4698 When using figured bass above the staff with extender lines and
4699 @code{implicitBassFigures} the lines may become swapped around.
4700 Maintaining order consistently will be impossible when multiple figures
4701 have overlapping extender lines.  To avoid this problem, please
4702 use @code{stacking-dir} on @code{BassFigureAlignment}.
4703
4704
4705 @seealso
4706
4707 Program reference: @internalsref{NewBassFigure},
4708 @internalsref{BassFigureAlignment}, @internalsref{BassFigureLine},
4709 @internalsref{BassFigureBracket}, and
4710 @internalsref{BassFigureContinuation} objects and
4711 @internalsref{FiguredBass} context.
4712
4713
4714
4715 @node Other instrument specific notation
4716 @section Other instrument specific notation
4717
4718 This section includes extra information for writing for instruments.
4719
4720 @menu
4721 * Artificial harmonics (strings)::  
4722 @end menu
4723
4724 @node Artificial harmonics (strings)
4725 @subsection Artificial harmonics (strings)
4726
4727 @cindex artificial harmonics
4728
4729 Artificial harmonics are notated with a different notehead style.  They
4730 are entered by marking the harmonic pitch with @code{\harmonic}.
4731
4732 @lilypond[ragged-right,verbatim,quote,fragment,relative=1]
4733 <c g'\harmonic>4
4734 @end lilypond
4735