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