1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. See TRANSLATION for details.
12 @section Staff notation
14 @lilypondfile[quote]{staff-headword.ly}
16 This section explains how to influence the appearance of staves,
17 how to print scores with more than one staff, and how to add tempo
18 indications and cue notes to staves.
22 * Modifying single staves::
27 @node Displaying staves
28 @subsection Displaying staves
30 This section describes the different methods of creating and
34 * Instantiating new staves::
36 * Nested staff groups::
40 @node Instantiating new staves
41 @unnumberedsubsubsec Instantiating new staves
44 @cindex staff initiation
45 @cindex staff instantiation
49 @cindex staff, percussion
51 @cindex percussion staff
52 @cindex Gregorian transcription staff
53 @cindex rhythmic staff
60 @notation{Staves} (singular: @notation{staff}) are created with
61 the @code{\new} or @code{\context} commands. For details, see
62 @ref{Creating contexts}.
64 The basic staff context is @code{Staff}:
66 @lilypond[verbatim,quote,relative=2]
67 \new Staff { c4 d e f }
70 The @code{DrumStaff} context creates a five-line staff set up for
71 a typical drum set. Each instrument is shown with a different
72 symbol. The instruments are entered in drum mode following a
73 @code{\drummode} command, with each instrument specified by name.
74 For details, see @ref{Percussion staves}.
76 @lilypond[verbatim,quote]
78 \drummode { cymc hh ss tomh }
82 @code{RhythmicStaff} creates a single-line staff that only
83 displays the rhythmic values of the input. Real durations are
84 preserved. For details, see @ref{Showing melody rhythms}.
86 @lilypond[verbatim,quote,relative=2]
87 \new RhythmicStaff { c4 d e f }
90 @code{TabStaff} creates a tablature with six strings in standard
91 guitar tuning. For details, see @ref{Default tablatures}.
93 @lilypond[verbatim,quote,relative=2]
94 \new TabStaff { c4 d e f }
97 There are two staff contexts specific for the notation of ancient
98 music: @code{MensuralStaff} and @code{VaticanaStaff}. They are
99 described in @ref{Pre-defined contexts}.
101 The @code{GregorianTranscriptionStaff} context creates a staff to
102 notate modern Gregorian chant. It does not show bar lines.
104 @lilypond[verbatim,quote,relative=2]
105 \new GregorianTranscriptionStaff { c4 d e f e d }
108 New single staff contexts may be defined. For details, see
109 @ref{Defining new contexts}.
118 @ref{Creating contexts},
119 @ref{Percussion staves},
120 @ref{Showing melody rhythms},
121 @ref{Default tablatures},
122 @ref{Pre-defined contexts},
124 @ref{Gregorian chant contexts},
125 @ref{Mensural contexts},
126 @ref{Defining new contexts}.
129 @rlsr{Staff notation}.
133 @rinternals{DrumStaff},
134 @rinternals{GregorianTranscriptionStaff},
135 @rinternals{RhythmicStaff},
136 @rinternals{TabStaff},
137 @rinternals{MensuralStaff},
138 @rinternals{VaticanaStaff},
139 @rinternals{StaffSymbol}.
142 @node Grouping staves
143 @unnumberedsubsubsec Grouping staves
145 @cindex start of system
146 @cindex staff, multiple
147 @cindex staves, multiple
148 @cindex system start delimiters
149 @cindex bracket, vertical
150 @cindex brace, vertical
160 Various contexts exist to group single staves together in order to
161 form multi-stave systems. Each grouping context sets the style of
162 the system start delimiter and the behavior of bar lines.
164 If no context is specified, the default properties will be used:
165 the group is started with a vertical line, and the bar lines are
168 @lilypond[verbatim,quote,relative=2]
175 In the @code{StaffGroup} context, the group is started with a
176 bracket and bar lines are drawn through all the staves.
178 @lilypond[verbatim,quote,relative=2]
185 In a @code{ChoirStaff}, the group starts with a bracket, but bar
186 lines are not connected.
188 @lilypond[verbatim,quote,relative=2]
195 In a @code{GrandStaff}, the group begins with a brace, and bar
196 lines are connected between the staves.
198 @lilypond[verbatim,quote,relative=2]
205 The @code{PianoStaff} is identical to a @code{GrandStaff}, except
206 that it supports printing the instrument name directly. For
207 details, see @ref{Instrument names}.
209 @lilypond[verbatim,quote,relative=2]
211 \set PianoStaff.instrumentName = #"Piano"
217 Each staff group context sets the property
218 @code{systemStartDelimiter} to one of the following values:
219 @code{SystemStartBar}, @code{SystemStartBrace}, or
220 @code{SystemStartBracket}. A fourth delimiter,
221 @code{SystemStartSquare}, is also available, but it must be
222 explicitly specified.
224 New staff group contexts may be defined. For details, see
225 @ref{Defining new contexts}.
230 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
231 {use-square-bracket-at-the-start-of-a-staff-group.ly}
233 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
234 {display-bracket-with-only-one-staff-in-a-system.ly}
236 @cindex mensurstriche layout
237 @cindex renaissance music
238 @cindex transcription of mensural music
239 @cindex mensural music, transcription of
241 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
242 {mensurstriche-layout-bar-lines-between-the-staves.ly}
252 @ref{Instrument names},
253 @ref{Defining new contexts}.
256 @rlsr{Staff notation}.
260 @rinternals{StaffGroup},
261 @rinternals{ChoirStaff},
262 @rinternals{GrandStaff},
263 @rinternals{PianoStaff},
264 @rinternals{SystemStartBar},
265 @rinternals{SystemStartBrace},
266 @rinternals{SystemStartBracket},
267 @rinternals{SystemStartSquare}.
270 @node Nested staff groups
271 @unnumberedsubsubsec Nested staff groups
273 @cindex staff, nested
274 @cindex staves, nested
275 @cindex nesting of staves
276 @cindex system start delimiters, nested
277 @cindex nested staff brackets
278 @cindex brackets, nesting of
279 @cindex braces, nesting of
281 Staff-group contexts can be nested to arbitrary depths. In this
282 case, each child context creates a new bracket adjacent to the
283 bracket of its parent group.
285 @lilypond[verbatim,quote,relative=2]
287 \new Staff { c2 c | c2 c }
289 \new Staff { g2 g | g2 g }
290 \new StaffGroup \with {
291 systemStartDelimiter = #'SystemStartSquare
294 \new Staff { e2 e | e2 e }
295 \new Staff { c2 c | c2 c }
301 New nested staff group contexts can be defined. For details, see
302 @ref{Defining new contexts}.
307 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
313 @ref{Grouping staves},
314 @ref{Instrument names},
315 @ref{Defining new contexts}.
318 @rlsr{Staff notation}.
321 @rinternals{StaffGroup},
322 @rinternals{ChoirStaff},
323 @rinternals{SystemStartBar},
324 @rinternals{SystemStartBrace},
325 @rinternals{SystemStartBracket},
326 @rinternals{SystemStartSquare}.
329 @node Modifying single staves
330 @subsection Modifying single staves
332 This section explains how to change specific attributes of one
333 staff: for example, modifying the number of staff lines or the
334 staff size. Methods to start and stop staves and set ossia
335 sections are also described.
345 @unnumberedsubsubsec Staff symbol
347 @cindex adjusting staff symbol
348 @cindex drawing staff symbol
349 @cindex staff symbol, setting of
350 @cindex staff symbol, drawing
351 @cindex stop staff lines
352 @cindex start staff lines
353 @cindex staff lines, amount of
354 @cindex staff lines, number of
355 @cindex staff line, thickness of
356 @cindex amount of staff lines
357 @cindex thickness of staff lines
358 @cindex ledger lines, setting
359 @cindex setting of ledger lines
360 @cindex spacing of ledger lines
361 @cindex number of staff lines
363 The lines of a staff belong to the @code{StaffSymbol} grob.
364 @code{StaffSymbol} properties can be modified to change the
365 appearance of a staff, but they must be modified before the staff
368 The number of staff lines may be changed. The clef position and
369 the position of middle C may need to be modified to fit the new
370 staff. For an explanation, refer to the snippet section in
373 @lilypond[verbatim,quote,relative=2]
375 \override StaffSymbol #'line-count = #3
380 Staff line thickness can be modified. The thickness of ledger
381 lines and stems are also affected, since they depend on staff line
384 @lilypond[verbatim,quote,relative=1]
386 \override StaffSymbol #'thickness = #3
391 Ledger line thickness can be set independently of staff line
392 thickness. In the example the two numbers are factors multiplying
393 the staff line thickness and the staff line spacing. The two
394 contributions are added to give the ledger line thickness.
396 @lilypond[verbatim,quote,relative=1]
398 \override StaffSymbol #'ledger-line-thickness = #'(1 . 0.2)
403 The distance between staff lines can be changed. This setting
404 affects the spacing of ledger lines as well.
406 @lilypond[verbatim,quote,relative=1]
408 \override StaffSymbol #'staff-space = #1.5
413 Further details about the properties of @code{StaffSymbol} can be
414 found in @rinternals{staff-symbol-interface}.
416 @cindex stopping a staff
417 @cindex starting a staff
418 @cindex staff, starting
419 @cindex staff, stopping
421 @funindex \startStaff
426 Modifications to staff properties in the middle of a score can be
427 placed between @code{\stopStaff} and @code{\startStaff}:
429 @lilypond[verbatim,quote,relative=2]
432 \override Staff.StaffSymbol #'line-count = #2
436 \revert Staff.StaffSymbol #'line-count
442 In general, @code{\startStaff} and @code{\stopStaff} can be used
443 to stop or start a staff in the middle of a score.
445 @lilypond[verbatim,quote,relative=2]
462 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
463 {making-some-staff-lines-thicker-than-the-others.ly}
476 @rlsr{Staff notation}.
479 @rinternals{StaffSymbol},
480 @rinternals{staff-symbol-interface}.
485 When setting vertical staff line positions manually, bar lines are
486 always centered on position 0, so the maximum distance between the
487 outermost bar lines in either direction must be equal.
491 @unnumberedsubsubsec Ossia staves
493 @cindex staff, Frenched
495 @cindex Frenched staves
496 @cindex staff, resizing of
497 @cindex resizing of staves
499 @funindex \startStaff
504 @notation{Ossia} staves can be set by creating a new simultaneous
505 staff in the appropriate location:
507 @lilypond[verbatim,quote]
508 \new Staff \relative c'' {
512 \new Staff { e4 d f e }
519 However, the above example is not what is usually desired. To
520 create ossia staves that are above the original staff, have no
521 time signature or clef, and have a smaller font size, tweaks must
522 be used. The Learning Manual describes a specific technique to
523 achieve this goal, beginning with
524 @rlearning{Nesting music expressions}.
526 The following example uses the @code{alignAboveContext} property
527 to align the ossia staff. This method is most appropriate when
528 only a few ossia staves are needed.
530 @lilypond[verbatim,quote]
531 \new Staff = main \relative c'' {
537 \remove "Time_signature_engraver"
538 alignAboveContext = #"main"
540 \override StaffSymbol #'staff-space = #(magstep -3)
541 \override StaffSymbol #'thickness = #(magstep -3)
550 If many isolated ossia staves are needed, creating an empty
551 @code{Staff} context with a specific @emph{context id} may be more
552 appropriate; the ossia staves may then be created by
553 @emph{calling} this context and using @code{\startStaff} and
554 @code{\stopStaff} at the desired locations. The benefits of this
555 method are more apparent if the piece is longer than the following
558 @lilypond[verbatim,quote,ragged-right]
560 \new Staff = ossia \with {
561 \remove "Time_signature_engraver"
562 \override Clef #'transparent = ##t
564 \override StaffSymbol #'staff-space = #(magstep -3)
565 \override StaffSymbol #'thickness = #(magstep -3)
569 \new Staff \relative c' {
573 \context Staff = ossia {
574 \startStaff e4 g8 f e2 \stopStaff
581 \context Staff = ossia {
582 \startStaff g4 e8 f g2 \stopStaff
590 Using the @code{\RemoveEmptyStaffContext} command to create ossia
591 staves may be used as an alternative. This method is most
592 convenient when ossia staves occur immediately following a line
593 break. In this case, spacer rests do not need to be used at all;
594 only @code{\startStaff} and @code{\stopStaff} are necessary. For
595 more information about @code{\RemoveEmptyStaffContext}, see
598 @lilypond[verbatim,quote,ragged-right]
600 \new Staff = ossia \with {
601 \remove "Time_signature_engraver"
602 \override Clef #'transparent = ##t
604 \override StaffSymbol #'staff-space = #(magstep -3)
605 \override StaffSymbol #'thickness = #(magstep -3)
607 \new Staff \relative c' {
613 \context Staff = ossia {
614 c4 e8 d c2 \stopStaff
624 \RemoveEmptyStaffContext
625 \override VerticalAxisGroup #'remove-first = ##t
633 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
634 {vertically-aligning-ossias-and-lyrics.ly}
641 @rglos{Frenched staff}.
644 @rlearning{Nesting music expressions},
645 @rlearning{Size of objects},
646 @rlearning{Length and thickness of objects}.
652 @rlsr{Staff notation}.
655 @rinternals{StaffSymbol}.
659 @unnumberedsubsubsec Hiding staves
661 @cindex Frenched score
662 @cindex Frenched staff
663 @cindex staff, hiding
665 @cindex hiding of staves
668 @funindex \RemoveEmptyStaffContext
669 @funindex RemoveEmptyStaffContext
672 Staff lines can be hidden by removing the
673 @code{Staff_symbol_engraver} from the @code{Staff} context. As an
674 alternative, @code{\stopStaff} may be used.
676 @lilypond[verbatim,quote]
678 \remove "Staff_symbol_engraver"
680 \relative c''' { a8 f e16 d c b a2 }
684 Empty staves can be hidden by setting the
685 @code{\RemoveEmptyStaffContext} command in the @code{\layout}
686 block. In orchestral scores, this style is known as @q{Frenched
687 Score}. By default, this command hides and removes all empty
688 staves in a score except for those in the first system.
690 @warning{A staff is considered empty when it contains only
691 multi-measure rests, skips, spacer rests, or a combination of these
694 @lilypond[verbatim,quote,ragged-right]
697 \RemoveEmptyStaffContext
718 @code{\RemoveEmptyStaffContext} can also be used to create ossia
719 sections for a staff. For details, see @ref{Ossia staves}.
721 @cindex hiding ancient staves
722 @cindex hiding rhythmic staves
724 @funindex \RemoveEmptyStaffContext
725 @funindex RemoveEmptyStaffContext
726 @funindex \AncientRemoveEmptyStaffContext
727 @funindex AncientRemoveEmptyStaffContext
728 @funindex \RemoveEmptyRhythmicStaffContext
729 @funindex RemoveEmptyRhythmicStaffContext
731 The @code{\AncientRemoveEmptyStaffContext} command may be used to
732 hide empty staves in ancient music contexts. Similarly,
733 @code{\RemoveEmptyRhythmicStaffContext} may be used to hide empty
734 @code{RhythmicStaff} contexts.
738 @code{\RemoveEmptyStaffContext},
739 @code{\AncientRemoveEmptyStaffContext},
740 @code{\RemoveEmptyRhythmicStaffContext}.
746 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
747 {removing-the-first-empty-line.ly}
752 @rglos{Frenched staff}.
759 @rlsr{Staff notation}.
762 @rinternals{ChordNames},
763 @rinternals{FiguredBass},
766 @rinternals{VerticalAxisGroup},
767 @rinternals{Staff_symbol_engraver}.
772 Removing @code{Staff_symbol_engraver} also hides bar lines. If
773 bar line visibility is forced, formatting errors may occur. In
774 this case, use the following overrides instead of removing the
778 \override StaffSymbol #'stencil = ##f
779 \override NoteHead #'no-ledgers = ##t
784 @subsection Writing parts
786 This section explains how to insert tempo indications and
787 instrument names into a score. Methods to quote other voices and
788 format cue notes are also described.
793 * Quoting other voices::
794 * Formatting cue notes::
798 @node Metronome marks
799 @unnumberedsubsubsec Metronome marks
802 @cindex beats per minute
803 @cindex metronome marking
804 @cindex metronome marking with text
809 A basic metronome mark is simple to write:
811 @lilypond[verbatim,quote,relative=1]
817 Tempo indications with text can be used instead:
819 @lilypond[verbatim,quote,relative=2]
825 Combining a metronome mark and text will automatically place the
826 metronome mark within parentheses:
828 @lilypond[verbatim,quote,relative=2]
829 \tempo "Allegro" 4 = 160
834 In general, the text can be any markup object:
836 @lilypond[verbatim,quote,relative=2]
837 \tempo \markup { \italic Faster } 4 = 132
838 a8-. r8 b-. r gis-. r a-. r
841 A parenthesized metronome mark with no textual indication may be
842 written by including an empty string in the input:
844 @lilypond[verbatim,quote,relative=2]
852 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
853 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
855 @c perhaps also an example of how to move it horizontally?
857 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
858 {changing-the-tempo-without-a-metronome-mark.ly}
860 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
861 {creating-metronome-marks-in-markup-mode.ly}
863 For more details, see @ref{Formatting text}.
869 @rglos{metronomic indication},
870 @rglos{tempo indication},
871 @rglos{metronome mark}.
874 @ref{Formatting text},
878 @rlsr{Staff notation}.
881 @rinternals{MetronomeMark}.
884 @node Instrument names
885 @unnumberedsubsubsec Instrument names
887 @cindex instrument names
888 @cindex instrument names, short
890 Instrument names can be printed on the left side of staves in the
891 @code{Staff} and @code{PianoStaff} contexts. The value of
892 @code{instrumentName} is used for the first staff, and the value
893 of @code{shortInstrumentName} is used for all succeeding staves.
895 @lilypond[verbatim,quote,ragged-right,relative=1]
896 \set Staff.instrumentName = #"Violin "
897 \set Staff.shortInstrumentName = #"Vln "
903 Markup mode can be used to create more complicated instrument
906 @lilypond[verbatim,quote,relative=2]
907 \set Staff.instrumentName = \markup {
908 \column { "Clarinetti"
909 \line { "in B" \smaller \flat } } }
913 @cindex instrument names, centering
915 When two or more staff contexts are grouped together, the
916 instrument names and short instrument names are centered by
917 default. To center multi-line instrument names,
918 @code{\center-column} must be used:
920 @lilypond[verbatim,quote,indent=1.5\cm,relative=2]
923 \set Staff.instrumentName = #"Flute"
927 \set Staff.instrumentName = \markup \center-column {
929 \line { "in B" \smaller \flat }
937 @funindex short-indent
939 However, if the instrument names are longer, the instrument names
940 in a staff group may not be centered unless the @code{indent} and
941 @code{short-indent} settings are increased. For details about
942 these settings, see @ref{Horizontal dimensions}.
944 @lilypond[verbatim,quote,ragged-right]
947 short-indent = 1.5\cm
952 \set Staff.instrumentName = #"Alto Flute in G"
953 \set Staff.shortInstrumentName = #"Fl."
958 \set Staff.instrumentName = #"Clarinet"
959 \set Staff.shortInstrumentName = #"Clar."
966 To add instrument names to other contexts (such as
967 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}),
968 @code{Instrument_name_engraver} must be added to that context.
969 For details, see @ref{Modifying context plug-ins}.
971 @cindex instrument names, changing
972 @cindex changing instrument names
974 Instrument names may be changed in the middle of a piece:
976 @lilypond[verbatim,quote,ragged-right,relative=1]
977 \set Staff.instrumentName = #"First"
978 \set Staff.shortInstrumentName = #"one"
981 \set Staff.instrumentName = #"Second"
982 \set Staff.shortInstrumentName = #"two"
987 @cindex instrument switch
988 @cindex switching instruments
990 @funindex \addInstrumentDefinition
991 @funindex addInstrumentDefinition
992 @funindex \instrumentSwitch
993 @funindex instrumentSwitch
995 If an instrument @emph{switch} is needed,
996 @code{\addInstrumentDefinition} may be used in combination with
997 @code{\instrumentSwitch} to create a detailed list of the
998 necessary changes for the switch. The
999 @code{\addInstrumentDefinition} command has two arguments: an
1000 identifying string, and an association list of context properties
1001 and values to be used for the instrument. It must be placed in
1002 the toplevel scope. @code{\instrumentSwitch} is used in the music
1003 expression to declare the instrument switch:
1005 @lilypond[verbatim,quote,ragged-right]
1006 \addInstrumentDefinition #"contrabassoon"
1007 #`((instrumentTransposition . ,(ly:make-pitch -1 0 0))
1008 (shortInstrumentName . "Cbsn.")
1009 (clefGlyph . "clefs.F")
1010 (middleCPosition . 6)
1012 (instrumentCueName . ,(make-bold-markup "cbsn."))
1013 (midiInstrument . "bassoon"))
1016 instrumentName = #"Bassoon"
1020 \compressFullBarRests
1023 \instrumentSwitch "contrabassoon"
1032 @ref{Horizontal dimensions},
1033 @ref{Modifying context plug-ins}.
1036 @rlsr{Staff notation}.
1038 Internals Reference:
1039 @rinternals{InstrumentName},
1040 @rinternals{PianoStaff},
1044 @node Quoting other voices
1045 @unnumberedsubsubsec Quoting other voices
1048 @cindex quoting other voices
1054 @funindex \quoteDuring
1055 @funindex quoteDuring
1056 @funindex \transposition
1057 @funindex transposition
1059 It is very common for one voice to double some of the music from
1060 another voice. For example, the first and second violins may play the
1061 same notes during a passage of music. In LilyPond this is accomplished
1062 by letting one voice @emph{quote} the other voice without having to
1065 Before a part can be quoted, the @code{\addQuote} command must be used
1066 to initialize the quoted fragment. This command must be used in the
1067 toplevel scope. The first argument is an identifying string, and the
1068 second is a music expression:
1071 flute = \relative c'' @{
1074 \addQuote "flute" @{ \flute @}
1077 The @code{\quoteDuring} command is used to indicate the point where the
1078 quotation begins. It is followed by two arguments: the name of the
1079 quoted voice, as defined with @code{\addQuote}, and a music expression
1080 that indicates the duration of the quote, usually spacer rests or
1081 multi-measure rests. The corresponding music from the quoted voice is
1082 inserted into the music expression:
1084 @lilypond[verbatim,quote]
1085 flute = \relative c'' {
1088 \addQuote "flute" { \flute }
1091 c4 cis \quoteDuring #"flute" { s2 }
1095 If the music expression used for @code{\quoteDuring} contains
1096 anything but a spacer rest or multi-measure rest, a polyphonic
1097 situation is created, which is often not desirable:
1099 @lilypond[verbatim,quote]
1100 flute = \relative c'' {
1103 \addQuote "flute" { \flute }
1106 c4 cis \quoteDuring #"flute" { c4 b }
1110 Quotations recognize instrument transposition settings for both
1111 the source and target instruments if the @code{\transposition}
1112 command is used. For details about @code{\transposition}, see
1113 @ref{Instrument transpositions}.
1115 @lilypond[verbatim,quote]
1116 clarinet = \relative c'' {
1120 \addQuote "clarinet" { \clarinet }
1123 c4 cis \quoteDuring #"clarinet" { s2 }
1127 It is possible to tag quotations with unique names in order to
1128 process them in different ways. For details about this procedure,
1129 see @ref{Using tags}.
1134 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1135 {quoting-another-voice-with-transposition.ly}
1138 @cindex articulation-event
1139 @cindex dynamic-event
1141 @funindex quotedEventTypes
1143 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1144 {quoting-another-voice.ly}
1149 @ref{Instrument transpositions},
1153 @rlsr{Staff notation}.
1155 Internals Reference:
1156 @rinternals{QuoteMusic},
1162 Only the contents of the first @code{Voice} occurring in an
1163 @code{\addQuote} command will be considered for quotation, so
1164 @var{music} cannot contain @code{\new} and @code{\context Voice}
1165 statements that would switch to a different Voice.
1167 Quoting grace notes is broken and can even cause LilyPond to
1170 Quoting nested triplets may result in poor notation.
1172 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
1173 written entirely in lower-case letters: @code{\addquote}.
1176 @node Formatting cue notes
1177 @unnumberedsubsubsec Formatting cue notes
1181 @cindex cue notes, formatting
1183 @cindex quoting other voices
1184 @cindex cues, formatting
1186 @funindex \cueDuring
1189 The previous section explains how to create quotations. The
1190 @code{\cueDuring} command is a more specialized form of
1191 @code{\quoteDuring}, being particularly useful for inserting cue
1192 notes into a part. The syntax is as follows:
1195 \cueDuring #@var{partname} #@var{voice} @var{music}
1198 This command copies the corresponding measures from @var{partname}
1199 into a @code{CueVoice} context. The @code{CueVoice} is created
1200 implicitly, and occurs simultaneously with @var{music}, which
1201 creates a polyphonic situation. The @var{voice} argument
1202 determines whether the cue notes should be notated as a first or
1203 second voice; @code{UP} corresponds to the first voice, and
1204 @code{DOWN} corresponds to the second.
1206 @lilypond[verbatim,quote]
1207 oboe = \relative c'' {
1211 \addQuote "oboe" { \oboe }
1213 \new Voice \relative c'' {
1214 \cueDuring #"oboe" #UP { R1 }
1220 In the above example, the @code{Voice} context had to be
1221 explicitly declared, or else the entire music expression would
1222 belong to the @code{CueVoice} context.
1224 The name of the cued instrument can be printed by setting the
1225 @code{instrumentCueName} property in the @code{CueVoice} context.
1227 @lilypond[verbatim,quote]
1228 oboe = \relative c''' {
1231 \addQuote "oboe" { \oboe }
1233 \new Staff \relative c'' <<
1234 \new CueVoice \with {
1235 instrumentCueName = "ob."
1238 \cueDuring #"oboe" #UP { R1 }
1244 @cindex removing cues
1245 @cindex removing cue notes
1246 @cindex cue notes, removing
1250 @funindex \transposedCueDuring
1251 @funindex transposedCueDuring
1253 In addition to printing the name of the cued instrument, when cue
1254 notes end, the name of the original instrument should be printed,
1255 and any other changes introduced by the cued part should be
1256 undone. This can be accomplished by using
1257 @code{\addInstrumentDefinition} and @code{\instrumentSwitch}. For
1258 an example and explanation, see @ref{Instrument names}.
1260 The @code{\killCues} command removes cue notes from a music
1261 expression. This can be useful if cue notes need to be removed
1262 from a part but may be restored at a later time.
1264 @lilypond[verbatim,quote]
1265 flute = \relative c''' {
1268 \addQuote "flute" { \flute }
1270 \new Voice \relative c'' {
1272 \cueDuring #"flute" #UP { R1 }
1278 The @code{\transposedCueDuring} command is useful for adding
1279 instrumental cues from a completely different register. The
1280 syntax is similar to @code{\cueDuring}, but it requires one extra
1281 argument to specify the transposition of the cued instrument. For
1282 more information about transposition, see
1283 @ref{Instrument transpositions}.
1285 @lilypond[verbatim,quote]
1286 piccolo = \relative c''' {
1292 \addQuote "piccolo" { \piccolo }
1294 cbassoon = \relative c, {
1297 \transposedCueDuring #"piccolo" #UP c,, { R1 }
1302 \new Staff = "piccolo" \piccolo
1303 \new Staff = "cbassoon" \cbassoon
1307 It is possible to tag cued parts with unique names in order to
1308 process them in different ways. For details about this procedure,
1309 see @ref{Using tags}.
1314 @ref{Instrument transpositions},
1315 @ref{Instrument names},
1319 @rlsr{Staff notation}.
1321 Internals Reference:
1322 @rinternals{CueVoice},
1328 Collisions can occur with rests, when using @code{\cueDuring},
1329 between @code{Voice} and @code{CueVoice} contexts.