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