1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
4 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. See TRANSLATION for details.
11 @c A menu is needed before every deeper *section nesting of @node's; run
12 @c M-x texinfo-all-menus-update
13 @c to automatically fill in these menus before saving changes
16 @chapter Basic notation
18 This chapter explains how to use basic notation features.
32 @unnumberedsubsubsec Rests
38 Rests are entered like notes with the note name @code{r}
40 @lilypond[fragment,quote,ragged-right,verbatim]
44 Whole bar rests, centered in middle of the bar,
45 must be done with multi-measure rests. They can be used for a
46 single bar as well as many bars, and are discussed in
47 @ref{Multi measure rests}.
49 To explicitly specify a rest's vertical position, write a note
50 followed by @code{\rest}. A rest will be placed in the position
51 where the note would appear,
53 @lilypond[fragment,quote,ragged-right,verbatim]
58 This makes manual formatting of
59 polyphonic music much easier, since the automatic rest collision
60 formatter will leave these rests alone.
64 Program reference: @internalsref{Rest}.
68 @unnumberedsubsubsec Skips
71 @cindex Invisible rest
76 An invisible rest (also called a @q{skip}) can be entered like a note
77 with note name @samp{s} or with @code{\skip @var{duration}}
79 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
80 a4 a4 s4 a4 \skip 1 a4
83 The @code{s} syntax is only available in note mode and chord mode. In
84 other situations, for example, when entering lyrics, you should use
85 the @code{\skip} command
87 @lilypond[quote,ragged-right,verbatim]
90 \new Lyrics \lyricmode { \skip 2 bla2 }
94 The skip command is merely an empty musical placeholder. It does not
95 produce any output, not even transparent output.
97 The @code{s} skip command does create @internalsref{Staff} and
98 @internalsref{Voice} when necessary, similar to note and rest
99 commands. For example, the following results in an empty staff.
101 @lilypond[quote,ragged-right,verbatim]
105 The fragment @code{@{ \skip 4 @} } would produce an empty page.
109 Program reference: @internalsref{SkipMusic}.
116 This section discusses rhythms, durations, and bars.
120 * Augmentation dots::
122 * Scaling durations::
125 * Automatic note splitting::
130 @unnumberedsubsubsec Durations
137 In Note, Chord, and Lyrics mode, durations are designated by numbers and
138 dots: durations are entered as their reciprocal values. For example, a
139 quarter note is entered using a @code{4} (since it is a 1/4 note), while
140 a half note is entered using a @code{2} (since it is a 1/2 note). For
141 notes longer than a whole you must use the @code{\longa} and
142 @code{\breve} commands
146 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
148 r1 r2 r4 r8 r16 r32 r64 r64
154 a\breve*1/2 \autoBeamOff
155 a1 a2 a4 a8 a16 a32 a64 a64
158 r\longa*1/4 r\breve *1/2
159 r1 r2 r4 r8 r16 r32 r64 r64
166 \remove "Bar_number_engraver"
170 \remove "Clef_engraver"
171 \override StaffSymbol #'transparent = ##t
172 \override TimeSignature #'transparent = ##t
173 \override BarLine #'transparent = ##t
174 \consists "Pitch_squash_engraver"
180 If the duration is omitted then it is set to the previously entered
181 duration. The default for the first note is a quarter note.
183 @lilypond[quote,ragged-right,verbatim,fragment]
184 { a a a2 a a4 a a1 a }
188 @anchor{Augmentation dots}
189 @unnumberedsubsubsec Augmentation dots
193 To obtain dotted note lengths, simply add a dot (@samp{.}) to
194 the number. Double-dotted notes are produced in a similar way.
196 @lilypond[quote,ragged-right,fragment,verbatim]
197 a'4 b' c''4. b'8 a'4. b'4.. c''8.
202 Dots are normally moved up to avoid staff lines, except in polyphonic
203 situations. The following commands may be used to force a particular
210 @funindex \dotsNeutral
215 Program reference: @internalsref{Dots}, and @internalsref{DotColumn}.
219 @unnumberedsubsubsec Tuplets
225 Tuplets are made out of a music expression by multiplying all durations
229 \times @var{fraction} @var{musicexpr}
233 The duration of @var{musicexpr} will be multiplied by the fraction.
234 The fraction's denominator will be printed over the notes, optionally
235 with a bracket. The most common tuplet is the triplet in which 3
236 notes have the length of 2, so the notes are 2/3 of their written
239 @lilypond[quote,ragged-right,fragment,verbatim]
240 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
243 Tuplets may be nested, for example,
245 @lilypond[fragment,ragged-right,verbatim,relative=2]
246 \override TupletNumber #'text = #tuplet-number::calc-fraction-text
249 \times 3/5 { a a a a a }
257 @funindex \tupletDown
259 @funindex \tupletNeutral
260 @code{\tupletNeutral}.
265 @funindex tupletNumberFormatFunction
266 @cindex tuplet formatting
268 The property @code{tupletSpannerDuration} specifies how long each
269 bracket should last. With this, you can make lots of tuplets while
270 typing @code{\times} only once, thus saving lots of typing. In the next
271 example, there are two triplets shown, while @code{\times} was only
274 @lilypond[quote,fragment,relative=2,ragged-right,verbatim]
275 \set tupletSpannerDuration = #(ly:make-moment 1 4)
276 \times 2/3 { c8 c c c c c }
280 For more information about @code{make-moment}, see
281 @ref{Time administration}.
283 The format of the number is determined by the property @code{text} in
284 @code{TupletNumber}. The default prints only the denominator, but if
285 it is set to the function @code{tuplet-number::calc-fraction-text},
286 @var{num}:@var{den} will be printed instead.
288 To avoid printing tuplet numbers, use
290 @lilypond[quote,fragment,relative=2,ragged-right,verbatim]
291 \times 2/3 { c8 c c } \times 2/3 { c8 c c }
292 \override TupletNumber #'transparent = ##t
293 \times 2/3 { c8 c c } \times 2/3 { c8 c c }
296 Use the @code{\tweak} function to override nested tuplets beginning at the
297 same music moment. In this example, @code{\tweak} specifies fraction
299 outer @code{TupletNumber} and denominator text for the @code{TupletNumber}
300 of the first of the three inner tuplets.
302 @lilypond[quote,ragged-right,verbatim]
304 \tweak #'text #tuplet-number::calc-fraction-text
306 \tweak #'text #tuplet-number::calc-denominator-text
307 \times 2/3 { c'8[ c'8 c'8] }
308 \times 2/3 { c'8[ c'8 c'8] }
309 \times 2/3 { c'8[ c'8 c'8] }
314 Here @code{\tweak} and @code{\override} work together to specify
315 @code{TupletBracket} direction. The first @code{\tweak} positions
316 the @code{TupletBracket} of the outer
317 tuplet above the staff. The second @code{\tweak} positions the
318 @code{TupletBracket} of the first of the three inner tuplets below the
319 staff. Note that this pair of @code{\tweak} functions affects only
320 the outer tuplet and the first of the three inner tuplets because only
321 those two tuplets begin at the same music moment. We use @code{\override}
322 in the usual way to position the @code{TupletBrackets} of
323 the second and third of the inner tuplets below the staff.
325 @lilypond[quote,ragged-right,verbatim]
327 \tweak #'text #tuplet-number::calc-fraction-text
328 \tweak #'direction #up
330 \tweak #'direction #down
331 \times 2/3 { c'8[ c'8 c'8] }
332 \override TupletBracket #'direction = #down
333 \times 2/3 { c'8[ c'8 c'8] }
334 \times 2/3 { c'8[ c'8 c'8] }
339 Tuplet brackets can be made to run to prefatory matter or
342 @lilypond[ragged-right]
344 \set tupletFullLength = ##t
349 \set tupletFullLengthNote = ##t
362 Program reference: @internalsref{TupletBracket},
363 @internalsref{TupletNumber}, and @internalsref{TimeScaledMusic}.
367 @anchor{Scaling durations}
368 @unnumberedsubsubsec Scaling durations
370 You can alter the length of duration by a fraction @var{N/M}
371 appending @samp{*@var{N/M}} (or @samp{*@var{N}} if @var{M=1}). This
372 will not affect the appearance of the notes or rests produced. These
373 may be combined such as @samp{*M*N}.
375 In the following example, the first three notes take up exactly two
376 beats, but no triplet bracket is printed.
378 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
380 a4*2/3 gis4*2/3 a4*2/3
388 This manual: @ref{Tuplets}.
392 @unnumberedsubsubsec Bar check
395 @funindex barCheckSynchronize
398 Bar checks help detect errors in the durations. A bar check is
399 entered using the bar symbol, @samp{|}. Whenever it is encountered
400 during interpretation, it should fall on a measure boundary. If it
401 does not, a warning is printed. In the next example, the second bar
402 check will signal an error
404 \time 3/4 c2 e4 | g2 |
407 Bar checks can also be used in lyrics, for example
412 Twin -- kle | Twin -- kle
416 Failed bar checks are caused by entering incorrect
417 durations. Incorrect durations often completely garble up the score,
418 especially if the score is polyphonic, so a good place to start correcting
419 input is by scanning for failed bar checks and incorrect durations.
424 It is also possible to redefine the meaning of @code{|}. This is done
425 by assigning a music expression to @code{pipeSymbol},
427 @lilypond[quote,ragged-right,verbatim]
428 pipeSymbol = \bar "||"
434 @anchor{Barnumber check}
435 @unnumberedsubsubsec Barnumber check
437 When copying large pieces of music, it can be helpful to check that
438 the LilyPond bar number corresponds to the original that you are
439 entering from. This can be checked with @code{\barNumberCheck}, for
447 will print a warning if the @code{currentBarNumber} is not 123 when it
451 @anchor{Automatic note splitting}
452 @unnumberedsubsubsec Automatic note splitting
454 Long notes can be converted automatically to tied notes. This is done
455 by replacing the @internalsref{Note_heads_engraver} by the
456 @internalsref{Completion_heads_engraver}.
457 In the following examples, notes crossing the bar line are split and tied.
459 @lilypond[quote,fragment,verbatim,relative=1,line-width=12\cm]
461 \remove "Note_heads_engraver"
462 \consists "Completion_heads_engraver"
464 c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2
468 This engraver splits all running notes at the bar line, and inserts
469 ties. One of its uses is to debug complex scores: if the measures are
470 not entirely filled, then the ties exactly show how much each measure
473 If you want to allow line breaking on the bar lines where
474 @internalsref{Completion_heads_engraver} splits notes, you must
475 also remove @internalsref{Forbid_line_break_engraver}.
480 Not all durations (especially those containing tuplets) can be
481 represented exactly with normal notes and dots, but the engraver will
484 @code{Completion_heads_engraver} only affects notes; it does not split
490 Program reference: @internalsref{Completion_heads_engraver}.
496 Polyphony in music refers to having more than one voice occurring in
497 a piece of music. Polyphony in LilyPond refers to having more than
498 one voice on the same staff.
504 * Explicitly instantiating voices::
505 * Collision Resolution::
510 @unnumberedsubsubsec Chords
514 A chord is formed by a enclosing a set of pitches between @code{<}
515 and @code{>}. A chord may be followed by a duration, and a set of
516 articulations, just like simple notes
518 @lilypond[verbatim,ragged-right,fragment,quote,relative=1]
522 For more information about chords, see @ref{Chord names}.
525 @c I don't like having this here, but I can't think of
526 @c anywhere else to put it. :( -gp
528 @unnumberedsubsubsec Stems
530 Whenever a note is found, a @internalsref{Stem} object is created
531 automatically. For whole notes and rests, they are also created but
540 @funindex \stemNeutral
546 To change the direction of stems in the middle of the staff, use
548 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
550 \override Stem #'neutral-direction = #up
552 \override Stem #'neutral-direction = #down
557 @anchor{Basic polyphony}
558 @unnumberedsubsubsec Basic polyphony
562 The easiest way to enter fragments with more than one voice on a staff
563 is to enter each voice as a sequence (with @code{@{...@}}), and combine
564 them simultaneously, separating the voices with @code{\\}
568 @lilypond[quote,verbatim,fragment]
569 \new Staff \relative c' {
572 { g4 f e | d2 e2 } \\
573 { r8 e4 d c8 ~ | c b16 a b8 g ~ g2 } \\
579 The separator causes @internalsref{Voice} contexts@footnote{Polyphonic
580 voices are sometimes called @q{layers} in other notation packages}
582 to be instantiated. They bear the names @code{"1"}, @code{"2"}, etc. In
583 each of these contexts, vertical direction of slurs, stems, etc., is set
586 These voices are all separate from the voice that contains the notes just
587 outside the @code{<< \\ >>} construct. This should be noted when making
588 changes at the voice level. This also means that slurs and ties cannot go
589 into or out of a @code{<< \\ >>} construct. Conversely, parallel voices
590 from separate @code{<< \\ >>} constructs on the same staff are the
591 same voice. Here is the same example, with different noteheads and
593 voice. Note that the change to the note-head style in the main voice does
595 the inside of the @code{<< \\ >>} constructs. Also, the change to the
597 voice in the first @code{<< \\ >>} construct is effective in the second
598 @code{<< \\ >>}, and the voice is tied across the two constructs.
600 @cindex note heads, styles
602 @lilypond[quote,verbatim,fragment]
603 \new Staff \relative c' {
604 \override NoteHead #'style = #'cross
605 \override NoteHead #'color = #red
609 { \override NoteHead #'style = #'triangle
610 \override NoteHead #'color = #blue
615 { c8 b16 a b8 g ~ g2 } \\
616 { \override NoteHead #'style = #'slash
617 \override NoteHead #'color = #green
623 Polyphony does not change the relationship of notes within a
624 @code{\relative @{ @}} block. Each note is calculated relative
625 to the note immediately preceding it.
628 \relative @{ noteA << noteB \\ noteC >> noteD @}
631 @code{noteC} is relative to @code{noteB}, not @code{noteA};
632 @code{noteD} is relative to @code{noteC}, not @code{noteB} or
636 @anchor{Explicitly instantiating voices}
637 @unnumberedsubsubsec Explicitly instantiating voices
639 @internalsref{Voice} contexts can also be instantiated manually
640 inside a @code{<< >>} block to create polyphonic music, using
641 @code{\voiceOne}, up to @code{\voiceFour} to assign stem directions
642 and a horizontal shift for each part.
646 << \upper \\ \lower >>
654 \new Voice = "1" @{ \voiceOne \upper @}
655 \new Voice = "2" @{ \voiceTwo \lower @}
659 The @code{\voiceXXX} commands set the direction of stems, slurs, ties,
660 articulations, text annotations, augmentation dots of dotted
661 notes, and fingerings. @code{\voiceOne} and @code{\voiceThree} make
662 these objects point upwards, while @code{\voiceTwo} and @code{\voiceFour}
663 make them point downwards.
664 The command @code{\oneVoice} will revert back to the normal setting.
666 An expression that appears directly inside a @code{<< >>} belongs to
667 the main voice. This is useful when extra voices appear while the main
668 voice is playing. Here is a more correct rendition of the example from
669 the previous section. The crossed colored noteheads demonstrate that the main
670 melody is now in a single voice context.
672 @lilypond[quote,ragged-right,verbatim]
673 \new Staff \relative c' {
674 \override NoteHead #'style = #'cross
675 \override NoteHead #'color = #red
680 \new Voice="1" { \voiceTwo
681 r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
684 \new Voice { \voiceThree
693 The correct definition of the voices allows the melody to be slurred.
694 @lilypond[quote,ragged-right,verbatim]
695 \new Staff \relative c' {
700 \context Voice="1" { \voiceTwo
701 r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
704 \new Voice { \voiceThree
713 Avoiding the @code{\\} separator also allows nesting polyphony
714 constructs, which in some case might be a more natural way to typeset
717 @lilypond[quote,ragged-right,verbatim]
718 \new Staff \relative c' {
723 \context Voice="1" { \voiceTwo
727 \new Voice { \voiceThree
739 In some instances of complex polyphonic music, you may need additional
740 voices to avoid collisions between notes. Additional voices are added
741 by defining an identifier, as shown below:
743 @lilypond[quote,verbatim,ragged-right,relative=2]
744 voiceFive = #(context-spec-music (make-voice-props-set 4) 'Voice)
747 { \voiceOne g4 ~ \stemDown g32[ f( es d c b a b64 )g] } \\
755 @anchor{Collision Resolution}
756 @unnumberedsubsubsec Collision Resolution
758 Normally, note heads with a different number of dots are not merged, but
759 when the object property @code{merge-differently-dotted} is set in
760 the @internalsref{NoteCollision} object, they are merged:
762 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
765 \override Staff.NoteCollision
766 #'merge-differently-dotted = ##t
768 } \\ { g8.[ f16] g8.[ f16] } >>
771 Similarly, you can merge half note heads with eighth notes, by setting
772 @code{merge-differently-headed}:
774 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
777 \override Staff.NoteCollision
778 #'merge-differently-headed = ##t
779 c8 c4. } \\ { c2 c2 } >>
783 @code{merge-differently-headed} and @code{merge-differently-dotted}
784 only apply to opposing stem directions (ie. Voice 1 & 2).
786 LilyPond also vertically shifts rests that are opposite of a stem,
789 @lilypond[quote,ragged-right,fragment,verbatim]
790 \new Voice << c''4 \\ r4 >>
793 If three or more notes line up in the same column,
794 @code{merge-differently-headed} cannot
795 successfully complete the merge of the two notes that should be merged.
796 To allow the merge to work properly, apply a @code{\shift} to the note that
797 should not be merged. In the first measure of following example,
798 @code{merge-differently-headed} does not work (the half-note head is
799 solid). In the second measure, @code{\shiftOn} is applied to move the
800 top @code{g} out of the column, and @code{merge-differently-headed}
803 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
804 \override Staff.NoteCollision #'merge-differently-headed = ##t
807 { \oneVoice d=''8 c8 r4 e,8 c'8 r4 } \\
808 { \voiceFour e,,2 e'2}
811 { d'=''2 \shiftOn g2 } \\
812 { \oneVoice d=''8 c8 r4 e,8 c'8 r4 } \\
813 { \voiceFour e,,2 e'2}
826 @funindex \voiceThree
838 @code{\shiftOff}: these commands specify the
839 degree to which chords of the current voice should be shifted.
840 The outer voices (normally: voice one and
841 two) have @code{\shiftOff}, while the inner voices (three and four)
842 have @code{\shiftOn}. @code{\shiftOnn} and @code{\shiftOnnn} define
843 further shift levels.
845 When LilyPond cannot cope, the @code{force-hshift}
846 property of the @internalsref{NoteColumn} object and pitched rests can
847 be used to override typesetting decisions.
849 @lilypond[quote,verbatim,ragged-right]
856 \once \override NoteColumn #'force-hshift = #1.7
864 Program reference: the objects responsible for resolving collisions are
865 @internalsref{NoteCollision} and @internalsref{RestCollision}.
870 When using @code{merge-differently-headed} with an upstem eighth or a
871 shorter note, and a downstem half note, the eighth note gets the wrong
874 There is no support for clusters where the same note occurs with
875 different accidentals in the same chord. In this case, it is
876 recommended to use enharmonic transcription, or to use special cluster
877 notation (see @ref{Clusters}).
882 @section Staff notation
884 @cindex Staff notation
886 This section describes music notation that occurs on staff level,
887 such as key signatures, clefs and time signatures.
896 * System start delimiters::
898 * Writing music in parallel::
902 @anchor{Time signature}
903 @unnumberedsubsubsec Time signature
905 @cindex Time signature
909 Time signature indicates the metrum of a piece: a regular pattern of
910 strong and weak beats. It is denoted by a fraction at the start of the
913 The time signature is set with the @code{\time} command
915 @lilypond[quote,ragged-right,fragment,verbatim]
916 \time 2/4 c'2 \time 3/4 c'2.
921 The symbol that is printed can be customized with the @code{style}
922 property. Setting it to @code{#'()} uses fraction style for 4/4 and
925 @lilypond[fragment,quote,ragged-right,verbatim]
928 \override Staff.TimeSignature #'style = #'()
933 There are many more options for its layout. See @ref{Ancient time
934 signatures}, for more examples.
936 @code{\time} sets the property @code{timeSignatureFraction},
937 @code{beatLength} and @code{measureLength} in the @code{Timing}
938 context, which is normally aliased to @internalsref{Score}. The
939 property @code{measureLength} determines where bar lines should be
940 inserted, and how automatic beams should be generated. Changing the
941 value of @code{timeSignatureFraction} also causes the symbol to be
944 More options are available through the Scheme function
945 @code{set-time-signature}. In combination with the
946 @internalsref{Measure_grouping_engraver}, it will create
947 @internalsref{MeasureGrouping} signs. Such signs ease reading
948 rhythmically complex modern music. In the following example, the 9/8
949 measure is subdivided in 2, 2, 2 and 3. This is passed to
950 @code{set-time-signature} as the third argument @code{(2 2 2 3)}
952 @lilypond[quote,ragged-right,verbatim]
955 #(set-time-signature 9 8 '(2 2 2 3))
956 g8[ g] d[ d] g[ g] a8[( bes g]) |
957 #(set-time-signature 5 8 '(3 2))
963 \consists "Measure_grouping_engraver"
972 Program reference: @internalsref{TimeSignature}, and
973 @internalsref{Timing_translator}.
975 Examples: @lsr{contemporary,compound-time-signature.ly}.
980 Automatic beaming does not use the measure grouping specified with
981 @code{set-time-signature}.
984 @anchor{Partial measures}
985 @unnumberedsubsubsec Partial measures
989 @cindex partial measure
990 @cindex measure, partial
991 @cindex shorten measures
994 Partial measures, such as an anacrusis or upbeat, are entered using the
996 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
997 \partial 16*5 c16 cis d dis e | a2. c,4 | b2
1000 The syntax for this command is
1003 \partial @var{duration}
1006 where @code{duration} is the rhythmic length to be added before
1009 This is internally translated into
1012 \set Timing.measurePosition = -@var{length of duration}
1015 The property @code{measurePosition} contains a rational number
1016 indicating how much of the measure has passed at this point. Note
1017 that this is a negative number; @code{\partial 4} is internally
1018 translated to mean @qq{there is a quarter note left in the bar.}
1023 This command does not take into account grace notes at the start of
1024 the music. When a piece starts with graces notes in the pickup, then
1025 the @code{\partial} should follow the grace notes
1027 @lilypond[verbatim,quote,ragged-right,relative,fragment]
1034 @code{\partial} is only intended to be used at the beginning of a
1035 piece. If you use it after the beginning, some odd warnings may
1040 @unnumberedsubsubsec Bar lines
1044 @cindex measure lines
1047 Bar lines delimit measures, but are also used to indicate
1048 repeats. Normally they are inserted automatically. Line
1049 breaks may only happen on bar lines.
1051 Special types of bar lines can be forced with the @code{\bar} command
1053 @lilypond[quote,ragged-right,relative=2,fragment,verbatim]
1057 The following bar types are available
1059 @lilypondfile[ragged-right,quote]{bar-lines.ly}
1061 In addition, you can specify @code{"||:"}, which is equivalent to
1062 @code{"|:"} except at line breaks, where it gives a double bar line at
1063 the end of the line and a start repeat at the beginning of the next
1066 To allow a line break where there is no visible bar line, use
1073 This will insert an invisible bar line and allow line breaks at this
1074 point (without increasing the bar number counter).
1076 In scores with many staves, a @code{\bar} command in one staff is
1077 automatically applied to all staves. The resulting bar lines are
1078 connected between different staves of a @code{StaffGroup},
1079 @code{PianoStaff}, or @code{GrandStaff}.
1081 @lilypond[quote,ragged-right,fragment,verbatim]
1089 \new Staff { \clef bass c4 g e g }
1091 \new Staff { \clef bass c2 c2 }
1099 @funindex repeatCommands
1100 @funindex defaultBarType
1102 The command @code{\bar }@var{bartype} is a short cut for doing
1103 @code{\set Timing.whichBar = }@var{bartype}. Whenever @code{whichBar}
1104 is set to a string, a bar line of that type is created.
1106 A bar line is created whenever the @code{whichBar} property is set.
1107 At the start of a measure it is set to the contents of
1108 @code{Timing.defaultBarType}. The contents of @code{repeatCommands} are
1110 to override default measure bars.
1112 You are encouraged to use @code{\repeat} for repetitions. See
1118 In this manual: @ref{Repeats}, @ref{System start delimiters}.
1120 Program reference: @internalsref{BarLine} (created at
1121 @internalsref{Staff} level), @internalsref{SpanBar} (across staves).
1124 @anchor{Unmetered music}
1125 @unnumberedsubsubsec Unmetered music
1128 @funindex \cadenzaOn
1129 @funindex \cadenzaOff
1131 Bar lines and bar numbers are calculated automatically. For unmetered
1132 music (cadenzas, for example), this is not desirable. To turn off
1133 automatic bar lines and bar numbers, use the commands @code{\cadenzaOn}
1134 and @code{\cadenzaOff}.
1136 @lilypond[verbatim,quote,ragged-right,relative=2,fragment]
1148 LilyPond will only insert line breaks and page breaks at a
1149 barline. Unless the unmetered music ends before the end of
1150 the staff line, you will need to insert
1158 to indicate where breaks can occur.
1161 @anchor{System start delimiters}
1162 @unnumberedsubsubsec System start delimiters
1164 @cindex start of system
1165 @cindex Staff, multiple
1166 @cindex bracket, vertical
1167 @cindex brace, vertical
1170 @cindex staff, choir
1172 Many scores consist of more than one staff. These staves can be
1173 joined in four different ways
1176 @item The group is started with a brace at the left, and bar lines are
1177 connected. This is done with the @internalsref{GrandStaff} context.
1179 @lilypond[verbatim,ragged-right,quote]
1187 @item The group is started with a bracket, and bar lines are connected.
1188 This is done with the
1189 @internalsref{StaffGroup} context
1191 @lilypond[verbatim,ragged-right,quote]
1199 @item The group is started with a bracket, but bar lines are not
1200 connected. This is done with the @internalsref{ChoirStaff} context.
1202 @lilypond[verbatim,ragged-right,quote]
1210 @item The group is started with a vertical line. Bar lines are not
1211 connected. This is the default for the score.
1213 @lilypond[verbatim,ragged-right,quote]
1224 The bar lines at the start of each system are
1225 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace}, and
1226 @internalsref{SystemStartBracket}. Only one of these types is created
1227 in every context, and that type is determined by the property
1228 @code{systemStartDelimiter}.
1233 System start delimiters may be deeply nested,
1235 @lilypond[quote,ragged-right,verbatim]
1238 \set StaffGroup.systemStartDelimiterHierarchy
1239 = #'(SystemStartSquare (SystemStartBracket a (SystemStartSquare b)) d)
1249 @anchor{Staff symbol}
1250 @unnumberedsubsubsec Staff symbol
1252 @cindex adjusting staff symbol
1254 Notes, dynamic signs, etc., are grouped
1255 with a set of horizontal lines, called a staff (plural @q{staves}). In
1256 LilyPond, these lines are drawn using a separate layout object called
1257 @code{staff symbol}.
1259 The staff symbol may be tuned in the number, thickness and distance
1260 of lines, using properties. This is demonstrated in the example files
1261 @lsr{staff,changing-the-number-of-lines-in-a-staff.ly} and
1262 @lsr{staff,changing-the-staff-size.ly}.
1264 In addition, staves may be started and stopped at will. This is done
1265 with @code{\startStaff} and @code{\stopStaff}.
1267 @lilypond[verbatim,relative=2,fragment]
1269 \override Staff.StaffSymbol #'line-count = 2
1270 \stopStaff \startStaff
1272 \revert Staff.StaffSymbol #'line-count
1273 \stopStaff \startStaff
1277 In combination with Frenched staves, this may be used to typeset ossia
1278 sections. An example is shown here
1282 @lilypondfile{ossia.ly}
1284 @cindex staff lines, setting number of
1285 @cindex staff lines, setting thickness of
1286 @cindex thickness of staff lines, setting
1287 @cindex number of staff lines, setting
1291 Program reference: @internalsref{StaffSymbol}.
1293 Examples: @lsrdir{staff}
1296 @anchor{Writing music in parallel}
1297 @unnumberedsubsubsec Writing music in parallel
1299 @cindex Writing music in parallel
1300 @cindex Interleaved music
1302 Music for multiple parts can be interleaved
1304 @lilypond[quote,fragment,verbatim]
1305 \parallelMusic #'(voiceA voiceB) {
1306 r8 g'16[ c''] e''[ g' c'' e''] r8 g'16[ c''] e''[ g' c'' e''] |
1308 r8 a'16[ d''] f''[ a' d'' f''] r8 a'16[ d''] f''[ a' d'' f''] |
1312 \new Staff \new Voice \voiceA
1313 \new Staff \new Voice \voiceB
1317 This works quite well for piano music
1319 @lilypond[quote,verbatim]
1323 \parallelMusic #'(voiceA voiceB voiceC voiceD) {
1325 r8 g'16[ c''] e''[ g' c'' e''] r8 g'16[ c''] e''[ g' c''
1328 r8 a16[ d'] f'[ a d' f'] r8 a16[ d'] f'[ a d' f'] |
1332 a'8 b' c'' d'' e'' f'' g'' a'' |
1334 c16 d e f d e f g e f g a f g a b |
1360 @node Connecting notes
1361 @section Connecting notes
1363 This section deals with notation that affects groups of notes.
1369 * Laissez vibrer ties::
1377 @unnumberedsubsubsec Ties
1382 A tie connects two adjacent note heads of the same pitch. The tie in
1383 effect extends the length of a note. Ties should not be confused with
1384 slurs, which indicate articulation, or phrasing slurs, which indicate
1385 musical phrasing. A tie is entered using the tilde symbol @samp{~}
1387 @lilypond[quote,ragged-right,fragment,verbatim]
1388 e' ~ e' <c' e' g'> ~ <c' e' g'>
1391 When a tie is applied to a chord, all note heads whose pitches match
1392 are connected. When no note heads match, no ties will be created. Chords
1393 may be partially tied by placing the tie inside the chord,
1395 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
1396 <c~ e g~ b> <c e g b>
1399 A tie is just a way of extending a note duration, similar to the
1400 augmentation dot. The following example shows two ways of notating
1401 exactly the same concept
1403 @lilypond[quote,fragment,ragged-right]
1404 \time 3/4 c'2. c'2 ~ c'4
1408 Ties are used either when the note crosses a bar line, or when dots
1409 cannot be used to denote the rhythm. When using ties, larger note
1410 values should be aligned to subdivisions of the measure, such as
1412 @lilypond[fragment,quote,ragged-right]
1414 r8 c8 ~ c2 r4 | r8^"not" c2 ~ c8 r4
1418 If you need to tie a lot of notes over bars, it may be easier to use
1419 automatic note splitting (see @ref{Automatic note splitting}). This
1420 mechanism automatically splits long notes, and ties them across bar
1423 @funindex \repeatTie
1425 When a second alternative of a repeat starts with a tied note, you
1426 have to repeat the tie. This can be achieved with @code{\repeatTie},
1428 @lilypond[fragment,quote,ragged-right,relative=2]
1432 @cindex repeating ties
1433 @cindex volta brackets and ties
1437 Ties are sometimes used to write out arpeggios. In this case, two tied
1438 notes need not be consecutive. This can be achieved by setting the
1439 @code{tieWaitForNote} property to true. The same feature is also useful,
1440 for example, to tie a tremolo to a chord. For example,
1442 @lilypond[fragment,verbatim,relative=1,ragged-right,quote]
1443 \set tieWaitForNote = ##t
1444 \grace { c16[~ e~ g]~ } <c, e g>2
1445 \repeat tremolo 8 { c32~ c'~ } <c c,>1
1446 e8~ c~ a~ f~ <e' c a f>2
1449 Ties may be engraved manually by changing the @code{tie-configuration}
1450 property. The first number indicates the distance from the center
1451 of the staff in staff-spaces, and the second number indicates the
1452 direction (1=up, -1=down).
1454 @lilypond[fragment,verbatim,relative=1,ragged-right,quote]
1456 \override TieColumn #'tie-configuration =
1457 #'((0.0 . 1) (-2.0 . 1) (-4.0 . 1))
1469 @funindex \tieNeutral
1471 @funindex \tieDotted
1473 @funindex \tieDashed
1481 In this manual: @ref{Automatic note splitting}.
1483 Program reference: @internalsref{Tie}.
1488 Switching staves when a tie is active will not produce a slanted tie.
1490 Changing clefs or octavations during a tie is not really
1491 well-defined. In these cases, a slur may be preferable.
1495 @unnumberedsubsubsec Slurs
1499 A slur indicates that notes are to be played bound or
1500 @emph{legato}. They are entered using parentheses
1502 @lilypond[quote,ragged-right,relative=2,fragment,verbatim]
1503 f( g a) a8 b( a4 g2 f4)
1507 The direction of a slur can be specified with
1508 @code{\slur@emph{DIR}}, where @code{@emph{DIR}} is
1509 either @code{Up}, @code{Down}, or @code{Neutral} (automatically
1512 However, there is a convenient shorthand for forcing slur
1513 directions. By adding @code{_} or @code{^} before the opening
1514 parentheses, the direction is also set. For example,
1516 @lilypond[relative=2,ragged-right,quote,verbatim,fragment]
1520 Only one slur can be printed at once. If you need to print a long
1521 slur over a few small slurs, please see @ref{Phrasing slurs}.
1526 Some composers write two slurs when they want legato chords. This can
1527 be achieved in LilyPond by setting @code{doubleSlurs},
1529 @lilypond[verbatim,ragged-right,relative,fragment,quote]
1530 \set doubleSlurs = ##t
1531 <c e>4 ( <d f> <c e> <d f> )
1541 @funindex \slurNeutral
1542 @code{\slurNeutral},
1543 @funindex \slurDashed
1545 @funindex \slurDotted
1547 @funindex \slurSolid
1552 Program reference: @internalsref{Slur}.
1555 @anchor{Phrasing slurs}
1556 @unnumberedsubsubsec Phrasing slurs
1558 @cindex phrasing slurs
1559 @cindex phrasing marks
1561 A phrasing slur (or phrasing mark) connects notes and is used to
1562 indicate a musical sentence. It is written using @code{\(} and @code{\)}
1565 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
1566 \time 6/4 c'\( d( e) f( e) d\)
1569 Typographically, the phrasing slur behaves almost exactly like a
1570 normal slur. However, they are treated as different objects. A
1571 @code{\slurUp} will have no effect on a phrasing slur; instead, use
1572 @code{\phrasingSlurUp}, @code{\phrasingSlurDown}, and
1573 @code{\phrasingSlurNeutral}.
1575 You cannot have simultaneous phrasing slurs.
1580 @funindex \phrasingSlurUp
1581 @code{\phrasingSlurUp},
1582 @funindex \phrasingSlurDown
1583 @code{\phrasingSlurDown},
1584 @funindex \phrasingSlurNeutral
1585 @code{\phrasingSlurNeutral}.
1590 Program reference: @internalsref{PhrasingSlur}.
1593 @anchor{Laissez vibrer ties}
1594 @unnumberedsubsubsec Laissez vibrer ties
1595 @cindex Laissez vibrer
1596 @cindex Ties, laissez vibrer
1598 L.v. ties (laissez vibrer) indicate that notes must not be damped at the
1599 end. It is used in notation for piano, harp and other string and
1600 percussion instruments. They can be entered using @code{\laissezVibrer},
1602 @lilypond[fragment,ragged-right,verbatim,relative=1]
1603 <c f g>\laissezVibrer
1609 @internalsref{LaissezVibrerTie}
1610 @internalsref{LaissezVibrerTieColumn}
1613 @lsr{connecting,laissez-vibrer-ties.ly}
1616 @anchor{Automatic beams}
1617 @unnumberedsubsubsec Automatic beams
1619 LilyPond inserts beams automatically
1621 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
1622 \time 2/4 c8 c c c \time 6/8 c c c c8. c16 c8
1625 When these automatic decisions are not good enough, beaming can be
1626 entered explicitly. It is also possible to define beaming patterns
1627 that differ from the defaults. See @ref{Setting automatic beam behavior},
1630 Individual notes may be marked with @code{\noBeam} to prevent them
1633 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
1634 \time 2/4 c8 c\noBeam c c
1640 Program reference: @internalsref{Beam}.
1643 @anchor{Manual beams}
1644 @unnumberedsubsubsec Manual beams
1646 @cindex beams, manual
1650 In some cases it may be necessary to override the automatic beaming
1651 algorithm. For example, the autobeamer will not put beams over rests
1652 or bar lines. Such beams are specified manually by marking the begin
1653 and end point with @code{[} and @code{]}
1655 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
1657 r4 r8[ g' a r8] r8 g[ | a] r8
1664 @funindex stemLeftBeamCount
1665 @funindex stemRightBeamCount
1668 LilyPond can automatically determine beaming patterns within a beam,
1669 but this automatic behavior can sometimes produce odd results;
1670 therefore the @code{stemLeftBeamCount} and @code{stemRightBeamCount} properties can
1671 be used to override the defaults. If
1672 either property is set, its value will be used only once, and then it
1675 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
1680 \set stemLeftBeamCount = #1
1685 The property @code{subdivideBeams} can be set in order to subdivide
1686 all 16th or shorter beams at beat positions, as defined by the
1687 @code{beatLength} property.
1689 @lilypond[fragment,quote,relative=2,verbatim]
1691 \set subdivideBeams = ##t
1693 \set Score.beatLength = #(ly:make-moment 1 8)
1696 @funindex subdivideBeams
1699 For more information about @code{make-moment}, see
1700 @ref{Time administration}.
1702 Line breaks are normally forbidden when beams cross bar lines. This
1703 behavior can be changed by setting @code{breakable}.
1707 @cindex beams and line breaks
1708 @cindex beams, kneed
1710 @cindex auto-knee-gap
1712 Kneed beams are inserted automatically when a large gap is detected
1713 between the note heads. This behavior can be tuned through the
1714 @code{auto-knee-gap} object.
1719 Automatically kneed cross-staff beams cannot be used together with
1720 hidden staves. See @ref{Hiding staves}.
1722 @c Is this still true with skyline spacing stuff? -J.Mandereau
1723 Beams do not avoid collisions with symbols around the notes, such as
1724 texts and accidentals.
1727 @anchor{Grace notes}
1728 @unnumberedsubsubsec Grace notes
1733 @cindex appoggiatura
1734 @cindex acciaccatura
1736 Grace notes are ornaments that are written out. The most common ones
1737 are acciaccatura, which should be played as very short. It is denoted
1738 by a slurred small note with a slashed stem. The appoggiatura is a
1739 grace note that takes a fixed fraction of the main note, and is
1740 denoted as a slurred note in small print without a slash. They
1741 are entered with the commands @code{\acciaccatura} and
1742 @code{\appoggiatura}, as demonstrated in the following example
1744 @lilypond[quote,ragged-right,relative=2,verbatim,fragment]
1745 b4 \acciaccatura d8 c4 \appoggiatura e8 d4
1746 \acciaccatura { g16[ f] } e4
1749 Both are special forms of the @code{\grace} command. By prefixing this
1750 keyword to a music expression, a new one is formed, which will be
1751 printed in a smaller font and takes up no logical time in a measure.
1753 @lilypond[quote,ragged-right,relative=2,verbatim,fragment]
1755 \grace { c16[ d16] } c2 c4
1759 Unlike @code{\acciaccatura} and @code{\appoggiatura}, the
1760 @code{\grace} command does not start a slur.
1762 @cindex timing, internal
1764 Internally, timing for grace notes is done using a second, @q{grace}
1765 timing. Every point in time consists of two rational numbers: one
1766 denotes the logical time, one denotes the grace timing. The above
1767 example is shown here with timing tuples
1769 @lilypond[quote,ragged-right]
1772 c4 \grace c16 c4 \grace {
1775 \new Lyrics \lyricmode {
1776 \override LyricText #'font-family = #'typewriter
1780 ( \fraction 1 4 , \fraction -1 16 ) } 16 }
1781 \markup { (\fraction 1 4 , 0 ) } 4
1783 \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16
1784 \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16
1786 \markup { ( \fraction 2 4 , 0 ) }
1791 The placement of grace notes is synchronized between different staves.
1792 In the following example, there are two sixteenth grace notes for
1793 every eighth grace note
1795 @lilypond[quote,ragged-right,relative=2,verbatim,fragment]
1796 << \new Staff { e4 \grace { c16[ d e f] } e4 }
1797 \new Staff { c4 \grace { g8[ b] } c4 } >>
1800 @funindex \afterGrace
1802 If you want to end a note with a grace, use the @code{\afterGrace}
1803 command. It takes two arguments: the main note, and the grace notes
1804 following the main note.
1806 @lilypond[ragged-right, verbatim,relative=2,fragment]
1807 c1 \afterGrace d1 { c16[ d] } c4
1810 This will put the grace notes after a @q{space} lasting 3/4 of the
1811 length of the main note. The fraction 3/4 can be changed by setting
1812 @code{afterGraceFraction}, ie.
1815 #(define afterGraceFraction (cons 7 8))
1819 will put the grace note at 7/8 of the main note.
1821 The same effect can be achieved manually by doing
1823 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
1826 { s2 \grace { c16[ d] } } >>
1832 By adjusting the duration of the skip note (here it is a half-note),
1833 the space between the main-note and the grace is adjusted.
1835 A @code{\grace} music expression will introduce special typesetting settings,
1836 for example, to produce smaller type, and set directions. Hence, when
1837 introducing layout tweaks, they should be inside the grace expression,
1840 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
1852 The overrides should also be reverted inside the grace expression.
1854 The layout of grace expressions can be changed throughout the music
1855 using the function @code{add-grace-property}. The following example
1856 undefines the @code{Stem} direction for this grace, so that stems do not
1861 #(add-grace-property 'Voice 'Stem 'direction '())
1867 Another option is to change the variables @code{startGraceMusic},
1868 @code{stopGraceMusic}, @code{startAcciaccaturaMusic},
1869 @code{stopAcciaccaturaMusic}, @code{startAppoggiaturaMusic},
1870 @code{stopAppoggiaturaMusic}. More information is in the file
1871 @file{ly/@/grace@/-init@/.ly}.
1874 The slash through the stem in acciaccaturas can be obtained
1875 in other situations by @code{\override Stem #'stroke-style = #"grace"}.
1880 Grace notes may be forced to use floating spacing,
1882 @lilypond[relative=2,ragged-right]
1884 \override Score.SpacingSpanner #'strict-grace-spacing = ##t
1893 c'16[ c'16 c'16 c'16]
1894 c'16[ c'16 c'16 c'16]
1903 Program reference: @internalsref{GraceMusic}.
1908 A score that starts with a @code{\grace} expression needs an explicit
1909 @code{\new Voice} declaration, otherwise the main note and the grace
1910 note end up on different staves.
1912 Grace note synchronization can also lead to surprises. Staff notation,
1913 such as key signatures, bar lines, etc., are also synchronized. Take
1914 care when you mix staves with grace notes and staves without, for example,
1916 @lilypond[quote,ragged-right,relative=2,verbatim,fragment]
1917 << \new Staff { e4 \bar "|:" \grace c16 d4 }
1918 \new Staff { c4 \bar "|:" d4 } >>
1922 This can be remedied by inserting grace skips of the corresponding
1923 durations in the other staves. For the above example
1925 @lilypond[quote,ragged-right,relative=2,verbatim,fragment]
1926 << \new Staff { e4 \bar "|:" \grace c16 d4 }
1927 \new Staff { c4 \bar "|:" \grace s16 d4 } >>
1930 Grace sections should only be used within sequential music
1931 expressions. Nesting or juxtaposing grace sections is not supported,
1932 and might produce crashes or other errors.
1936 @node Expressive marks
1937 @section Expressive marks
1939 Expressive marks help musicians to bring more to the music than simple
1944 * Fingering instructions::
1954 @anchor{Articulations}
1955 @unnumberedsubsubsec Articulations
1957 @cindex Articulations
1961 A variety of symbols can appear above and below notes to indicate
1962 different characteristics of the performance. They are added to a note
1963 by adding a dash and the character signifying the
1964 articulation. They are demonstrated here
1966 @lilypondfile[quote,ragged-right]{script-abbreviations.ly}
1968 The meanings of these shorthands can be changed. See
1969 @file{ly/@/script@/-init@/.ly} for examples.
1971 The script is automatically placed, but the direction can be forced as
1972 well. Like other pieces of LilyPond code, @code{_} will place them
1973 below the staff, and @code{^} will place them above.
1975 @lilypond[quote,ragged-right,fragment,verbatim]
1979 Other symbols can be added using the syntax
1980 @var{note}@code{\}@var{name}. Again, they
1981 can be forced up or down using @code{^} and @code{_},
1984 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
1985 c\fermata c^\fermata c_\fermata
1990 @cindex staccatissimo
2000 @cindex organ pedal marks
2010 @cindex prallmordent
2013 @cindex thumb marking
2018 Here is a chart showing all scripts available,
2020 @lilypondfile[ragged-right,quote]{script-chart.ly}
2025 The vertical ordering of scripts is controlled with the
2026 @code{script-priority} property. The lower this number, the closer it
2027 will be put to the note. In this example, the
2028 @internalsref{TextScript} (the sharp symbol) first has the lowest
2029 priority, so it is put lowest in the first example. In the second, the
2030 prall trill (the @internalsref{Script}) has the lowest, so it is on the
2031 inside. When two objects have the same priority, the order in which
2032 they are entered decides which one comes first.
2034 @lilypond[verbatim,relative=3,ragged-right,fragment,quote]
2035 \once \override TextScript #'script-priority = #-100
2036 a4^\prall^\markup { \sharp }
2038 \once \override Script #'script-priority = #-100
2039 a4^\prall^\markup { \sharp }
2045 Program reference: @internalsref{Script}.
2050 These signs appear in the printed output but have no effect on the
2051 MIDI rendering of the music.
2054 @anchor{Fingering instructions}
2055 @unnumberedsubsubsec Fingering instructions
2058 @cindex finger change
2060 Fingering instructions can be entered using
2062 @var{note}-@var{digit}
2064 For finger changes, use markup texts
2066 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
2068 c^\markup { \finger "2 - 3" }
2071 You can use the thumb-script to indicate that a note should be
2072 played with the thumb (e.g., in cello music)
2073 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
2074 <a_\thumb a'-3>8 <b_\thumb b'-3>
2077 Fingerings for chords can also be added to individual notes
2078 of the chord by adding them after the pitches
2079 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
2080 < c-1 e-2 g-3 b-5 >4
2086 You may exercise greater control over fingering chords by
2087 setting @code{fingeringOrientations}
2089 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
2090 \set fingeringOrientations = #'(left down)
2091 <c-1 es-2 g-4 bes-5 > 4
2092 \set fingeringOrientations = #'(up right down)
2093 <c-1 es-2 g-4 bes-5 > 4
2096 Using this feature, it is also possible to put fingering instructions
2097 very close to note heads in monophonic music,
2099 @lilypond[verbatim,ragged-right,quote,fragment]
2100 \set fingeringOrientations = #'(right)
2107 Program reference: @internalsref{Fingering}.
2109 Examples: @lsr{expressive,fingering-chords.ly}
2113 @unnumberedsubsubsec Dynamics
2134 Absolute dynamic marks are specified using a command after a note
2135 @code{c4\ff}. The available dynamic marks are @code{\ppppp},
2136 @code{\pppp}, @code{\ppp},
2137 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2138 @code{\fff}, @code{\ffff}, @code{\fp}, @code{\sf}, @code{\sff},
2139 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}.
2141 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
2142 c\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
2143 c2\fp c\sf c\sff c\sp c\spp c\sfz c\rfz
2150 A crescendo mark is started with @code{\<} and terminated with
2151 @code{\!} or an absolute dynamic. A decrescendo is started with
2152 @code{\>} and is also terminated with @code{\!} or an absolute
2153 dynamic. @code{\cr} and @code{\decr} may be used instead of
2154 @code{\<} and @code{\>}. Because these marks are bound to notes, you must
2155 use spacer notes if multiple marks are needed during one note
2157 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2159 << f1 { s4 s4\< s4\! \> s4\! } >>
2163 A hairpin normally starts at the left edge of the beginning note
2164 and ends on the right edge of the ending note. If the ending
2165 note falls on the downbeat, the hairpin ends on the immediately
2166 preceding barline. This may be modified by setting the
2167 @code{hairpinToBarline} property,
2169 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2170 \set hairpinToBarline = ##f
2174 In some situations the @code{\espressivo} articulation mark may
2175 be suitable to indicate a crescendo and decrescendo on the one note,
2177 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2178 c2 b4 a g1\espressivo
2181 This may give rise to very short hairpins. Use @code{minimum-length}
2182 in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for
2186 \override Voice.Hairpin #'minimum-length = #5
2192 Hairpins may be printed with a circled tip (al niente notation) by
2193 setting the @code{circled-tip} property,
2195 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
2196 \override Hairpin #'circled-tip = ##t
2206 You can also use text saying @emph{cresc.} instead of hairpins
2208 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
2219 You can also supply your own texts
2220 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2221 \set crescendoText = \markup { \italic "cresc. poco" }
2222 \set crescendoSpanner = #'dashed-line
2226 To create new dynamic marks or text that should be aligned
2227 with dynamics, see @ref{New dynamic marks}.
2229 Vertical positioning of dynamics is handled by
2230 @internalsref{DynamicLineSpanner}.
2235 Dynamics that occur at, begin on, or end on, the same note
2236 will be vertically aligned. If you want to ensure that dynamics
2237 are aligned when they do not occur on the same note, you can
2238 increase the @code{staff-padding} property.
2241 \override DynamicLineSpanner #'staff-padding = #4
2244 You may also use this property if the dynamics are colliding
2245 with other notation.
2247 Crescendi and decrescendi that end on the first note of a
2248 new line are not printed. To change this behavior, use
2251 \override Score.Hairpin #'after-line-breaking = ##t
2254 Text style dynamic changes (such as @emph{cresc.} and @emph{dim.})
2256 dashed line showing their extent. To surpress printing this line, use
2259 \override DynamicTextSpanner #'dash-period = #-1.0
2265 @funindex \dynamicUp
2267 @funindex \dynamicDown
2268 @code{\dynamicDown},
2269 @funindex \dynamicNeutral
2270 @code{\dynamicNeutral}.
2275 Program reference: @internalsref{DynamicText}, @internalsref{Hairpin}.
2276 Vertical positioning of these symbols is handled by
2277 @internalsref{DynamicLineSpanner}.
2280 @anchor{Breath marks}
2281 @unnumberedsubsubsec Breath marks
2283 Breath marks are entered using @code{\breathe}
2285 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2292 The glyph of the breath mark can be tuned by overriding the
2293 @code{text} property of the @code{BreathingSign} layout object with
2294 any markup text. For example,
2295 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
2297 \override BreathingSign #'text
2298 = #(make-musicglyph-markup "scripts.rvarcomma")
2305 Program reference: @internalsref{BreathingSign}.
2307 Examples: @lsr{expressive,breathing-sign.ly}
2311 @unnumberedsubsubsec Trills
2313 Short trills are printed like normal articulation; see @ref{Articulations}.
2315 Long running trills are made with @code{\startTrillSpan} and
2316 @code{\stopTrillSpan},
2318 @lilypond[verbatim,ragged-right,relative=2,quote,fragment]
2320 << { c1 \startTrillSpan }
2321 { s2. \grace { d16[\stopTrillSpan e] } } >>
2325 @cindex Pitched trills
2327 Trills that should be executed on an explicitly specified pitch can be
2328 typeset with the command @code{pitchedTrill},
2330 @lilypond[ragged-right,verbatim,fragment,relative=1,quote]
2331 \pitchedTrill c4\startTrillSpan fis
2336 The first argument is the main note. The pitch of the second
2337 is printed as a stemless note head in parentheses.
2342 @code{\startTrillSpan},
2343 @funindex \startTrillSpan
2344 @code{\stopTrillSpan}.
2345 @funindex \stopTrillSpan
2350 Program reference: @internalsref{TrillSpanner}.
2354 @unnumberedsubsubsec Glissando
2357 @funindex \glissando
2359 A glissando is a smooth change in pitch. It is denoted by a line or a
2360 wavy line between two notes. It is requested by attaching
2361 @code{\glissando} to a note
2363 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
2365 \override Glissando #'style = #'zigzag
2372 @lilypond[quote,ragged-right,verbatim]
2373 I = \once \override NoteColumn #'ignore-collision = ##t
2376 { \oneVoice \stemDown f2 \glissando \stemNeutral a } \\
2377 { \oneVoice \I c2 \glissando \I d, }
2385 Program reference: @internalsref{Glissando}.
2388 @lsr{expressive,glissando.ly}, @lsr{expressive,line-styles.ly}
2393 Printing text over the line (such as @emph{gliss.}) is not supported.
2397 @unnumberedsubsubsec Arpeggio
2400 @cindex broken chord
2403 You can specify an arpeggio sign (also known as broken chord) on a
2404 chord by attaching an @code{\arpeggio} to a chord
2406 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2410 A square bracket on the left indicates that the player should not
2411 arpeggiate the chord
2413 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2418 The direction of the arpeggio is sometimes denoted by adding an
2419 arrowhead to the wiggly line
2421 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2433 When an arpeggio crosses staves, you may attach an arpeggio to the chords
2434 in both staves and set
2435 @internalsref{PianoStaff}.@code{connectArpeggios}
2437 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
2439 \set PianoStaff.connectArpeggios = ##t
2440 \new Staff { <c' e g c>\arpeggio }
2441 \new Staff { \clef bass <c,, e g>\arpeggio }
2445 @c TODO: cross-voice arpeggio example?
2446 @c such an example is already in LSR -J.Mandereau
2451 @funindex \arpeggioUp
2453 @funindex \arpeggioDown
2454 @code{\arpeggioDown},
2455 @funindex \arpeggioNeutral
2456 @code{\arpeggioNeutral},
2457 @funindex \arpeggioBracket
2458 @code{\arpeggioBracket}.
2463 Notation manual: @ref{Ties}, for writing out arpeggios.
2465 Program reference: @internalsref{Arpeggio}.
2470 It is not possible to mix connected arpeggios and unconnected
2471 arpeggios in one @internalsref{PianoStaff} at the same point in time.
2474 @anchor{Falls and doits}
2475 @unnumberedsubsubsec Falls and doits
2477 Falls and doits can be added to notes using the @code{\bendAfter}
2480 @lilypond[fragment,ragged-right,relative=2]
2481 \override Score.SpacingSpanner #'shortest-duration-space = #3.0
2490 Repetition is a central concept in music, and multiple notations exist
2496 * Repeats and MIDI::
2497 * Manual repeat commands::
2499 * Tremolo subdivisions::
2504 @anchor{Repeat types}
2505 @unnumberedsubsubsec Repeat types
2509 The following types of repetition are supported
2513 Repeated music is fully written (played) out. This is useful when
2514 entering repetitious music. This is the only kind of repeat that
2515 is included in MIDI output.
2518 Repeats are not written out, but alternative endings (volte) are
2519 printed, left to right with brackets. This is the standard notation
2520 for repeats with alternatives. These are not played in MIDI output by
2525 Make tremolo beams. These are not played in MIDI output by default.
2528 Make beat or measure repeats. These look like percent signs. These
2529 are not played in MIDI output by default. Percent repeats must be
2530 declared within a @code{Voice} context.
2535 @anchor{Repeat syntax}
2536 @unnumberedsubsubsec Repeat syntax
2540 @cindex seconda volta
2543 LilyPond has one syntactic construct for specifying different types of
2544 repeats. The syntax is
2547 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2550 If you have alternative endings, you may add
2551 @funindex \alternative
2562 where each @var{alternative} is a music expression. If you do not
2563 give enough alternatives for all of the repeats, the first alternative
2564 is assumed to be played more than once.
2566 Standard repeats are used like this
2568 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2570 \repeat volta 2 { c4 d e f }
2571 \repeat volta 2 { f e d c }
2574 With alternative endings
2576 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2578 \repeat volta 2 {c4 d e f}
2579 \alternative { {d2 d} {f f,} }
2582 Repeats with upbeats may be created.
2584 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2587 \repeat volta 4 { c2 d2 | e2 f2 | }
2588 \alternative { { g4 g g e } { a a a a | b2. } }
2595 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2598 \repeat volta 4 { e | c2 d2 | e2 f2 | }
2599 \alternative { { \partial 4*3 g4 g g } { a a a a | b2. } }
2605 @funindex \repeatTie
2607 Ties may be added to a second ending,
2609 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
2611 \repeat volta 2 {c4 d e f ~ }
2612 \alternative { {f2 d} {f\repeatTie f,} }
2615 It is possible to shorten volta brackets
2616 by setting @code{voltaSpannerDuration}. In the next example, the
2617 bracket only lasts one measure, which is a duration of 3/4.
2619 @lilypond[verbatim,ragged-right,quote]
2623 \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
2624 \repeat volta 5 { d d d }
2625 \alternative { { e e e f f f }
2630 If you want to start a repeat at the beginning of a line and have a
2631 double bar at the end of the previous line, use
2633 @dots{} \bar "||:" \break
2634 \repeat volta 2 @{ @dots{}
2636 see @ref{Bar lines} for more information.
2640 Program reference: @internalsref{VoltaBracket},
2641 @internalsref{RepeatedMusic},
2642 @internalsref{VoltaRepeatedMusic}, and
2643 @internalsref{UnfoldedRepeatedMusic}.
2647 Brackets for the repeat are normally only printed over the topmost
2648 staff. This can be adjusted by moving @code{Volta_engraver} to the
2649 Staff context where you want the brackets to appear;
2650 see @ref{Modifying context plug-ins} and
2652 @lsr{repeats,volta@/-multi@/-staff@/.ly}.
2657 @cindex repeat, ambiguous
2659 A nested repeat like
2668 is ambiguous, since it is is not clear to which @code{\repeat} the
2669 @code{\alternative} belongs. This ambiguity is resolved by always
2670 having the @code{\alternative} belong to the inner @code{\repeat}.
2671 For clarity, it is advisable to use braces in such situations.
2673 Timing information is not remembered at the start of an alternative,
2674 so after a repeat timing information must be reset by hand; for
2675 example, by setting @code{Score.measurePosition} or entering
2676 @code{\partial}. Similarly, slurs or ties are also not repeated.
2679 @anchor{Repeats and MIDI}
2680 @unnumberedsubsubsec Repeats and MIDI
2682 @cindex expanding repeats
2683 @funindex \unfoldRepeats
2685 With a little bit of tweaking, all types of repeats can be present
2686 in the MIDI output. This is achieved by applying the
2687 @code{\unfoldRepeats} music function. This function changes all
2688 repeats to unfold repeats.
2690 @lilypond[quote,verbatim,fragment,line-width=8.0\cm]
2692 \repeat tremolo 8 {c'32 e' }
2693 \repeat percent 2 { c''8 d'' }
2694 \repeat volta 2 {c'4 d' e' f'}
2703 When creating a score file using @code{\unfoldRepeats} for MIDI,
2704 it is necessary to make two @code{\score} blocks: one for MIDI (with
2705 unfolded repeats) and one for notation (with volta, tremolo, and
2706 percent repeats). For example,
2714 \unfoldRepeats @var{..music..}
2720 @anchor{Manual repeat commands}
2721 @unnumberedsubsubsec Manual repeat commands
2723 @funindex repeatCommands
2725 The property @code{repeatCommands} can be used to control the layout of
2726 repeats. Its value is a Scheme list of repeat commands.
2729 @item @code{start-repeat}
2730 Print a @code{|:} bar line.
2732 @item @code{end-repeat}
2733 Print a @code{:|} bar line.
2735 @item @code{(volta @var{text})}
2736 Print a volta bracket saying @var{text}: The text can be specified as
2737 a text string or as a markup text, see @ref{Text markup}. Do not
2738 forget to change the font, as the default number font does not contain
2739 alphabetic characters;
2741 @item @code{(volta #f)}
2742 Stop a running volta bracket.
2745 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
2747 \set Score.repeatCommands = #'((volta "93") end-repeat)
2749 \set Score.repeatCommands = #'((volta #f))
2756 Program reference: @internalsref{VoltaBracket},
2757 @internalsref{RepeatedMusic},
2758 @internalsref{VoltaRepeatedMusic}, and
2759 @internalsref{UnfoldedRepeatedMusic}.
2762 @anchor{Tremolo repeats}
2763 @unnumberedsubsubsec Tremolo repeats
2765 @cindex tremolo beams
2767 To place tremolo marks between notes, use @code{\repeat} with tremolo
2769 @lilypond[quote,verbatim,ragged-right]
2770 \new Voice \relative c' {
2771 \repeat tremolo 8 { c16 d16 }
2772 \repeat tremolo 4 { c16 d16 }
2773 \repeat tremolo 2 { c16 d16 }
2777 Tremolo marks can also be put on a single note. In this case, the
2778 note should not be surrounded by braces.
2779 @lilypond[quote,verbatim,ragged-right]
2780 \repeat tremolo 4 c'16
2783 Similar output is obtained using the tremolo subdivision, described in
2784 @ref{Tremolo subdivisions}.
2789 In this manual: @ref{Tremolo subdivisions}, @ref{Repeats}.
2791 Program reference: @internalsref{Beam}, @internalsref{StemTremolo}.
2794 @anchor{Tremolo subdivisions}
2795 @unnumberedsubsubsec Tremolo subdivisions
2797 @cindex tremolo marks
2798 @funindex tremoloFlags
2800 Tremolo marks can be printed on a single note by adding
2801 @q{@code{:}[@var{number}]} after the note. The number indicates the
2802 duration of the subdivision, and it must be at least 8. A
2803 @var{length} value of 8 gives one line across the note stem. If the
2804 length is omitted, the last value (stored in @code{tremoloFlags}) is
2807 @lilypond[quote,ragged-right,verbatim,fragment]
2808 c'2:8 c':32 | c': c': |
2814 Tremolos entered in this way do not carry over into the MIDI output.
2819 In this manual: @ref{Tremolo repeats}.
2821 Elsewhere: @internalsref{StemTremolo}.
2824 @anchor{Measure repeats}
2825 @unnumberedsubsubsec Measure repeats
2827 @cindex percent repeats
2828 @cindex measure repeats
2830 In the @code{percent} style, a note pattern can be repeated. It is
2831 printed once, and then the pattern is replaced with a special sign.
2832 Patterns of one and two measures are replaced by percent-like signs,
2833 patterns that divide the measure length are replaced by slashes.
2834 Percent repeats must be declared within a @code{Voice} context.
2836 @lilypond[quote,verbatim,ragged-right]
2837 \new Voice \relative c' {
2838 \repeat percent 4 { c4 }
2839 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
2843 Measure repeats of more than 2 measures get a counter, if you switch
2844 on the @code{countPercentRepeats} property,
2846 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
2848 \set countPercentRepeats = ##t
2849 \repeat percent 4 { c1 }
2855 Isolated percents can also be printed. This is done by putting a
2856 multi-measure rest with a different print function,
2858 @lilypond[fragment,verbatim,quote]
2859 \override MultiMeasureRest #'stencil
2860 = #ly:multi-measure-rest::percent
2869 Program reference: @internalsref{RepeatSlash},
2870 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
2871 @internalsref{DoublePercentRepeatCounter},
2872 @internalsref{PercentRepeatCounter},
2873 @internalsref{PercentRepeatedMusic}.