]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/basic-notation.itely
findex -> funindex.
[lilypond.git] / Documentation / user / basic-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 Basic notation
9 @chapter Basic notation
10
11 This chapter explains how to use basic notation features.
12
13 @menu
14 * Pitches::                     
15 * Rhythms::                     
16 * Multiple notes at once::      
17 * Staff notation::              
18 * Connecting notes::            
19 * Expressive marks::            
20 * Repeats::                     
21 @end menu
22
23
24
25 @node Pitches
26 @section Pitches
27
28 This section discusses how to specify the pitch of notes.
29
30 @menu
31 * Normal pitches::              
32 * Accidentals::                 
33 * Cautionary accidentals::      
34 * Micro tones::                 
35 * Notes names in other languages::  
36 * Relative octaves::            
37 * Octave check::                
38 * Transpose::                   
39 * Rests::                       
40 * Skips::                       
41 @end menu
42
43
44 @node Normal pitches
45 @subsection Normal pitches
46
47 @cindex Pitch names
48 @cindex pitches
49
50 A pitch name is specified using lowercase letters @code{a} through @code{g}.
51 An ascending C-major scale is engraved with
52
53 @lilypond[quote,fragment,verbatim,ragged-right]
54 \clef bass
55 c d e f g a b c'
56 @end lilypond
57
58 The note name @code{c} is engraved one octave below middle C.
59
60 @lilypond[quote,fragment,verbatim,ragged-right]
61 \clef treble
62 c1
63 \clef bass
64 c1
65 @end lilypond
66
67 @funindex '
68 @funindex ,
69
70 The optional octave specification takes the form of a series of
71 single quote (`@code{'}') characters or a series of comma
72 (`@code{,}') characters.  Each @code{'} raises the pitch by one
73 octave; each @code{,} lowers the pitch by an octave.
74
75 @lilypond[quote,ragged-right,fragment,verbatim]
76 \clef treble
77 c' c'' e' g d'' d' d c
78 \clef bass
79 c, c,, e, g d,, d, d c
80 @end lilypond
81
82 An alternate method may be used to declare which octave to
83 engrave a pitch; this method does not require as many
84 octave specifications (@code{'} and @code{,}).  See
85 @ref{Relative octaves}.
86
87
88 @node Accidentals
89 @subsection Accidentals
90
91 @cindex note names, Dutch
92 @cindex note names, default
93
94 A sharp is formed by adding @code{-is} to the end of a pitch name and
95 a flat is formed by adding @code{-es}
96
97 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
98 a2 ais a aes
99 @end lilypond
100
101 Double sharps and double flats
102 are obtained by adding @code{-isis} or @code{-eses} to a note name.  These
103 are the Dutch note names.  In Dutch, @code{aes} is contracted to
104 @code{as}, but both forms are accepted.  Similarly, both
105 @code{es} and @code{ees} are accepted
106
107 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
108 a2 aisis a aeses
109 @end lilypond
110
111 A natural will cancel the effect of an accidental or key signature.
112 However, naturals are not encoded into the note name syntax with a
113 suffix; a natural pitch is shown as a simple note name
114
115 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
116 a4 aes a2
117 @end lilypond
118
119
120 @commonprop
121
122 In accordance with standard typesetting rules, a natural sign is printed
123 before a sharp or flat if a previous accidental needs to be
124 cancelled.  To change this behavior, use
125 @code{\set Staff.extraNatural = ##f}
126
127 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
128 ceses4 ces cis c
129 \set Staff.extraNatural = ##f
130 ceses4 ces cis c
131 @end lilypond
132
133
134 @seealso
135
136 Program reference: @internalsref{LedgerLineSpanner},
137 @internalsref{NoteHead}.
138
139
140 @node Cautionary accidentals
141 @subsection Cautionary accidentals
142
143 @cindex accidental, reminder
144 @cindex accidental, cautionary
145 @cindex accidental, parenthesized
146 @cindex reminder accidental
147 @funindex ?
148 @cindex cautionary accidental
149 @cindex parenthesized accidental
150 @funindex !
151
152 Normally accidentals are printed automatically, but you may also
153 print them manually.  A reminder accidental
154 can be forced by adding an exclamation mark @code{!}
155 after the pitch.  A cautionary accidental
156 (i.e., an accidental within parentheses) can be obtained by adding the
157 question mark `@code{?}' after the pitch.  These extra accidentals
158 can be used to produce natural signs, too.
159
160 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
161 cis cis cis! cis? c c? c! c
162 @end lilypond
163
164
165 @seealso
166
167 The automatic production of accidentals can be tuned in many
168 ways.  For more information, see @ref{Automatic accidentals}.
169
170
171 @node Micro tones
172 @subsection Micro tones
173
174 @cindex quarter tones
175 @cindex semi-flats, semi-sharps
176
177 Half-flats and half-sharps are formed by adding @code{-eh} and
178 @code{-ih}; the following is a series of Cs with increasing pitches
179
180 @lilypond[verbatim,ragged-right,quote,relative=2,fragment]
181 \set Staff.extraNatural = ##f
182 ceseh ceh cih cisih
183 @end lilypond
184
185 Micro tones are also exported to the MIDI file.
186
187
188 @refbugs
189
190 There are no generally accepted standards for denoting
191 three-quarter flats, so LilyPond's symbol does not conform to any
192 standard.
193
194
195 @node Notes names in other languages
196 @subsection Notes names in other languages
197
198 There are predefined sets of note names for various other languages.
199 To use them, include the language specific init file.  For
200 example, add @code{\include "english.ly"} to the top of the input
201 file.  The available language files
202 and the note names they define are
203
204 @c  what about micro-tunes, double-sharps, and double-flats?  add
205 @c  more clumns to the table?
206 @c  Oh, and should this be made into a multitable?
207 @cindex note names, other languages
208 @example
209                         Note Names               sharp       flat
210 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
211 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
212                                                -x (double)
213 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
214 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
215 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
216 italiano.ly    do  re  mi  fa  sol la  sib si  -d          -b
217 catalan.ly     do  re  mi  fa  sol la  sib si  -d/-s       -b
218 espanol.ly     do  re  mi  fa  sol la  sib si  -s          -b
219 @end example
220
221
222 @node Relative octaves
223 @subsection Relative octaves
224
225 @cindex Relative
226 @cindex Relative octave specification
227 @funindex \relative
228
229 Octaves are specified by adding @code{'} and @code{,} to pitch names.
230 When you copy existing music, it is easy to accidentally put a pitch
231 in the wrong octave and hard to find such an error.  The relative
232 octave mode prevents these errors by making the mistakes much
233 larger: a single error puts the rest of the piece off by one octave
234
235 @example
236 \relative @var{startpitch} @var{musicexpr}
237 @end example
238
239 @noindent
240 or
241
242 @example
243 \relative @var{musicexpr}
244 @end example
245
246 @noindent
247 @code{c'} is used as the default if no starting pitch is defined.
248
249 The octave of notes that appear in @var{musicexpr} are calculated as
250 follows: if no octave changing marks are used, the basic interval
251 between this and the last note is always taken to be a fourth or
252 less.  This distance is determined without regarding alterations; a
253 @code{fisis} following a @code{ceses} will be put above the
254 @code{ceses}.  In other words, a doubly-augmented fourth is considered
255 a smaller interval than a diminished fifth, even though the
256 doubly-augmented fourth spans seven semitones while the diminished
257 fifth only spans six semitones.
258
259 The octave changing marks @code{'} and @code{,} can be added to raise
260 or lower the pitch by an extra octave.  Upon entering relative mode,
261 an absolute starting pitch can be specified that will act as the
262 predecessor of the first note of @var{musicexpr}.  If no starting pitch
263 is specified, then middle C is used as a start.
264
265 Here is the relative mode shown in action
266 @lilypond[quote,fragment,ragged-right,verbatim]
267 \relative c'' {
268   b c d c b c bes a
269 }
270 @end lilypond
271
272 Octave changing marks are used for intervals greater than a fourth
273 @lilypond[quote,ragged-right,fragment,verbatim]
274 \relative c'' {
275   c g c f, c' a, e''
276 }
277 @end lilypond
278
279 If the preceding item is a chord, the first note of the chord is used
280 to determine the first note of the next chord
281
282 @lilypond[quote,ragged-right,fragment,verbatim]
283 \relative c' {
284   c <c e g>
285   <c' e g>
286   <c, e' g>
287 }
288 @end lilypond
289
290 The pitch after the @code{\relative} contains a note name.
291
292 The relative conversion will not affect @code{\transpose},
293 @code{\chordmode} or @code{\relative} sections in its argument.  To use
294 relative within transposed music, an additional @code{\relative} must
295 be placed inside @code{\transpose}.
296
297
298 @node Octave check
299 @subsection Octave check
300
301 @cindex Octave check
302
303 Octave checks make octave errors easier to correct: a note may be
304 followed by @code{=}@var{quotes} which indicates what its absolute
305 octave should be.  In the following example,
306
307 @example
308 \relative c'' @{ c='' b=' d,='' @}
309 @end example
310
311 @noindent
312 the @code{d} will generate a warning, because a @code{d''} is expected
313 (because @code{b'} to @code{d''} is only a third), but a @code{d'} is
314 found.  In the output, the octave is corrected to be a @code{d''} and
315 the next note is calculated relative to @code{d''} instead of @code{d'}.
316
317 There is also an octave check that produces no visible output.  The syntax
318
319 @example
320 \octave @var{pitch}
321 @end example
322
323 This checks that @var{pitch} (without quotes) yields @var{pitch} (with
324 quotes) in @code{\relative} mode.  If not, a warning is printed, and the
325 octave is corrected.  The @var{pitch} is not printed as a note.
326
327 In the example below, the first check passes without incident, since
328 the @code{e} (in relative mode) is within a fifth of @code{a'}.  However,
329 the second check produces a warning, since the @code{e} is not within
330 a fifth of @code{b'}.  The warning message is printed, and the octave
331 is adjusted so that the following notes are in the correct octave
332 once again.
333
334 @example
335 \relative c' @{
336   e
337   \octave a'
338   \octave b'
339 @}
340 @end example
341
342
343 The octave of a note following an octave check is determined with
344 respect to the note preceding it.  In the next fragment, the last note
345 is an @code{a'}, above middle C.  That means that the @code{\octave}
346 check passes successfully, so the check could be deleted without changing
347 the output of the piece.
348
349 @lilypond[quote,ragged-right,verbatim,fragment]
350 \relative c' {
351   e
352   \octave b
353   a
354 }
355 @end lilypond
356
357
358 @node Transpose
359 @subsection Transpose
360
361 @cindex Transpose
362 @cindex Transposition of pitches
363 @funindex \transpose
364
365 A music expression can be transposed with @code{\transpose}.  The
366 syntax is
367 @example
368 \transpose @var{from} @var{to} @var{musicexpr}
369 @end example
370
371 This means that @var{musicexpr} is transposed by the interval between
372 the pitches @var{from} and @var{to}: any note with pitch @code{from}
373 is changed to @code{to}.
374
375 For example, consider a piece written in the key of D-major.  If
376 this piece is a little too low for its performer, it can be
377 transposed up to E-major with
378 @example
379 \transpose d e @dots{}
380 @end example
381
382 Consider a part written for violin (a C instrument).  If
383 this part is to be played on the A clarinet (for which an
384 A is notated as a C, and which sounds a minor third lower
385 than notated), the following
386 transposition will produce the appropriate part
387
388 @example
389 \transpose a c @dots{}
390 @end example
391
392 @code{\transpose} distinguishes between enharmonic pitches: both
393 @code{\transpose c cis} or @code{\transpose c des} will transpose up
394 half a tone.  The first version will print sharps and the second
395 version will print flats
396
397 @lilypond[quote,ragged-right,verbatim]
398 mus = { \key d \major cis d fis g }
399 \new Staff {
400   \clef "F" \mus
401   \clef "G"
402   \transpose c g' \mus
403   \transpose c f' \mus
404 }
405 @end lilypond
406
407 @code{\transpose} may also be used to input written notes for a
408 transposing instrument.  Pitches are normally entered into LilyPond
409 in C (or ``concert pitch''), but they may be entered in another
410 key.  For example, when entering music for a B-flat trumpet which
411 begins on concert D, one would write
412
413 @example
414 \transpose c bes @{ e4 @dots{} @}
415 @end example
416
417 To print this music in B-flat again (i.e. producing a trumpet part,
418 instead of a concert pitch conductor's score) you would wrap the
419 existing music with another @code{transpose}
420
421 @example
422 \transpose bes c @{ \transpose c bes @{ e4 @dots{} @} @}
423 @end example
424
425
426 @seealso
427
428 Program reference: @internalsref{TransposedMusic}.
429
430
431 @refbugs
432
433 If you want to use both @code{\transpose} and @code{\relative},
434 you must put @code{\transpose} outside of @code{\relative}, since
435 @code{\relative} will have no effect music that appears inside a
436 @code{\transpose}.
437
438
439 @node Rests
440 @subsection Rests
441 @cindex Rests
442
443 @funindex \rest
444 @funindex r
445
446 Rests are entered like notes with the note name @code{r}
447
448 @lilypond[fragment,quote,ragged-right,verbatim]
449 r1 r2 r4 r8
450 @end lilypond
451
452 Whole bar rests, centered in middle of the bar,
453 must be done with multi-measure rests.  They can be used for a
454 single bar as well as many bars, and are discussed in
455 @ref{Multi measure rests}.
456
457 To explicitly specify a rest's vertical position, write a note
458 followed by @code{\rest}.  A rest will be placed in the position
459 where the note would appear,
460
461 @lilypond[fragment,quote,ragged-right,verbatim]
462 a'4\rest d'4\rest
463 @end lilypond
464
465 @noindent
466 This makes manual formatting of
467 polyphonic music much easier, since the automatic rest collision
468 formatter will leave these rests alone.
469
470 @seealso
471
472 Program reference: @internalsref{Rest}.
473
474
475 @node Skips
476 @subsection Skips
477
478 @cindex Skip
479 @cindex Invisible rest
480 @cindex Space note
481 @funindex \skip
482 @funindex s
483
484 An invisible rest (also called a `skip') can be entered like a note
485 with note name `@code{s}' or with @code{\skip @var{duration}}
486
487 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
488 a4 a4 s4 a4 \skip 1 a4
489 @end lilypond
490
491 The @code{s} syntax is only available in note mode and chord mode.  In
492 other situations, for example, when entering lyrics, you should use
493 the @code{\skip} command
494
495 @lilypond[quote,ragged-right,verbatim]
496 <<
497   \relative { a'2 a2 }
498   \new Lyrics \lyricmode { \skip 2 bla2 }
499 >>
500 @end lilypond
501
502 The skip command is merely an empty musical placeholder.  It does not
503 produce any output, not even transparent output.
504
505 The @code{s} skip command does create @internalsref{Staff} and
506 @internalsref{Voice} when necessary, similar to note and rest
507 commands.  For example, the following results in an empty staff.
508
509 @lilypond[quote,ragged-right,verbatim]
510 { s4 }
511 @end lilypond
512
513 The fragment @code{@{ \skip 4 @} } would produce an empty page.
514
515 @seealso
516
517 Program reference: @internalsref{SkipMusic}.
518
519
520
521 @node Rhythms
522 @section Rhythms
523
524 This section discusses rhythms, durations, and bars.
525
526 @menu
527 * Durations::                   
528 * Augmentation dots::           
529 * Tuplets::                     
530 * Scaling durations::           
531 * Bar check::                   
532 * Barnumber check::             
533 * Automatic note splitting::    
534 @end menu
535
536
537 @node Durations
538 @subsection Durations
539
540 @cindex duration
541 @funindex \longa
542 @funindex \breve
543 @funindex \maxima
544
545 In Note, Chord, and Lyrics mode, durations are designated by numbers and
546 dots: durations are entered as their reciprocal values.  For example, a
547 quarter note is entered using a @code{4} (since it is a 1/4 note), while
548 a half note is entered using a @code{2} (since it is a 1/2 note).  For
549 notes longer than a whole you must use the variables @code{\longa} and
550 @code{\breve}
551
552 @example
553 c'\breve
554 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
555 r\longa r\breve
556 r1 r2 r4 r8 r16 r32 r64 r64
557 @end example
558
559 @lilypond[quote]
560 \score {
561 \relative c'' {
562     a\breve*1/2 \autoBeamOff
563     a1 a2 a4 a8 a16 a32 a64 a64
564    \bar "empty"
565    \break
566     r\longa*1/4 r\breve *1/2
567     r1 r2 r4 r8 r16 r32 r64 r64
568   }
569   \layout {
570     ragged-right = ##t
571     \context {
572       \Staff
573         \remove "Clef_engraver"
574         \override StaffSymbol #'transparent = ##t
575         \override TimeSignature #'transparent = ##t
576         \override BarLine #'transparent = ##t
577         \consists "Pitch_squash_engraver"
578     }
579   }
580 }
581 @end lilypond
582
583 If the duration is omitted then it is set to the previously entered
584 duration.  The default for the first note is a quarter note.
585
586 @lilypond[quote,ragged-right,verbatim,fragment]
587 { a a a2 a a4 a a1 a }
588 @end lilypond
589
590
591 @node Augmentation dots
592 @subsection Augmentation dots
593
594 @funindex .
595
596 To obtain dotted note lengths, simply add a dot (`@code{.}') to
597 the number.  Double-dotted notes are produced in a similar way.
598
599 @lilypond[quote,ragged-right,fragment,verbatim]
600 a'4 b' c''4. b'8 a'4. b'4.. c''8.
601 @end lilypond
602
603 @refcommands
604
605 Dots are normally moved up to avoid staff lines, except in polyphonic
606 situations.  The following commands may be used to force a particular
607 direction manually
608
609 @funindex \dotsUp
610 @code{\dotsUp},
611 @funindex \dotsDown
612 @code{\dotsDown},
613 @funindex \dotsNeutral
614 @code{\dotsNeutral}.
615
616 @seealso
617
618 Program reference: @internalsref{Dots}, and @internalsref{DotColumn}.
619
620
621 @node Tuplets
622 @subsection Tuplets
623
624 @cindex tuplets
625 @cindex triplets
626 @funindex \times
627
628 Tuplets are made out of a music expression by multiplying all durations
629 with a fraction
630
631 @example
632 \times @var{fraction} @var{musicexpr}
633 @end example
634
635 @noindent
636 The duration of @var{musicexpr} will be multiplied by the fraction.
637 The fraction's denominator will be printed over the notes, optionally
638 with a bracket.  The most common tuplet is the triplet in which 3
639 notes have the length of 2, so the notes are 2/3 of their written
640 length
641
642 @lilypond[quote,ragged-right,fragment,verbatim]
643 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
644 @end lilypond
645
646 Tuplets may be nested, for example,
647
648 @lilypond[fragment,ragged-right,verbatim,relative=2]
649 \set tupletNumberFormatFunction = #fraction-tuplet-formatter
650 \times 4/6 {
651   a4 a
652   \times 3/5 { a a a a a }
653 }
654 @end lilypond
655
656 @refcommands
657
658 @funindex \tupletUp
659 @code{\tupletUp},
660 @funindex \tupletDown
661 @code{\tupletDown},
662 @funindex \tupletNeutral
663 @code{\tupletNeutral}.
664
665
666 @commonprop
667
668 @funindex tupletNumberFormatFunction
669 @cindex tuplet formatting
670
671 The property @code{tupletSpannerDuration} specifies how long each
672 bracket should last.  With this, you can make lots of tuplets while
673 typing @code{\times} only once, thus saving lots of typing.  In the next
674 example, there are two triplets shown, while @code{\times} was only
675 used once
676
677 @lilypond[quote,fragment,relative=2,ragged-right,verbatim]
678 \set tupletSpannerDuration = #(ly:make-moment 1 4)
679 \times 2/3 { c8 c c c c c }
680 @end lilypond
681
682 @noindent
683 For more information about @code{make-moment}, see
684 @ref{Time administration}.
685
686 The format of the number is determined by the property
687 @code{tupletNumberFormatFunction}.  The default prints only the
688 denominator, but if it is set to the Scheme function
689 @code{fraction-tuplet-formatter}, @var{num}:@var{den} will be printed
690 instead.
691
692 To avoid printing tuplet numbers, use
693
694 @lilypond[quote,fragment,relative=2,ragged-right,verbatim]
695 \times 2/3 { c8 c c } \times 2/3 { c8 c c }
696 \override TupletNumber #'transparent = ##t
697 \times 2/3 { c8 c c } \times 2/3 { c8 c c }
698 @end lilypond
699
700
701 @seealso
702
703 Program reference: @internalsref{TupletBracket},
704 @internalsref{TupletNumber}, and @internalsref{TimeScaledMusic}.
705
706 Examples: @inputfileref{input/@/regression,tuplet@/-nest@/.ly}.
707
708
709
710 @node Scaling durations
711 @subsection Scaling durations
712
713 You can alter the length of duration by a fraction @var{N/M}
714 appending `@code{*}@var{N/M}' (or `@code{*}@var{N}' if @var{M=1}).  This
715 will not affect the appearance of the notes or rests produced.
716
717 In the following example, the first three notes take up exactly two
718 beats, but no triplet bracket is printed.
719 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
720 \time 2/4
721 a4*2/3 gis4*2/3 a4*2/3
722 a4 a4 a4*2
723 b16*4 c4
724 @end lilypond
725
726
727 @seealso
728
729 This manual: @ref{Tuplets}
730
731
732 @node Bar check
733 @subsection Bar check
734
735 @cindex Bar check
736 @funindex barCheckSynchronize
737 @funindex |
738
739 Bar checks help detect errors in the durations.  A bar check is
740 entered using the bar symbol, `@code{|}'.  Whenever it is encountered
741 during interpretation, it should fall on a measure boundary.  If it
742 does not, a warning is printed.  In the next example, the second bar
743 check will signal an error
744 @example
745 \time 3/4 c2 e4 | g2 |
746 @end example
747
748 Bar checks can also be used in lyrics, for example
749
750 @example
751 \lyricmode @{
752   \time 2/4
753   Twin -- kle | Twin -- kle
754 @}
755 @end example
756
757 Failed bar checks are caused by entering incorrect
758 durations.  Incorrect durations often completely garble up the score,
759 especially if the score is polyphonic, so a good place to start correcting
760 input is by scanning for failed bar checks and incorrect durations.
761
762 @funindex |
763 @funindex pipeSymbol
764
765 It is also possible to redefine the meaning of @code{|}.  This is done
766 by assigning a music expression to @code{pipeSymbol},
767
768 @lilypond[quote,ragged-right,verbatim]
769 pipeSymbol = \bar "||"
770
771 { c'2 c' | c'2 c' }
772 @end lilypond
773
774
775 @node Barnumber check
776 @subsection Barnumber check
777
778 When copying large pieces of music, it can be helpful to check that
779 the LilyPond bar number corresponds to the original that you are
780 entering from.  This can be checked with @code{\barNumberCheck}, for
781 example,
782
783 @verbatim
784 \barNumberCheck #123
785 @end verbatim
786
787 @noindent
788 will print a warning if the @code{currentBarNumber} is not 123 when it
789 is processed.
790
791
792 @node Automatic note splitting
793 @subsection Automatic note splitting
794
795 Long notes can be converted automatically to tied notes.  This is done
796 by replacing the @internalsref{Note_heads_engraver} by the
797 @internalsref{Completion_heads_engraver}.
798 In the following examples, notes crossing the bar line are split and tied.
799
800 @lilypond[quote,fragment,verbatim,relative=1,line-width=12\cm]
801 \new Voice \with {
802   \remove "Note_heads_engraver"
803   \consists "Completion_heads_engraver"
804 } {
805   c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2
806 }
807 @end lilypond
808
809 This engraver splits all running notes at the bar line, and inserts
810 ties.  One of its uses is to debug complex scores: if the measures are
811 not entirely filled, then the ties exactly show how much each measure
812 is off.
813
814
815 @refbugs
816
817 Not all durations (especially those containing tuplets) can be
818 represented exactly with normal notes and dots, but the engraver will
819 not insert tuplets.
820
821 @code{Completion_heads_engraver} only affects notes; it does not split
822 rests.
823
824
825 @seealso
826
827 Examples: @inputfileref{input/@/regression,completion@/-heads@/.ly}.
828
829 @noindent
830
831 Program reference: @internalsref{Completion_heads_engraver}.
832
833
834 @node Multiple notes at once
835 @section Multiple notes at once
836
837 Polyphony in music refers to having more than one voice occurring in
838 a piece of music.  Polyphony in LilyPond refers to having more than
839 one voice on the same staff.
840
841 @menu
842 * Chords::                      
843 * Stems::                       
844 * Basic polyphony::             
845 * Explicitly instantiating voices::  
846 * Collision Resolution::        
847 @end menu
848
849
850 @node Chords
851 @subsection Chords
852
853 @cindex Chords
854
855 A chord is formed by a enclosing a set of pitches in @code{<} and
856 @code{>}.  A chord may be followed by a duration, and a set of
857 articulations, just like simple notes
858
859 @lilypond[verbatim,ragged-right,fragment,quote,relative=1]
860 <c e g>4 <c>8
861 @end lilypond
862
863 For more information about chords, see @ref{Chord names}.
864
865
866 @node Stems
867 @subsection Stems
868
869 Whenever a note is found, a @internalsref{Stem} object is created
870 automatically.  For whole notes and rests, they are also created but
871 made invisible.
872
873 @refcommands
874
875 @funindex \stemUp
876 @code{\stemUp},
877 @funindex \stemDown
878 @code{\stemDown},
879 @funindex \stemNeutral
880 @code{\stemNeutral}.
881
882
883 @commonprop
884
885 To change the direction of stems in the middle of the staff, use
886
887 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
888 a4 b c b
889 \override Stem #'neutral-direction = #up
890 a4 b c b
891 \override Stem #'neutral-direction = #down
892 a4 b c b
893 @end lilypond
894
895
896 @node Basic polyphony
897 @subsection Basic polyphony
898
899 @cindex polyphony
900
901 The easiest way to enter fragments with more than one voice on a staff
902 is to enter each voice as a sequence (with @code{@{...@}}), and combine
903 them simultaneously, separating the voices with @code{\\}
904
905 @funindex \\
906
907 @lilypond[quote,verbatim,fragment]
908 \new Staff \relative c' {
909   c16 d e f
910   <<
911     { g4 f e | d2 e2 } \\
912     { r8 e4 d c8 ~ | c b16 a b8 g ~ g2 } \\
913     { s2. | s4 b4 c2 }
914   >>
915 }
916 @end lilypond
917
918 The separator causes @internalsref{Voice} contexts@footnote{Polyphonic
919 voices are sometimes called ``layers'' in other notation packages}
920 @cindex layers
921 to be instantiated.  They bear the names @code{"1"}, @code{"2"}, etc.  In
922 each of these contexts, vertical direction of slurs, stems, etc., is set
923 appropriately.
924
925 These voices are all separate from the voice that contains the notes just
926 outside the @code{<< \\ >>} construct.  This should be noted when making
927 changes at the voice level.  This also means that slurs and ties cannot go
928 into or out of a @code{<< \\ >>} construct.  Conversely, parallel voices
929 from separate @code{<< \\ >>} constructs on the same staff are the the
930 same voice.  Here is the same example, with different noteheads for each
931 voice.  Note that the change to the note-head style in the main voice does
932 not affect
933 the inside of the @code{<< \\ >>} constructs.  Also, the change to the
934 second
935 voice in the first @code{<< \\ >>} construct is effective in the second
936 @code{<< \\ >>}, and the voice is tied across the two constructs.
937
938 @cindex note heads, styles
939
940 @lilypond[quote,verbatim,fragment]
941 \new Staff \relative c' {
942   \override NoteHead #'style = #'cross
943   c16 d e f
944   <<
945     { g4 f e } \\
946     { \override NoteHead #'style = #'triangle
947     r8 e4 d c8 ~ }
948   >> |
949   <<
950     { d2 e2 } \\
951     { c8 b16 a b8 g ~ g2 } \\
952     { \override NoteHead #'style = #'slash s4 b4 c2 }
953   >>
954 }
955 @end lilypond
956
957 Polyphony does not change the relationship of notes within a
958 @code{\relative @{ @}} block.  Each note is calculated relative
959 to the note immediately preceding it.
960
961 @example
962 \relative @{ noteA << noteB \\ noteC >> noteD @}
963 @end example
964
965 @code{noteC} is relative to @code{noteB}, not @code{noteA};
966 @code{noteD} is relative to @code{noteC}, not @code{noteB} or
967 @code{noteA}.
968
969 @node Explicitly instantiating voices
970 @subsection Explicitly instantiating voices
971
972 @internalsref{Voice} contexts can also be instantiated manually
973 inside a @code{<< >>} block to create polyphonic music, using
974 @code{\voiceOne}, up to @code{\voiceFour} to assign stem directions
975 and a horizontal shift for each part.
976
977 Specifically,
978 @example
979 << \upper \\ \lower >>
980 @end example
981
982 @noindent
983 is equivalent to
984
985 @example
986 <<
987   \new Voice = "1" @{ \voiceOne \upper @}
988   \new Voice = "2" @{ \voiceTwo \lower @}
989 >>
990 @end example
991
992 The @code{\voiceXXX} commands set the direction of stems, slurs, ties,
993 articulations, text annotations, augmentation dots of dotted
994 notes, and fingerings.  @code{\voiceOne} and @code{\voiceThree} make
995 these objects point upwards, while @code{\voiceTwo} and @code{\voiceFour}
996 make them point downwards.
997 The command @code{\oneVoice} will revert back to the normal setting.
998
999 An expression that appears directly inside a @code{<< >>} belongs to
1000 the main voice.  This is useful when extra voices appear while the main
1001 voice is playing.  Here is a more correct rendition of the example from
1002 the previous section.  The crossed noteheads demonstrate that the main
1003 melody is now in a single voice context.
1004
1005 @lilypond[quote,ragged-right,verbatim]
1006 \new Staff \relative c' {
1007   \override NoteHead #'style = #'cross
1008   c16 d e f
1009   \voiceOne
1010   <<
1011     { g4 f e | d2 e2 }
1012     \new Voice="1" { \voiceTwo
1013       r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
1014       \oneVoice
1015     }
1016     \new Voice { \voiceThree
1017       s2. | s4 b4 c2
1018       \oneVoice
1019     }
1020   >>
1021   \oneVoice
1022 }
1023 @end lilypond
1024
1025 The correct definition of the voices allows the melody to be slurred.
1026 @lilypond[quote,ragged-right,verbatim]
1027 \new Staff \relative c' {
1028   c16^( d e f
1029   \voiceOne
1030   <<
1031     { g4 f e | d2 e2) }
1032     \context Voice="1" { \voiceTwo
1033       r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
1034       \oneVoice
1035     }
1036     \new Voice { \voiceThree
1037       s2. s4 b4 c2
1038       \oneVoice
1039     }
1040   >>
1041   \oneVoice
1042 }
1043 @end lilypond
1044
1045 Avoiding the @code{\\} separator also allows nesting polyphony
1046 constructs, which in some case might be a more natural way to typeset
1047 the music.
1048
1049 @lilypond[quote,ragged-right,verbatim]
1050 \new Staff \relative c' {
1051   c16^( d e f
1052   \voiceOne
1053   <<
1054     { g4 f e | d2 e2) }
1055     \context Voice="1" { \voiceTwo
1056       r8 e4 d c8 ~ |
1057       <<
1058         {c8 b16 a b8 g ~ g2}
1059         \new Voice { \voiceThree
1060           s4 b4 c2
1061           \oneVoice
1062         }
1063       >>
1064     \oneVoice
1065     }
1066   >>
1067   \oneVoice
1068 }
1069 @end lilypond
1070
1071
1072 @node Collision Resolution
1073 @subsection Collision Resolution
1074
1075 Normally, note heads with a different number of dots are not merged, but
1076 when the object property @code{merge-differently-dotted} is set in
1077 the @internalsref{NoteCollision} object, they are merged
1078 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
1079 \new Voice << {
1080   g8 g8
1081   \override Staff.NoteCollision
1082     #'merge-differently-dotted = ##t
1083   g8 g8
1084 } \\ { g8.[ f16] g8.[ f16] } >>
1085 @end lilypond
1086
1087 Similarly, you can merge half note heads with eighth notes, by setting
1088 @code{merge-differently-headed}
1089 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
1090 \new Voice << {
1091   c8 c4.
1092   \override Staff.NoteCollision
1093     #'merge-differently-headed = ##t
1094 c8 c4. } \\ { c2 c2 } >>
1095 @end lilypond
1096
1097 LilyPond also vertically shifts rests that are opposite of a stem,
1098 for example
1099
1100 @lilypond[quote,ragged-right,fragment,verbatim]
1101 \new Voice << c''4 \\ r4 >>
1102 @end lilypond
1103
1104
1105 @refcommands
1106
1107 @funindex \oneVoice
1108 @code{\oneVoice},
1109 @funindex \voiceOne
1110 @code{\voiceOne},
1111 @funindex \voiceTwo
1112 @code{\voiceTwo},
1113 @funindex \voiceThree
1114 @code{\voiceThree},
1115 @funindex \voiceFour
1116 @code{\voiceFour}.
1117
1118 @funindex \shiftOn
1119 @code{\shiftOn},
1120 @funindex \shiftOnn
1121 @code{\shiftOnn},
1122 @funindex \shiftOnnn
1123 @code{\shiftOnnn},
1124 @funindex \shiftOff
1125 @code{\shiftOff}: these commands specify in what chords of the current
1126 voice should be shifted.  The outer voices (normally: voice one and
1127 two) have @code{\shiftOff}, while the inner voices (three and four)
1128 have @code{\shiftOn}.  @code{\shiftOnn} and @code{\shiftOnnn} define
1129 further shift levels.
1130
1131 When LilyPond cannot cope, the @code{force-hshift}
1132 property of the @internalsref{NoteColumn} object and pitched rests can
1133 be used to override typesetting decisions.
1134
1135 @lilypond[quote,verbatim,ragged-right]
1136 \relative <<
1137 {
1138   <d g>
1139   <d g>
1140 } \\ {
1141   <b f'>
1142   \once \override NoteColumn #'force-hshift = #1.7
1143   <b f'>
1144 } >>
1145 @end lilypond
1146
1147
1148 @seealso
1149
1150 Program reference: the objects responsible for resolving collisions are
1151 @internalsref{NoteCollision} and @internalsref{RestCollision}.
1152
1153 Examples:
1154 @inputfileref{input/@/regression,collision@/-dots@/.ly},
1155 @inputfileref{input/@/regression,collision@/-head-chords@/.ly},
1156 @inputfileref{input/@/regression,collision@/-heads@/.ly},
1157 @inputfileref{input/@/regression,collision@/-mesh@/.ly}, and
1158 @inputfileref{input/@/regression,collisions@/.ly}.
1159
1160
1161 @refbugs
1162
1163 When using @code{merge-differently-headed} with an upstem eighth or a
1164 shorter note, and a downstem half note, the eighth note gets the wrong
1165 offset.
1166
1167 There is no support for clusters where the same note occurs with
1168 different accidentals in the same chord.  In this case, it is
1169 recommended to use enharmonic transcription, or to use special cluster
1170 notation (see @ref{Clusters}).
1171
1172
1173
1174 @node Staff notation
1175 @section Staff notation
1176
1177 @cindex Staff notation
1178
1179 This section describes music notation that occurs on staff level,
1180 such as key signatures, clefs and time signatures.
1181
1182 @menu
1183 * Clef::                        
1184 * Key signature::               
1185 * Time signature::              
1186 * Partial measures::            
1187 * Bar lines::                   
1188 * Unmetered music::             
1189 * System start delimiters::     
1190 * Staff symbol::                
1191 * Writing music in parallel::   
1192 @end menu
1193
1194
1195 @node Clef
1196 @subsection Clef
1197
1198 @funindex \clef
1199
1200 The clef indicates which lines of the staff correspond to which
1201 pitches.  The clef is set with the @code{\clef} command
1202
1203 @lilypond[quote,ragged-right,fragment,verbatim]
1204 { c''2 \clef alto g'2 }
1205 @end lilypond
1206
1207 @cindex treble clef
1208 @cindex violin clef
1209 @cindex alto clef
1210 @cindex tenor clef
1211 @cindex bass clef
1212 @cindex french clef
1213 @cindex soprano clef
1214 @cindex mezzosoprano clef
1215 @cindex baritone clef
1216 @cindex varbaritone clef
1217 @cindex subbass clef
1218
1219 Supported clefs include
1220
1221 @multitable @columnfractions .33 .66
1222 @headitem Clef @tab Position
1223 @item @code{treble}, violin, G, G2 @tab
1224 G clef on 2nd line
1225 @item @code{alto, C} @tab
1226 C clef on 3rd line
1227 @item @code{tenor} @tab
1228 C clef on 4th line.
1229 @item @code{bass, F} @tab
1230 F clef on 4th line
1231 @item @code{french} @tab
1232 G clef on 1st line, so-called French violin clef
1233 @item @code{soprano} @tab
1234 C clef on 1st line
1235 @item @code{mezzosoprano} @tab
1236 C clef on 2nd line
1237 @item @code{baritone} @tab
1238 C clef on 5th line
1239 @item @code{varbaritone} @tab
1240 F clef on 3rd line
1241 @item @code{subbass} @tab
1242 F clef on 5th line
1243 @item @code{percussion} @tab
1244 percussion clef
1245 @item @code{tab} @tab
1246 tablature clef
1247 @end multitable
1248
1249 By adding @code{_8} or @code{^8} to the clef name, the clef is
1250 transposed one octave down or up, respectively, and @code{_15} and
1251 @code{^15} transposes by two octaves.  The argument @var{clefname}
1252 must be enclosed in quotes when it contains underscores or digits.  For
1253 example,
1254
1255 @cindex choral tenor clef
1256 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
1257 \clef "G_8" c4
1258 @end lilypond
1259
1260
1261 @commonprop
1262
1263 The command @code{\clef "treble_8"} is equivalent to setting
1264 @code{clefGlyph},
1265 @code{clefPosition} (which controls the Y position of the clef),
1266 @code{middleCPosition} and @code{clefOctavation}.  A clef is printed
1267 when any of these properties are changed.  The following example shows
1268 possibilities when setting properties manually.
1269
1270 @lilypond[quote,ragged-right,verbatim]
1271 {
1272   \set Staff.clefGlyph = #"clefs.F"
1273   \set Staff.clefPosition = #2
1274   c'4
1275   \set Staff.clefGlyph = #"clefs.G"
1276   c'4
1277   \set Staff.clefGlyph = #"clefs.C"
1278   c'4
1279   \set Staff.clefOctavation = #7
1280   c'4
1281   \set Staff.clefOctavation = #0
1282   \set Staff.clefPosition = #0
1283   c'4
1284   \clef "bass"
1285   c'4
1286   \set Staff.middleCPosition = #4
1287   c'4
1288 }
1289 @end lilypond
1290
1291
1292 @seealso
1293
1294 Program reference: @internalsref{Clef}.
1295
1296
1297 @node Key signature
1298 @subsection Key signature
1299
1300 @cindex Key signature
1301 @funindex \key
1302
1303 The key signature indicates the tonality in which a piece is played.  It
1304 is denoted by a set of alterations (flats or sharps) at the start of the
1305 staff.
1306
1307 Setting or changing the key signature is done with the @code{\key}
1308 command
1309
1310 @example
1311 @code{\key} @var{pitch} @var{type}
1312 @end example
1313
1314 @funindex \minor
1315 @funindex \major
1316 @funindex \minor
1317 @funindex \ionian
1318 @funindex \locrian
1319 @funindex \aeolian
1320 @funindex \mixolydian
1321 @funindex \lydian
1322 @funindex \phrygian
1323 @funindex \dorian
1324 @cindex church modes
1325
1326 Here, @var{type} should be @code{\major} or @code{\minor} to get
1327 @var{pitch}-major or @var{pitch}-minor, respectively.  You may also
1328 use the standard mode names (also called ``church modes''): @code{\ionian},
1329 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
1330 @code{\phrygian}, and @code{\dorian}.
1331
1332 This command sets the context property
1333 @code{Staff.keySignature}.  Non-standard key signatures
1334 can be specified by setting this property directly.
1335
1336 Accidentals and key signatures often confuse new users, because
1337 unaltered notes get natural signs depending on the key signature.  For
1338 more information, see @ref{More about pitches}.
1339
1340
1341 @commonprop
1342
1343 A natural sign is printed to cancel any previous accidentals.  This
1344 can be suppressed by setting the @code{Staff.printKeyCancellation}
1345 property.
1346
1347 @lilypond[quote,fragment,ragged-right,fragment,verbatim,relative=2]
1348 \key d \major
1349 a b cis d
1350 \key g \minor
1351 a bes c d
1352 \set Staff.printKeyCancellation = ##f
1353 \key d \major
1354 a b cis d
1355 \key g \minor
1356 a bes c d
1357 @end lilypond
1358
1359
1360 @seealso
1361
1362 Program reference: @internalsref{KeyCancellation},
1363 @internalsref{KeySignature}.
1364
1365
1366 @node Time signature
1367 @subsection Time signature
1368
1369 @cindex Time signature
1370 @cindex meter
1371 @funindex \time
1372
1373 Time signature indicates the metrum of a piece: a regular pattern of
1374 strong and weak beats.  It is denoted by a fraction at the start of the
1375 staff.
1376
1377 The time signature is set with the @code{\time} command
1378
1379 @lilypond[quote,ragged-right,fragment,verbatim]
1380 \time 2/4 c'2 \time 3/4 c'2.
1381 @end lilypond
1382
1383 @commonprop
1384
1385 The symbol that is printed can be customized with the @code{style}
1386 property.  Setting it to @code{#'()} uses fraction style for 4/4 and
1387 2/2 time,
1388
1389 @lilypond[fragment,quote,ragged-right,verbatim]
1390 \time 4/4 c'1
1391 \time 2/2 c'1
1392 \override Staff.TimeSignature #'style = #'()
1393 \time 4/4 c'1
1394 \time 2/2 c'1
1395 @end lilypond
1396
1397 There are many more options for its layout.  See @ref{Ancient time
1398 signatures} for more examples.
1399
1400 @code{\time} sets the property @code{timeSignatureFraction},
1401 @code{beatLength} and @code{measureLength} in the @code{Timing}
1402 context, which is normally aliased to @internalsref{Score}.  The
1403 property @code{measureLength} determines where bar lines should be
1404 inserted, and how automatic beams should be generated.  Changing the
1405 value of @code{timeSignatureFraction} also causes the symbol to be
1406 printed.
1407
1408 More options are available through the Scheme function
1409 @code{set-time-signature}.  In combination with the
1410 @internalsref{Measure_grouping_engraver}, it will create
1411 @internalsref{MeasureGrouping} signs.  Such signs ease reading
1412 rhythmically complex modern music.  In the following example, the 9/8
1413 measure is subdivided in 2, 2, 2 and 3.  This is passed to
1414 @code{set-time-signature} as the third argument @code{(2 2 2 3)}
1415
1416 @lilypond[quote,ragged-right,verbatim]
1417 \score {
1418   \relative c'' {
1419     #(set-time-signature 9 8 '(2 2 2 3))
1420     g8[ g] d[ d] g[ g] a8[( bes g]) |
1421     #(set-time-signature 5 8 '(3 2))
1422     a4. g4
1423   }
1424   \layout {
1425     \context {
1426       \Staff
1427       \consists "Measure_grouping_engraver"
1428     }
1429   }
1430 }
1431 @end lilypond
1432
1433
1434 @seealso
1435
1436 Program reference: @internalsref{TimeSignature}, and
1437 @internalsref{Timing_translator}.
1438
1439 Examples: @inputfileref{input/@/test,compound@/-time@/.ly}.
1440
1441
1442 @refbugs
1443
1444 Automatic beaming does not use the measure grouping specified with
1445 @code{set-time-signature}.
1446
1447
1448 @node Partial measures
1449 @subsection Partial measures
1450
1451 @cindex anacrusis
1452 @cindex upbeat
1453 @cindex partial measure
1454 @cindex measure, partial
1455 @cindex shorten measures
1456 @funindex \partial
1457
1458 Partial measures, such as an anacrusis or upbeat, are entered using the
1459
1460 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
1461 \partial 16*5 c16 cis d dis e | a2. c,4 | b2
1462 @end lilypond
1463
1464 The syntax for this command is
1465
1466 @example
1467 \partial @var{duration}
1468 @end example
1469
1470 This is internally translated into
1471
1472 @example
1473 \set Timing.measurePosition = -@var{length of duration}
1474 @end example
1475
1476 The property @code{measurePosition} contains a rational number
1477 indicating how much of the measure has passed at this point.
1478
1479
1480 @refbugs
1481
1482 This command does not take into account grace notes at the start of
1483 the music.  When a piece starts with graces notes in the pickup, then
1484 the @code{\partial} should follow the grace notes
1485
1486 @lilypond[verbatim,quote,ragged-right,relative,fragment]
1487 \grace f16
1488 \partial 4
1489 g4
1490 a2 g2
1491 @end lilypond
1492
1493
1494 @node Bar lines
1495 @subsection Bar lines
1496
1497 @cindex Bar lines
1498 @funindex \bar
1499 @cindex measure lines
1500 @cindex repeat bars
1501
1502 Bar lines delimit measures, but are also used to indicate
1503 repeats.  Normally they are inserted automatically.  Line
1504 breaks may only happen on bar lines.
1505
1506 Special types of bar lines can be forced with the @code{\bar} command
1507
1508 @lilypond[quote,ragged-right,relative=2,fragment,verbatim]
1509 c4 \bar "|:" c4
1510 @end lilypond
1511
1512 The following bar types are available
1513
1514 @lilypondfile[ragged-right,quote]{bar-lines.ly}
1515
1516 In addition, you can specify @code{"||:"}, which is equivalent to 
1517 @code{"|:"} except at line breaks, where it gives a double bar line at
1518 the end of the line and a start repeat at the beginning of the next
1519 line. 
1520
1521 To allow a line break where there is no visible bar line, use
1522
1523 @example
1524 \bar ""
1525 @end example
1526
1527 @noindent
1528 This will insert an invisible bar line and allow line breaks at this
1529 point.
1530
1531 In scores with many staves, a @code{\bar} command in one staff is
1532 automatically applied to all staves.  The resulting bar lines are
1533 connected between different staves of a StaffGroup
1534
1535 @lilypond[quote,ragged-right,fragment,verbatim]
1536 <<
1537   \new StaffGroup <<
1538     \new Staff {
1539       e'4 d'
1540       \bar "||"
1541       f' e'
1542     }
1543     \new Staff { \clef bass c4 g e g }
1544   >>
1545   \new Staff { \clef bass c2 c2 }
1546 >>
1547 @end lilypond
1548
1549
1550 @commonprop
1551
1552 @funindex whichBar
1553 @funindex repeatCommands
1554 @funindex defaultBarType
1555
1556 The command @code{\bar }@var{bartype} is a short cut for doing
1557 @code{\set Timing.whichBar = }@var{bartype}.  Whenever @code{whichBar}
1558 is set to a string, a bar line of that type is created.
1559
1560 A bar line is created whenever the @code{whichBar} property is set.
1561 At the start of a measure it is set to the contents of
1562 @code{Timing.defaultBarType}.  The contents of @code{repeatCommands} are
1563 used
1564 to override default measure bars.
1565
1566 You are encouraged to use @code{\repeat} for repetitions.  See
1567 @ref{Repeats}.
1568
1569
1570 @seealso
1571
1572 In this manual: @ref{Repeats}, @ref{System start delimiters}.
1573
1574 Program reference: @internalsref{BarLine} (created at
1575 @internalsref{Staff} level), @internalsref{SpanBar} (across staves).
1576
1577 Examples: @inputfileref{input/@/test,bar@/-lines@/.ly},
1578
1579
1580 @node Unmetered music
1581 @subsection Unmetered music
1582
1583 @cindex cadenza
1584 @funindex \cadenzaOn
1585 @funindex \cadenzaOff
1586
1587 Bar lines and bar numbers are calculated automatically.  For unmetered
1588 music (cadenzas, for example), this is not desirable.  To turn off
1589 automatic bar lines and bar numbers, use the commands @code{\cadenzaOn}
1590 and @code{\cadenzaOff}.
1591
1592 @lilypond[verbatim,quote,ragged-right,relative=2,fragment]
1593 c4 d e d
1594 \cadenzaOn
1595 c4 c d8 d d f4 g4.
1596 \cadenzaOff
1597 \bar "|"
1598 d4 e d c
1599 @end lilypond
1600
1601
1602 @refbugs
1603
1604 LilyPond will only insert page breaks at a barline.  Unless the unmetered
1605 music ends before the end of the staff line, you will need to insert
1606 invisible bar lines
1607
1608 @example
1609 \bar ""
1610 @end example
1611
1612 @noindent
1613 to indicate where line breaks can occur.
1614
1615
1616 @node System start delimiters
1617 @subsection System start delimiters
1618
1619 @cindex start of system
1620 @cindex Staff, multiple
1621 @cindex bracket, vertical
1622 @cindex brace, vertical
1623 @cindex grand staff
1624 @cindex staff group
1625 @cindex staff, choir
1626
1627 Many scores consist of more than one staff.  These staves can be
1628 joined in four different ways
1629
1630 @itemize @bullet
1631 @item The group is started with a brace at the left, and bar lines are
1632 connected.  This is done with the @internalsref{GrandStaff} context.
1633
1634 @lilypond[verbatim,ragged-right,quote]
1635 \new GrandStaff
1636 \relative <<
1637   \new Staff { c1 c }
1638   \new Staff { c c }
1639 >>
1640 @end lilypond
1641
1642 @item The group is started with a bracket, and bar lines are connected.
1643 This is done with the
1644 @internalsref{StaffGroup} context
1645
1646 @lilypond[verbatim,ragged-right,quote]
1647 \new StaffGroup
1648 \relative <<
1649   \new Staff { c1 c }
1650   \new Staff { c c }
1651 >>
1652 @end lilypond
1653
1654 @item The group is started with a bracket, but bar lines are not
1655 connected.  This is done with the @internalsref{ChoirStaff} context.
1656
1657 @lilypond[verbatim,ragged-right,quote]
1658 \new ChoirStaff
1659 \relative <<
1660   \new Staff { c1 c }
1661   \new Staff { c c }
1662 >>
1663 @end lilypond
1664
1665 @item The group is started with a vertical line.  Bar lines are not
1666 connected.  This is the default for the score.
1667
1668 @lilypond[verbatim,ragged-right,quote]
1669 \relative <<
1670   \new Staff { c1 c }
1671   \new Staff { c c }
1672 >>
1673 @end lilypond
1674 @end itemize
1675
1676
1677 @seealso
1678
1679 The bar lines at the start of each system are
1680 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace}, and
1681 @internalsref{SystemStartBracket}.  Only one of these types is created
1682 in every context, and that type is determined by the property
1683 @code{systemStartDelimiter}.
1684
1685
1686 @node Staff symbol
1687 @subsection Staff symbol
1688
1689 @cindex adjusting staff symbol
1690
1691 Notes, dynamic signs, etc., are grouped
1692 with a set of horizontal lines, called a staff (plural `staves').  In
1693 LilyPond, these lines are drawn using a separate layout object called
1694 staff symbol.
1695
1696 The staff symbol may be tuned in the number, thickness and distance
1697 of lines, using properties.  This is demonstrated in the example files
1698 @inputfileref{input/@/test,staff@/-lines@/.ly},
1699 @inputfileref{input/@/test,staff@/-size@/.ly}.
1700
1701 In addition, staves may be started and stopped at will. This is done
1702 with @code{\startStaff} and @code{\stopStaff}.
1703
1704 @lilypond[verbatim,relative=2,fragment]
1705 b4 b
1706 \override Staff.StaffSymbol #'line-count = 2
1707 \stopStaff \startStaff
1708 b b
1709 \revert Staff.StaffSymbol #'line-count
1710 \stopStaff \startStaff
1711 b b
1712 @end lilypond
1713
1714 In combination with Frenched staves, this may be used to typeset ossia
1715 sections. An example is in @inputfileref{input/@/test@/,ossia.ly},
1716 shown here
1717
1718 @cindex ossia
1719
1720 @lilypondfile{ossia.ly}
1721
1722 @cindex staff lines, setting number of
1723 @cindex staff lines, setting thickness of
1724 @cindex thickness of staff lines, setting
1725 @cindex number of staff lines, setting
1726
1727 @seealso
1728
1729 Program reference: @internalsref{StaffSymbol}.
1730
1731 Examples: @inputfileref{input/@/test,staff@/-lines@/.ly},
1732 @inputfileref{input/@/test@/,ossia.ly},
1733 @inputfileref{input/@/test,staff@/-size@/.ly},
1734 @inputfileref{input/@/regression,staff@/-line@/-positions@/.ly}.
1735
1736
1737 @node Writing music in parallel
1738 @subsection Writing music in parallel
1739
1740 @cindex Writing music in parallel
1741 @cindex Interleaved music
1742
1743 Music for multiple parts can be interleaved
1744
1745 @lilypond[quote,fragment,verbatim]
1746 \parallelMusic #'(voiceA voiceB) {
1747   r8     g'16[ c''] e''[ g' c'' e''] r8     g'16[ c''] e''[ g' c'' e''] |
1748   c'2                                c'2                                |
1749   r8     a'16[ d''] f''[ a' d'' f''] r8     a'16[ d''] f''[ a' d'' f''] |
1750   c'2                                c'2                                |
1751 }
1752 \new StaffGroup <<
1753   \new Staff \new Voice \voiceA
1754   \new Staff \new Voice \voiceB
1755 >>
1756 @end lilypond
1757
1758
1759
1760 @node Connecting notes
1761 @section Connecting notes
1762
1763 This section deals with notation that affects groups of notes.
1764
1765 @menu
1766 * Ties::                        
1767 * Slurs::                       
1768 * Phrasing slurs::              
1769 * Laissez vibrer ties::         
1770 * Automatic beams::             
1771 * Manual beams::                
1772 * Grace notes::                 
1773 @end menu
1774
1775
1776 @node Ties
1777 @subsection Ties
1778
1779 @cindex tie
1780 @funindex ~
1781
1782 A tie connects two adjacent note heads of the same pitch.  The tie in
1783 effect extends the length of a note.  Ties should not be confused with
1784 slurs, which indicate articulation, or phrasing slurs, which indicate
1785 musical phrasing.  A tie is entered using the tilde symbol `@code{~}'
1786
1787 @lilypond[quote,ragged-right,fragment,verbatim]
1788 e' ~ e' <c' e' g'> ~ <c' e' g'>
1789 @end lilypond
1790
1791 When a tie is applied to a chord, all note heads whose pitches match
1792 are connected.  When no note heads match, no ties will be created.
1793
1794 A tie is just a way of extending a note duration, similar to the
1795 augmentation dot.  The following example shows two ways of notating
1796 exactly the same concept
1797
1798 @lilypond[quote,fragment,ragged-right]
1799 \time 3/4 c'2. c'2 ~ c'4
1800 @end lilypond
1801
1802 @noindent
1803 Ties are used either when the note crosses a bar line, or when dots
1804 cannot be used to denote the rhythm.  When using ties, larger note
1805 values should be aligned to subdivisions of the measure, such as
1806
1807 @lilypond[fragment,quote,ragged-right]
1808 \relative {
1809   r8 c8 ~ c2 r4 | r8^"not" c2 ~ c8 r4
1810 }
1811 @end lilypond
1812
1813 If you need to tie a lot of notes over bars, it may be easier to use
1814 automatic note splitting (see @ref{Automatic note splitting}).  This
1815 mechanism automatically splits long notes, and ties them across bar
1816 lines.
1817
1818 When a second alternative of a repeat starts with a tied note, you
1819 have to repeat the tie. This can be achieved with @code{\repeatTie},
1820
1821 @lilypond[fragment,quote,ragged-right,relative=2]
1822 r <c e g>\repeatTie
1823 @end lilypond
1824
1825 @cindex repeating ties
1826 @cindex volta brackets and ties
1827
1828 @commonprop
1829
1830 Ties are sometimes used to write out arpeggios.  In this case, two tied
1831 notes need not be consecutive.  This can be achieved by setting the
1832 @code{tieWaitForNote} property to true. The same feature is also useful,
1833 for example, to tie a tremolo to a chord. For example,
1834
1835 @lilypond[fragment,verbatim,relative=1,ragged-right]
1836 \set tieWaitForNote = ##t
1837 \grace { c16[~ e~ g]~ } <c, e g>2
1838 \repeat "tremolo" 8 { c32~ c'~ } <c c,>1
1839 @end lilypond
1840
1841
1842 @refcommands
1843
1844
1845 @funindex \tieUp
1846 @code{\tieUp},
1847 @funindex \tieDown
1848 @code{\tieDown},
1849 @funindex \tieNeutral
1850 @code{\tieNeutral},
1851 @funindex \tieDotted
1852 @code{\tieDotted},
1853 @funindex \tieDashed
1854 @code{\tieDashed},
1855 @funindex \tieSolid
1856 @code{\tieSolid}.
1857
1858
1859 @seealso
1860
1861 In this manual: @ref{Automatic note splitting}.
1862
1863 Program reference: @internalsref{Tie}.
1864
1865 Examples:
1866 @inputfileref{input/@/regression,tie-arpeggio.ly}
1867 @inputfileref{input/@/regression,tie-manual.ly}
1868
1869
1870
1871
1872 @refbugs
1873
1874 Switching staves when a tie is active will not produce a slanted tie.
1875
1876
1877 @node Slurs
1878 @subsection Slurs
1879
1880 @cindex Slurs
1881
1882 A slur indicates that notes are to be played bound or
1883 @emph{legato}.  They are entered using parentheses
1884
1885 @lilypond[quote,ragged-right,relative=2,fragment,verbatim]
1886 f( g a) a8 b( a4 g2 f4)
1887 <c e>2( <b d>2)
1888 @end lilypond
1889
1890 The direction of a slur can be specified with
1891 @code{\slur@emph{DIR}}, where @code{@emph{DIR}} is
1892 either @code{Up}, @code{Down}, or @code{Neutral} (automatically
1893 selected).
1894
1895 However, there is a convenient shorthand for forcing slur
1896 directions.  By adding @code{_} or @code{^} before the opening
1897 parentheses, the direction is also set.  For example,
1898
1899 @lilypond[relative=2,ragged-right,quote,verbatim,fragment]
1900 c4_( c) c^( c)
1901 @end lilypond
1902
1903 Only one slur can be printed at once.  If you need to print a long
1904 slur over a few small slurs, please see @ref{Phrasing slurs}.
1905
1906
1907 @commonprop
1908
1909 Some composers write two slurs when they want legato chords.  This can
1910 be achieved in LilyPond by setting @code{doubleSlurs},
1911
1912 @lilypond[verbatim,ragged-right,relative,fragment,quote]
1913 \set doubleSlurs = ##t
1914 <c e>4 ( <d f> <c e> <d f> )
1915 @end lilypond
1916
1917
1918 @refcommands
1919
1920 @funindex \slurUp
1921 @code{\slurUp},
1922 @funindex \slurDown
1923 @code{\slurDown},
1924 @funindex \slurNeutral
1925 @code{\slurNeutral},
1926 @funindex \slurDashed
1927 @code{\slurDashed},
1928 @funindex \slurDotted
1929 @code{\slurDotted},
1930 @funindex \slurSolid
1931 @code{\slurSolid}.
1932
1933 @seealso
1934
1935 Program reference: @seeinternals{Slur}.
1936
1937
1938 @node Phrasing slurs
1939 @subsection Phrasing slurs
1940
1941 @cindex phrasing slurs
1942 @cindex phrasing marks
1943
1944 A phrasing slur (or phrasing mark) connects notes and is used to
1945 indicate a musical sentence.  It is written using @code{\(} and @code{\)}
1946 respectively
1947
1948 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
1949 \time 6/4 c'\( d( e) f( e) d\)
1950 @end lilypond
1951
1952 Typographically, the phrasing slur behaves almost exactly like a
1953 normal slur.  However, they are treated as different objects.  A
1954 @code{\slurUp} will have no effect on a phrasing slur; instead, use
1955 @code{\phrasingSlurUp}, @code{\phrasingSlurDown}, and
1956 @code{\phrasingSlurNeutral}.
1957
1958 You cannot have simultaneous phrasing slurs.
1959
1960
1961 @refcommands
1962
1963 @funindex \phrasingSlurUp
1964 @code{\phrasingSlurUp},
1965 @funindex \phrasingSlurDown
1966 @code{\phrasingSlurDown},
1967 @funindex \phrasingSlurNeutral
1968 @code{\phrasingSlurNeutral}.
1969
1970
1971 @seealso
1972
1973 Program reference: @internalsref{PhrasingSlur}.
1974
1975
1976 @node Laissez vibrer ties
1977 @subsection Laissez vibrer ties
1978 @cindex Laissez vibrer
1979 @cindex Ties, laissez vibrer
1980
1981 L.v. ties (laissez vibrer) indicate that notes must not be damped at the
1982 end. It is used in notation for piano, harp and other string and
1983 percussion instruments. They can be entered using @code{\laissezVibrer},
1984
1985 @lilypond[fragment,ragged-right,verbatim,relative=1]
1986 <c f g>\laissezVibrer
1987 @end lilypond
1988
1989 @seealso
1990
1991 Program reference:
1992 @internalsref{LaissezVibrerTie}
1993 @internalsref{LaissezVibrerTieColumn}
1994
1995 Example files:
1996 @inputfileref{input/regression,laissez-vibrer-tie.ly}
1997
1998
1999 @node Automatic beams
2000 @subsection Automatic beams
2001
2002 LilyPond inserts beams automatically
2003
2004 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2005 \time 2/4 c8 c c c \time 6/8 c c c c8. c16 c8
2006 @end lilypond
2007
2008 When these automatic decisions are not good enough, beaming can be
2009 entered explicitly.  It is also possible to define beaming patterns
2010 that differ from the defaults.  See @ref{Setting automatic beam behavior}
2011 for details.
2012
2013 Individual notes may be marked with @code{\noBeam} to prevent them
2014 from being beamed
2015
2016 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2017 \time 2/4 c8 c\noBeam c c
2018 @end lilypond
2019
2020
2021 @seealso
2022
2023 Program reference: @internalsref{Beam}.
2024
2025
2026 @node Manual beams
2027 @subsection Manual beams
2028
2029 @cindex beams, manual
2030 @funindex ]
2031 @funindex [
2032
2033 In some cases it may be necessary to override the automatic beaming
2034 algorithm.  For example, the autobeamer will not put beams over rests
2035 or bar lines.  Such beams are specified manually by marking the begin
2036 and end point with @code{[} and @code{]}
2037
2038 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2039 {
2040   r4 r8[ g' a r8] r8 g[ | a] r8
2041 }
2042 @end lilypond
2043
2044
2045 @commonprop
2046
2047 @funindex stemLeftBeamCount
2048 @funindex stemRightBeamCount
2049
2050 Normally, beaming patterns within a beam are determined automatically.
2051 If necessary, the properties @code{stemLeftBeamCount} and
2052 @code{stemRightBeamCount} can be used to override the defaults.  If
2053 either property is set, its value will be used only once, and then it
2054 is erased
2055
2056 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2057 {
2058    f8[ r16
2059       f g a]
2060    f8[ r16
2061    \set stemLeftBeamCount = #1
2062       f g a]
2063 }
2064 @end lilypond
2065
2066 The property @code{subdivideBeams} can be set in order to subdivide
2067 all 16th or shorter beams at beat positions, as defined by the
2068 @code{beatLength} property.
2069
2070 @lilypond[fragment,quote,relative=2,verbatim]
2071 c16[ c c c c c c c]
2072 \set subdivideBeams = ##t
2073 c16[ c c c c c c c]
2074 \set Score.beatLength = #(ly:make-moment 1 8)
2075 c16[ c c c c c c c]
2076 @end lilypond
2077 @funindex subdivideBeams
2078
2079 @noindent
2080 For more information about @code{make-moment}, see
2081 @ref{Time administration}.
2082
2083 Line breaks are normally forbidden when beams cross bar lines.  This
2084 behavior can be changed by setting @code{allowBeamBreak}.
2085
2086 @funindex allowBeamBreak
2087 @cindex beams and line breaks
2088 @cindex beams, kneed
2089 @cindex kneed beams
2090 @cindex auto-knee-gap
2091
2092
2093 @refbugs
2094
2095 Kneed beams are inserted automatically when a large gap is detected
2096 between the note heads.  This behavior can be tuned through the object.
2097
2098 Automatically kneed cross-staff beams cannot be used together with
2099 hidden staves.  See @ref{Hiding staves}.
2100
2101 Beams do not avoid collisions with symbols around the notes, such as
2102 texts and accidentals.
2103
2104
2105 @node Grace notes
2106 @subsection Grace notes
2107
2108 @funindex \grace
2109 @cindex ornaments
2110 @cindex grace notes
2111 @cindex appoggiatura
2112 @cindex acciaccatura
2113
2114 Grace notes are ornaments that are written out.  The most common ones
2115 are acciaccatura, which should be played as very short.  It is denoted
2116 by a slurred small note with a slashed stem.  The appoggiatura is a
2117 grace note that takes a fixed fraction of the main note, and is
2118 denoted as a slurred note in small print without a slash.  They
2119 are entered with the commands @code{\acciaccatura} and
2120 @code{\appoggiatura}, as demonstrated in the following example
2121
2122 @lilypond[quote,ragged-right,relative=2,verbatim,fragment]
2123 b4 \acciaccatura d8 c4 \appoggiatura e8 d4
2124 \acciaccatura { g16[ f] } e4
2125 @end lilypond
2126
2127 Both are special forms of the @code{\grace} command.  By prefixing this
2128 keyword to a music expression, a new one is formed, which will be
2129 printed in a smaller font and takes up no logical time in a measure.
2130
2131 @lilypond[quote,ragged-right,relative=2,verbatim,fragment]
2132 c4 \grace c16 c4
2133 \grace { c16[ d16] } c2 c4
2134 @end lilypond
2135
2136 @noindent
2137 Unlike @code{\acciaccatura} and @code{\appoggiatura}, the
2138 @code{\grace} command does not start a slur.
2139
2140 Internally, timing for grace notes is done using a second, `grace'
2141 timing.  Every point in time consists of two rational numbers: one
2142 denotes the logical time, one denotes the grace timing.  The above
2143 example is shown here with timing tuples
2144
2145 @lilypond[quote,ragged-right]
2146 <<
2147   \relative c''{
2148     c4 \grace c16 c4 \grace {
2149     c16[ d16] } c2 c4
2150   }
2151   \new Lyrics \lyricmode {
2152     \override LyricText #'font-family = #'typewriter
2153
2154     \markup { (0,0) } 4
2155     \grace { \markup {
2156       ( \fraction 1 4 , \fraction -1 16 ) } 16 }
2157     \markup { (\fraction 1 4 , 0 ) } 4
2158     \grace {
2159       \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16
2160       \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16
2161     }
2162     \markup { ( \fraction 2 4 , 0 ) }
2163   }
2164 >>
2165 @end lilypond
2166
2167 The placement of grace notes is synchronized between different staves.
2168 In the following example, there are two sixteenth grace notes for
2169 every eighth grace note
2170
2171 @lilypond[quote,ragged-right,relative=2,verbatim,fragment]
2172 << \new Staff { e4 \grace { c16[ d e f] } e4 }
2173    \new Staff { c4 \grace { g8[ b] } c4 } >>
2174 @end lilypond
2175
2176 @funindex \afterGrace
2177
2178 If you want to end a note with a grace, use the @code{\afterGrace}
2179 command.  It takes two arguments: the main note, and the grace notes
2180 following the main note.
2181
2182 @lilypond[ragged-right, verbatim,relative=2,fragment]
2183 c1 \afterGrace d1 { c16[ d] } c4
2184 @end lilypond
2185
2186 This will put the grace notes after a ``space'' lasting 3/4 of the
2187 length of the main note.  The fraction 3/4 can be changed by setting
2188 @code{afterGraceFraction}, ie.
2189
2190 @example
2191 afterGraceFraction = #(cons 7 8)
2192 @end example
2193
2194 @noindent
2195 will put the grace note at 7/8 of the main note.
2196
2197 The same effect can be achieved manually by doing
2198
2199 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2200 \new Voice {
2201   << { d1^\trill_( }
2202      { s2 \grace { c16[ d] } } >>
2203   c4)
2204 }
2205 @end lilypond
2206
2207 @noindent
2208 By adjusting the duration of the skip note (here it is a half-note),
2209 the space between the main-note and the grace is adjusted.
2210
2211 A @code{\grace} section will introduce special typesetting settings,
2212 for example, to produce smaller type, and set directions.  Hence, when
2213 introducing layout tweaks, they should be inside the grace section,
2214 for example,
2215 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2216 \new Voice {
2217   \acciaccatura {
2218     \stemDown
2219     f16->
2220     \stemNeutral
2221   }
2222   g4
2223 }
2224 @end lilypond
2225
2226 @noindent
2227 The overrides should also be reverted inside the grace section.
2228
2229 The layout of grace sections can be changed throughout the music using
2230 the function @code{add-grace-property}.  The following example
2231 undefines the Stem direction for this grace, so stems do not always
2232 point up.
2233
2234 @example
2235 \new Staff @{
2236   #(add-grace-property 'Voice 'Stem 'direction '())
2237   @dots{}
2238 @}
2239 @end example
2240
2241 @noindent
2242 Another option is to change the variables @code{startGraceMusic},
2243 @code{stopGraceMusic}, @code{startAcciaccaturaMusic},
2244 @code{stopAcciaccaturaMusic}, @code{startAppoggiaturaMusic},
2245 @code{stopAppoggiaturaMusic}.  More information is in the file
2246 @file{ly/@/grace@/-init@/.ly}.
2247
2248 @noindent
2249 The slash through the stem in acciaccaturas can be obtained
2250 in other situations by @code{\override Stem  #'stroke-style = #"grace"}.
2251
2252 @seealso
2253
2254 Program reference: @internalsref{GraceMusic}.
2255
2256
2257 @refbugs
2258
2259 A score that starts with a @code{\grace} section needs an explicit
2260 @code{\new Voice} declaration, otherwise the main note and the grace
2261 note end up on different staves.
2262
2263 Grace note synchronization can also lead to surprises.  Staff notation,
2264 such as key signatures, bar lines, etc., are also synchronized.  Take
2265 care when you mix staves with grace notes and staves without, for example,
2266
2267 @lilypond[quote,ragged-right,relative=2,verbatim,fragment]
2268 << \new Staff { e4 \bar "|:" \grace c16 d4 }
2269    \new Staff { c4 \bar "|:" d4 } >>
2270 @end lilypond
2271
2272 @noindent
2273 This can be remedied by inserting grace skips of the corresponding
2274 durations in the other staves. For the above example
2275
2276 @example
2277 \new Staff @{ c4 \bar "|:" \grace s16 d4 @}
2278 @end example
2279
2280 Grace sections should only be used within sequential music
2281 expressions.  Nesting or juxtaposing grace sections is not supported,
2282 and might produce crashes or other errors.
2283
2284
2285
2286 @node Expressive marks
2287 @section Expressive marks
2288
2289 Expressive marks help musicians to bring more to the music than simple
2290 notes and rhythms.
2291
2292 @menu
2293 * Articulations::               
2294 * Fingering instructions::      
2295 * Dynamics::                    
2296 * Breath marks::                
2297 * Trills::                      
2298 * Glissando::                   
2299 * Arpeggio::                    
2300 @end menu
2301
2302
2303 @node Articulations
2304 @subsection Articulations
2305
2306 @cindex Articulations
2307 @cindex scripts
2308 @cindex ornaments
2309
2310 A variety of symbols can appear above and below notes to indicate
2311 different characteristics of the performance.  They are added to a note
2312 by adding a dash and the character signifying the
2313 articulation.  They are demonstrated here
2314
2315 @lilypondfile[quote,ragged-right]{script-abbreviations.ly}
2316
2317 The meanings of these shorthands can be changed.  See
2318 @file{ly/@/script@/-init@/.ly} for examples.
2319
2320 The script is automatically placed, but the direction can be forced as
2321 well.  Like other pieces of LilyPond code, @code{_} will place them
2322 below the staff, and @code{^} will place them above.
2323
2324 @lilypond[quote,ragged-right,fragment,verbatim]
2325 c''4^^ c''4_^
2326 @end lilypond
2327
2328 Other symbols can be added using the syntax
2329 @var{note}@code{\}@var{name}.  Again, they
2330 can be forced up or down using @code{^} and @code{_},
2331 e.g.,
2332
2333 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
2334 c\fermata c^\fermata c_\fermata
2335 @end lilypond
2336
2337 @cindex accent
2338 @cindex marcato
2339 @cindex staccatissimo
2340 @cindex espressivo
2341 @cindex fermata
2342 @cindex stopped
2343 @cindex staccato
2344 @cindex portato
2345 @cindex tenuto
2346 @cindex upbow
2347 @cindex downbow
2348 @cindex foot marks
2349 @cindex organ pedal marks
2350 @cindex turn
2351 @cindex open
2352 @cindex flageolet
2353 @cindex reverseturn
2354 @cindex trill
2355 @cindex prall
2356 @cindex mordent
2357 @cindex prallprall
2358 @cindex prallmordent
2359 @cindex prall, up
2360 @cindex prall, down
2361 @cindex mordent
2362 @cindex thumb marking
2363 @cindex segno
2364 @cindex coda
2365 @cindex varcoda
2366
2367 Here is a chart showing all scripts available,
2368
2369 @lilypondfile[ragged-right,quote]{script-chart.ly}
2370
2371
2372 @commonprop
2373
2374 The vertical ordering of scripts is controlled with the
2375 @code{script-priority} property.  The lower this number, the closer it
2376 will be put to the note.  In this example, the
2377 @internalsref{TextScript} (the sharp symbol) first has the lowest
2378 priority, so it is put lowest in the first example.  In the second, the
2379 prall trill (the @internalsref{Script}) has the lowest, so it is on the
2380 inside.  When two objects have the same priority, the order in which
2381 they are entered decides which one comes first.
2382
2383 @lilypond[verbatim,relative=3,ragged-right,fragment,quote]
2384 \once \override TextScript #'script-priority = #-100
2385 a4^\prall^\markup { \sharp }
2386
2387 \once \override Script #'script-priority = #-100
2388 a4^\prall^\markup { \sharp }
2389 @end lilypond
2390
2391
2392 @seealso
2393
2394 Program reference: @internalsref{Script}.
2395
2396
2397 @refbugs
2398
2399 These signs appear in the printed output but have no effect on the
2400 MIDI rendering of the music.
2401
2402
2403 @node Fingering instructions
2404 @subsection Fingering instructions
2405
2406 @cindex fingering
2407 @cindex finger change
2408
2409 Fingering instructions can be entered using
2410 @example
2411 @var{note}-@var{digit}
2412 @end example
2413 For finger changes, use markup texts
2414
2415 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
2416 c4-1 c-2 c-3 c-4
2417 c^\markup { \finger "2 - 3" }
2418 @end lilypond
2419
2420 You can use the thumb-script to indicate that a note should be
2421 played with the thumb (e.g., in cello music)
2422 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
2423 <a_\thumb a'-3>8 <b_\thumb b'-3>
2424 @end lilypond
2425
2426 Fingerings for chords can also be added to individual notes
2427 of the chord by adding them after the pitches
2428 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
2429 < c-1 e-2 g-3 b-5 >4
2430 @end lilypond
2431
2432
2433 @commonprop
2434
2435 You may exercise greater control over fingering chords by
2436 setting @code{fingeringOrientations}
2437
2438 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
2439 \set fingeringOrientations = #'(left down)
2440 <c-1 es-2 g-4 bes-5 > 4
2441 \set fingeringOrientations = #'(up right down)
2442 <c-1 es-2 g-4 bes-5 > 4
2443 @end lilypond
2444
2445 Using this feature, it is also possible to put fingering instructions
2446 very close to note heads in monophonic music,
2447
2448 @lilypond[verbatim,ragged-right,quote,fragment]
2449 \set fingeringOrientations = #'(right)
2450 <es'-2>4
2451 @end lilypond
2452
2453
2454 @seealso
2455
2456 Program reference: @internalsref{Fingering}.
2457
2458 Examples: @inputfileref{input/@/regression,finger@/-chords@/.ly}.
2459
2460
2461 @node Dynamics
2462 @subsection Dynamics
2463
2464 @cindex Dynamics
2465 @funindex \pppp
2466 @funindex \ppp
2467 @funindex \pp
2468 @funindex \p
2469 @funindex \mp
2470 @funindex \mf
2471 @funindex \f
2472 @funindex \ff
2473 @funindex \fff
2474 @funindex \ffff
2475 @funindex \fp
2476 @funindex \sf
2477 @funindex \sff
2478 @funindex \sp
2479 @funindex \spp
2480 @funindex \sfz
2481 @funindex \rfz
2482
2483 Absolute dynamic marks are specified using a command after a note
2484 @code{c4\ff}.  The available dynamic marks are @code{\ppppp},
2485 @code{\pppp}, @code{\ppp},
2486 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2487 @code{\fff}, @code{\ffff}, @code{\fp}, @code{\sf}, @code{\sff},
2488 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}.
2489
2490 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
2491 c\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
2492 c2\fp c\sf c\sff c\sp c\spp c\sfz c\rfz
2493 @end lilypond
2494
2495 @funindex \<
2496 @funindex \>
2497 @funindex \!
2498
2499 A crescendo mark is started with @code{\<} and terminated with
2500 @code{\!} or an absolute dynamic.  A decrescendo is started with
2501 @code{\>} and is also terminated with @code{\!} or an absolute
2502 dynamic.  @code{\cr} and @code{\decr} may be used instead of
2503 @code{\<} and @code{\>}.  Because these marks are bound to notes, you must
2504 use spacer notes if multiple marks are needed during one note
2505
2506 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2507 c\< c\! d\> e\!
2508 << f1 { s4 s4\< s4\! \> s4\! } >>
2509 @end lilypond
2510
2511 @noindent
2512 A hairpin starts at the left edge of the beginning note and ends on the
2513 right edge of the ending note.
2514
2515 In some situations the @code{\espressivo} articulation mark may
2516 be suitable to indicate a crescendo and decrescendo on the one note,
2517
2518 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2519 c2 b4 a g1\espressivo
2520 @end lilypond
2521
2522 This may give rise to very short hairpins.  Use @code{minimum-length}
2523 in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for
2524 example
2525
2526 @example
2527 \override Staff.Hairpin #'minimum-length = #5
2528 @end example
2529
2530 @cindex crescendo
2531 @cindex decrescendo
2532 @cindex diminuendo
2533
2534 You can also use a text saying @emph{cresc.} instead of hairpins
2535
2536 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
2537 \setTextCresc
2538 c\< d e f\!
2539 \setHairpinCresc
2540 e\> d c b\!
2541 \setTextDecresc
2542 c\> d e f\!
2543 \setTextDim
2544 e\> d c b\!
2545 @end lilypond
2546
2547 You can also supply your own texts
2548 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2549 \set crescendoText = \markup { \italic "cresc. poco" }
2550 \set crescendoSpanner = #'dashed-line
2551 a'2\< a a a\!\mf
2552 @end lilypond
2553
2554 To create new dynamic marks or text that should be aligned
2555 with dynamics, see @ref{New dynamic marks}.
2556
2557
2558 @commonprop
2559
2560 Dynamics that occur at, begin on, or end on, the same note
2561 will be vertically aligned.  If you want to ensure that dynamics
2562 are aligned when they do not occur on the same note, you can
2563 increase the @code{staff-padding} property.
2564
2565 @example
2566 \override DynamicLineSpanner #'staff-padding = #4
2567 @end example
2568
2569 You may also use this property if the dynamics are colliding
2570 with other notation.
2571
2572 Crescendi and decrescendi that end on the first note of a
2573 new line are not printed.  To change this behavior, use
2574
2575 @example
2576 \override Score.Hairpin #'after-line-breaking = ##t
2577 @end example
2578
2579 Text style dynamic changes (such as cresc. and dim.) are printed with a
2580 dashed line showing their extent.  To surpress printing this line, use
2581
2582 @example
2583 \override DynamicTextSpanner #'dash-period = #-1.0
2584 @end example
2585
2586
2587 @refcommands
2588
2589 @funindex \dynamicUp
2590 @code{\dynamicUp},
2591 @funindex \dynamicDown
2592 @code{\dynamicDown},
2593 @funindex \dynamicNeutral
2594 @code{\dynamicNeutral}.
2595
2596
2597 @seealso
2598
2599 Program reference: @internalsref{DynamicText}, @internalsref{Hairpin}.
2600 Vertical positioning of these symbols is handled by
2601 @internalsref{DynamicLineSpanner}.
2602
2603
2604 @node Breath marks
2605 @subsection Breath marks
2606
2607 Breath marks are entered using @code{\breathe}
2608
2609 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2610 c'4 \breathe d4
2611 @end lilypond
2612
2613
2614 @commonprop
2615
2616 The glyph of the breath mark can be tuned by overriding the
2617 @code{text} property of the @code{BreathingSign} layout object with
2618 any markup text.  For example,
2619 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
2620 c'4
2621 \override BreathingSign #'text
2622   = #(make-musicglyph-markup "scripts.rvarcomma")
2623 \breathe
2624 d4
2625 @end lilypond
2626
2627 @seealso
2628
2629 Program reference: @internalsref{BreathingSign}.
2630
2631 Examples: @inputfileref{input/@/regression,breathing@/-sign@/.ly}.
2632
2633
2634 @node Trills
2635 @subsection Trills
2636
2637 Short trills are printed like normal articulation; see @ref{Articulations}.
2638
2639 Long running trills are made with @code{\startTrillSpan} and
2640 @code{\stopTrillSpan},
2641
2642 @lilypond[verbatim,ragged-right,relative=2,quote,fragment]
2643 \new Voice {
2644   << { c1 \startTrillSpan }
2645      { s2. \grace { d16[\stopTrillSpan e] } } >>
2646   c4 }
2647 @end lilypond
2648
2649 @cindex Pitched trills
2650
2651 Trills that should be executed on an explicitly specified pitch can be
2652 typeset with the command @code{pitchedTrill},
2653
2654 @lilypond[ragged-right,verbatim,fragment,relative=1]
2655 \pitchedTrill c4\startTrillSpan fis
2656 f\stopTrillSpan
2657 @end lilypond
2658
2659 The first argument is the main note.  The pitch of the second
2660 is printed as a stemless note head in parentheses.
2661
2662
2663 @refcommands
2664
2665 @code{\startTrillSpan},
2666 @funindex \startTrillSpan
2667 @code{\stopTrillSpan}.
2668 @funindex \stopTrillSpan
2669
2670
2671 @seealso
2672
2673 Program reference: @internalsref{TrillSpanner}.
2674
2675
2676 @node Glissando
2677 @subsection Glissando
2678
2679 @cindex Glissando
2680 @funindex \glissando
2681
2682 A glissando is a smooth change in pitch.  It is denoted by a line or a
2683 wavy line between two notes.  It is requested by attaching
2684 @code{\glissando} to a note
2685
2686 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
2687 c2\glissando c'
2688 \override Glissando #'style = #'zigzag
2689 c2\glissando c,
2690 @end lilypond
2691
2692
2693 @seealso
2694
2695 Program reference: @internalsref{Glissando}.
2696
2697 Example files: @file{input/@/regression/@/glissando@/.ly}.
2698
2699
2700 @refbugs
2701
2702 Printing text over the line (such as @emph{gliss.}) is not supported.
2703
2704
2705 @node Arpeggio
2706 @subsection Arpeggio
2707
2708 @cindex Arpeggio
2709 @cindex broken chord
2710 @funindex \arpeggio
2711
2712 You can specify an arpeggio sign (also known as broken chord) on a
2713 chord by attaching an @code{\arpeggio} to a chord
2714
2715 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2716 <c e g c>\arpeggio
2717 @end lilypond
2718
2719 A square bracket on the left indicates that the player should not
2720 arpeggiate the chord
2721
2722 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2723 \arpeggioBracket
2724 <c' e g c>\arpeggio
2725 @end lilypond
2726
2727 The direction of the arpeggio is sometimes denoted by adding an
2728 arrowhead to the wiggly line
2729
2730 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2731 \new Voice {
2732   \arpeggioUp
2733   <c e g c>\arpeggio
2734   \arpeggioDown
2735   <c e g c>\arpeggio
2736 }
2737 @end lilypond
2738
2739
2740 @commonprop
2741
2742 When an arpeggio crosses staves, you may attach an arpeggio to the chords
2743 in both staves and set
2744 @internalsref{PianoStaff}.@code{connectArpeggios}
2745
2746 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2747 \new PianoStaff <<
2748   \set PianoStaff.connectArpeggios = ##t
2749   \new Staff { <c' e g c>\arpeggio }
2750   \new Staff { \clef bass <c,, e g>\arpeggio }
2751 >>
2752 @end lilypond
2753
2754
2755 @refcommands
2756
2757 @code{\arpeggio},
2758 @funindex \arpeggioUp
2759 @code{\arpeggioUp},
2760 @funindex \arpeggioDown
2761 @code{\arpeggioDown},
2762 @funindex \arpeggioNeutral
2763 @code{\arpeggioNeutral},
2764 @funindex \arpeggioBracket
2765 @code{\arpeggioBracket}.
2766
2767
2768 @seealso
2769
2770 Notation manual: @ref{Ties}, for writing out arpeggios.
2771
2772 Program reference: @internalsref{Arpeggio}.
2773
2774
2775 @refbugs
2776
2777 It is not possible to mix connected arpeggios and unconnected
2778 arpeggios in one @internalsref{PianoStaff} at the same point in time.
2779
2780
2781
2782
2783
2784 @node Repeats
2785 @section Repeats
2786
2787 Repetition is a central concept in music, and multiple notations exist
2788 for repetitions.
2789
2790 @menu
2791 * Repeat types::                
2792 * Repeat syntax::               
2793 * Repeats and MIDI::            
2794 * Manual repeat commands::      
2795 * Tremolo repeats::             
2796 * Tremolo subdivisions::        
2797 * Measure repeats::             
2798 @end menu
2799
2800
2801 @node Repeat types
2802 @subsection Repeat types
2803
2804 @cindex repeats
2805 @funindex \repeat
2806
2807 The following types of repetition are supported
2808
2809 @table @code
2810 @item unfold
2811 Repeated music is fully written (played) out.  This is useful when
2812 entering repetitious music.  This is the only kind of repeat that
2813 is included in MIDI output.
2814
2815 @item volta
2816 Repeats are not written out, but alternative endings (volte) are
2817 printed, left to right with brackets.  This is the standard notation
2818 for repeats with alternatives.  These are not played in MIDI output by
2819 default.
2820
2821 @ignore
2822 @item fold
2823 Alternative endings are written stacked.  This has limited use but may be
2824 used to typeset two lines of lyrics in songs with repeats, see
2825 @inputfileref{input,star-spangled-banner@/.ly}.
2826 @end ignore
2827
2828 @item tremolo
2829 Make tremolo beams.  These are not played in MIDI output by default.
2830
2831 @item percent
2832 Make beat or measure repeats.  These look like percent signs.  These
2833 are not played in MIDI output by default.  Percent repeats must be
2834 declared within a Voice context.
2835
2836 @end table
2837
2838
2839 @node Repeat syntax
2840 @subsection Repeat syntax
2841
2842 LilyPond has one syntactic construct for specifying different types of
2843 repeats.  The syntax is
2844
2845 @example
2846 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2847 @end example
2848
2849 If you have alternative endings, you may add
2850 @funindex \alternative
2851 @example
2852 \alternative @{
2853   @var{alternative1}
2854   @var{alternative2}
2855   @var{alternative3}
2856   @dots{}
2857 @}
2858 @end example
2859
2860 @noindent
2861 where each @var{alternative} is a music expression.  If you do not
2862 give enough alternatives for all of the repeats, the first alternative
2863 is assumed to be played more than once.
2864
2865 Standard repeats are used like this
2866 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2867 c1
2868 \repeat volta 2 { c4 d e f }
2869 \repeat volta 2 { f e d c }
2870 @end lilypond
2871
2872 With alternative endings
2873 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2874 c1
2875 \repeat volta 2 {c4 d e f}
2876 \alternative { {d2 d} {f f,} }
2877 @end lilypond
2878
2879 In this example, the first ending is not a complete bar (it
2880 only had 3 beats).  The beginning of the second ending
2881 contains the 4th beat from the first ending.  This ``extra''
2882 beat in the second ending is due to the first time ending,
2883 and has nothing to do with the @code{\partial} at the
2884 beginning of the example.
2885
2886 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2887 \new Staff {
2888   \partial 4
2889   \repeat volta 4 { e | c2 d2 | e2 f2 | }
2890   \alternative { { g4 g g } { a | a a a a | b2. } }
2891 }
2892 @end lilypond
2893
2894 It is possible to shorten volta brackets
2895 by setting @code{voltaSpannerDuration}.  In the next example, the
2896 bracket only lasts one measure, which is a duration of 3/4.
2897
2898 @lilypond[verbatim,ragged-right,quote]
2899 \relative c''{
2900   \time 3/4
2901   c c c
2902   \set Staff.voltaSpannerDuration = #(ly:make-moment 3 4)
2903   \repeat "volta" 5 { d d d }
2904   \alternative { { e e e f f f }
2905   { g g g } }
2906 }
2907 @end lilypond
2908
2909
2910 @seealso
2911
2912 Examples:
2913
2914 Brackets for the repeat are normally only printed over the topmost
2915 staff.  This can be adjusted by setting the @code{voltaOnThisStaff}
2916 property; see @inputfileref{input/@/regression,volta@/-multi@/-staff@/.ly}.
2917
2918
2919 @refbugs
2920
2921 @cindex repeat, ambiguous
2922
2923 A nested repeat like
2924
2925 @example
2926 \repeat @dots{}
2927 \repeat @dots{}
2928 \alternative
2929 @end example
2930
2931 @noindent
2932 is ambiguous, since it is is not clear to which @code{\repeat} the
2933 @code{\alternative} belongs.  This ambiguity is resolved by always
2934 having the @code{\alternative} belong to the inner @code{\repeat}.
2935 For clarity, it is advisable to use braces in such situations.
2936
2937 Timing information is not remembered at the start of an alternative,
2938 so after a repeat timing information must be reset by hand, for
2939 example by setting @code{Score.measurePosition} or entering
2940 @code{\partial}.  Similarly, slurs or ties are also not repeated.
2941
2942
2943 @node Repeats and MIDI
2944 @subsection Repeats and MIDI
2945
2946 @cindex expanding repeats
2947 @funindex \unfoldRepeats
2948
2949 With a little bit of tweaking, all types of repeats can be present
2950 in the MIDI output.  This is achieved by applying the
2951 @code{\unfoldRepeats} music function.  This functions changes all
2952 repeats to unfold repeats.
2953
2954 @lilypond[quote,verbatim,fragment,line-width=8.0\cm]
2955 \unfoldRepeats {
2956   \repeat tremolo 8 {c'32 e' }
2957   \repeat percent 2 { c''8 d'' }
2958   \repeat volta 2 {c'4 d' e' f'}
2959   \alternative {
2960     { g' a' a' g' }
2961     {f' e' d' c' }
2962   }
2963 }
2964 \bar "|."
2965 @end lilypond
2966
2967 When creating a score file using @code{\unfoldRepeats} for midi, then
2968 it is necessary to make two @code{\score} blocks.  One for MIDI (with
2969 unfolded repeats) and one for notation (with volta, tremolo, and
2970 percent repeats).  For example,
2971
2972 @example
2973 \score @{
2974   @var{..music..}
2975   \layout @{ .. @}
2976 @}
2977 \score @{
2978   \unfoldRepeats @var{..music..}
2979   \midi @{ .. @}
2980 @}
2981 @end example
2982
2983
2984 @node Manual repeat commands
2985 @subsection Manual repeat commands
2986
2987 @funindex repeatCommands
2988
2989 The property @code{repeatCommands} can be used to control the layout of
2990 repeats.  Its value is a Scheme list of repeat commands.
2991
2992 @table @asis
2993 @item @code{start-repeat}
2994 Print a @code{|:} bar line.
2995
2996 @item @code{end-repeat}
2997 Print a @code{:|} bar line.
2998
2999 @item @code{(volta @var{text})}
3000 Print a volta bracket saying @var{text}: The text can be specified as
3001 a text string or as a markup text, see @ref{Text markup}.  Do not
3002 forget to change the font, as the default number font does not contain
3003 alphabetic characters;
3004
3005 @item @code{(volta #f)}
3006 Stop a running volta bracket.
3007 @end table
3008
3009 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
3010 c4
3011   \set Score.repeatCommands = #'((volta "93") end-repeat)
3012 c4 c4
3013   \set Score.repeatCommands = #'((volta #f))
3014 c4 c4
3015 @end lilypond
3016
3017
3018 @seealso
3019
3020 Program reference: @internalsref{VoltaBracket},
3021 @internalsref{RepeatedMusic},
3022 @internalsref{VoltaRepeatedMusic},
3023 @internalsref{UnfoldedRepeatedMusic}, and
3024 @internalsref{FoldedRepeatedMusic}.
3025
3026
3027 @node Tremolo repeats
3028 @subsection Tremolo repeats
3029
3030 @cindex tremolo beams
3031
3032 To place tremolo marks between notes, use @code{\repeat} with tremolo
3033 style
3034 @lilypond[quote,verbatim,ragged-right]
3035 \new Voice \relative c' {
3036   \repeat "tremolo" 8 { c16 d16 }
3037   \repeat "tremolo" 4 { c16 d16 }
3038   \repeat "tremolo" 2 { c16 d16 }
3039 }
3040 @end lilypond
3041
3042 Tremolo marks can also be put on a single note.  In this case, the
3043 note should not be surrounded by braces.
3044 @lilypond[quote,verbatim,ragged-right]
3045 \repeat "tremolo" 4 c'16
3046 @end lilypond
3047
3048 Similar output is obtained using the tremolo subdivision, described in
3049 @ref{Tremolo subdivisions}.
3050
3051
3052 @seealso
3053
3054 In this manual: @ref{Tremolo subdivisions}, @ref{Repeats}.
3055
3056 Program reference: @internalsref{Beam}, @internalsref{StemTremolo}.
3057
3058 Example files: @inputfileref{input/@/regression,chord@/-tremolo@/.ly},
3059 @inputfileref{input/@/regression,stem@/-tremolo@/.ly}.
3060
3061
3062 @node Tremolo subdivisions
3063 @subsection Tremolo subdivisions
3064
3065 @cindex tremolo marks
3066 @funindex tremoloFlags
3067
3068 Tremolo marks can be printed on a single note by adding
3069 `@code{:}[@var{number}]' after the note.  The number indicates the
3070 duration of the subdivision, and it must be at least 8.  A
3071 @var{length} value of 8 gives one line across the note stem.  If the
3072 length is omitted, the last value (stored in @code{tremoloFlags}) is
3073 used
3074
3075 @lilypond[quote,ragged-right,verbatim,fragment]
3076 c'2:8 c':32 | c': c': |
3077 @end lilypond
3078
3079
3080 @refbugs
3081
3082 Tremolos entered in this way do not carry over into the MIDI output.
3083
3084
3085 @seealso
3086
3087 In this manual: @ref{Tremolo repeats}.
3088
3089 Elsewhere: @internalsref{StemTremolo}.
3090
3091
3092 @node Measure repeats
3093 @subsection Measure repeats
3094
3095 @cindex percent repeats
3096 @cindex measure repeats
3097
3098 In the @code{percent} style, a note pattern can be repeated.  It is
3099 printed once, and then the pattern is replaced with a special sign.
3100 Patterns of one and two measures are replaced by percent-like signs,
3101 patterns that divide the measure length are replaced by slashes.
3102 Percent repeats must be declared within a @code{Voice} context.
3103
3104 @lilypond[quote,verbatim,ragged-right]
3105 \new Voice \relative c' {
3106   \repeat "percent" 4 { c4 }
3107   \repeat "percent" 2 { c2 es2 f4 fis4 g4 c4 }
3108 }
3109 @end lilypond
3110
3111 Measure repeats of more than 2 measures get a counter, if you switch
3112 on the @code{countPercentRepeats} property,
3113
3114 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
3115 \new Voice {
3116 \set countPercentRepeats = ##t
3117   \repeat "percent" 4 { c1 }
3118 }
3119 @end lilypond
3120
3121
3122
3123 Isolated percents can also be printed. This is done by putting a multi
3124 measure rest with a different print function,
3125
3126 @lilypond[fragment,verbatim]
3127 \override MultiMeasureRest #'stencil
3128   = #ly:multi-measure-rest::percent
3129 R1
3130 @end lilypond
3131
3132
3133
3134
3135 @seealso
3136
3137 Program reference: @internalsref{RepeatSlash},
3138 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
3139 @internalsref{DoublePercentRepeatCounter},
3140 @internalsref{PercentRepeatCounter},
3141 @internalsref{PercentRepeatedMusic}.
3142
3143
3144