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 staff appearance, print
17 scores with more than one staff, and how to apply specific
18 performance marks to single 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 percussion staff
50 @cindex Gregorian transcription staff
51 @cindex rhythmic staff
55 @notation{Staves} (singular: @notation{staff}) are created with
56 the @code{\new} or @code{\context} commands. For details, see
57 @ref{Creating contexts}.
59 The basic staff context is @code{Staff}:
61 @lilypond[verbatim,quote,relative=2]
62 \new Staff { c4 d e f }
65 @code{DrumStaff} creates a five-line staff set up for a
66 typical drum set. It uses different names for each instrument.
67 The instrument names are set using the @code{\drummode} command.
68 For details, see @ref{Percussion staves}.
70 @lilypond[verbatim,quote]
72 \drummode { cymc hh ss tomh }
76 @c FIXME: remove when mentioned in NR 2.8
77 @code{GregorianTranscriptionStaff} creates a staff to notate
78 modern Gregorian chant. It does not show bar lines.
80 @lilypond[verbatim,quote,relative=2]
81 \new GregorianTranscriptionStaff { c4 d e f e d }
84 @code{RhythmicStaff} creates a single-line staff that only
85 displays the rhythmic values of the input. Real durations are
86 preserved. For details, see @ref{Showing melody rhythms}.
88 @lilypond[verbatim,quote,relative=2]
89 \new RhythmicStaff { c4 d e f }
92 @code{TabStaff} creates a tablature with six strings in standard
93 guitar tuning. For details, see @ref{Default tablatures}.
95 @lilypond[verbatim,quote,relative=2]
96 \new TabStaff { c4 d e f }
99 There are two staff contexts specific for the notation of ancient
100 music: @code{MensuralStaff} and @code{VaticanaStaff}. They are
101 described in @ref{Pre-defined contexts}.
103 New single staff contexts may be defined. For details, see
104 @ref{Defining new contexts}.
114 @ref{Creating contexts},
115 @ref{Percussion staves},
116 @ref{Showing melody rhythms},
117 @ref{Default tablatures},
118 @ref{Pre-defined contexts},
120 @ref{Gregorian chant contexts},
121 @ref{Mensural contexts},
122 @ref{Defining new contexts}.
125 @rlsr{Staff notation}.
129 @rinternals{DrumStaff},
130 @rinternals{GregorianTranscriptionStaff},
131 @rinternals{RhythmicStaff},
132 @rinternals{TabStaff},
133 @rinternals{MensuralStaff},
134 @rinternals{VaticanaStaff},
135 @rinternals{StaffSymbol}.
138 @node Grouping staves
139 @unnumberedsubsubsec Grouping staves
141 @cindex start of system
142 @cindex staff, multiple
143 @cindex staves, multiple
144 @cindex system start delimiters
145 @cindex bracket, vertical
146 @cindex brace, vertical
155 Various contexts exist to group single staves together in order to
156 form multi-stave systems. Each grouping context sets the style of
157 the system start delimiter and the behavior of bar lines.
159 If no context is specified, the default properties will be used:
160 the group is started with a vertical line, and the bar lines are
163 @lilypond[verbatim,quote,relative=2]
170 In the @code{StaffGroup} context, the group is started with a
171 bracket and bar lines are drawn through all the staves.
173 @lilypond[verbatim,quote,relative=2]
180 In a @code{ChoirStaff}, the group starts with a bracket, but bar
181 lines are not connected.
183 @lilypond[verbatim,quote,relative=2]
190 In a @code{GrandStaff}, the group begins with a brace, and bar
191 lines are connected between the staves.
193 @lilypond[verbatim,quote,relative=2]
200 The @code{PianoStaff} is identical to a @code{GrandStaff}, except
201 that it supports printing the instrument name directly. For
202 details, see @ref{Instrument names}.
204 @lilypond[verbatim,quote,relative=2]
206 \set PianoStaff.instrumentName = "Piano"
212 Each staff group context sets the property
213 @code{systemStartDelimiter} to one of the following values:
214 @code{SystemStartBar}, @code{SystemStartBrace}, or
215 @code{SystemStartBracket}. A fourth delimiter,
216 @code{SystemStartSquare}, is also available, but it must be
217 explicitly specified.
219 New staff group contexts may be defined. For details, see
220 @ref{Defining new contexts}.
225 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
226 {use-square-bracket-at-the-start-of-a-staff-group.ly}
228 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
229 {display-bracket-with-only-one-staff-in-a-system.ly}
231 @cindex mensurstriche layout
232 @cindex renaissance music
233 @cindex transcription of mensural music
234 @cindex mensural music, transcription of
236 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
237 {mensurstriche-layout-bar-lines-between-the-staves.ly}
238 @c FIXME: move to NR 2.8.x when sectioning is ready
249 @ref{Instrument names},
250 @ref{Defining new contexts}.
253 @rlsr{Staff notation}.
257 @rinternals{StaffGroup},
258 @rinternals{ChoirStaff},
259 @rinternals{GrandStaff},
260 @rinternals{PianoStaff},
261 @rinternals{SystemStartBar},
262 @rinternals{SystemStartBrace},
263 @rinternals{SystemStartBracket},
264 @rinternals{SystemStartSquare}.
267 @node Nested staff groups
268 @unnumberedsubsubsec Nested staff groups
270 @cindex staff, nested
271 @cindex staves, nested
272 @cindex nesting of staves
273 @cindex system start delimiters, nested
274 @cindex nested staff brackets
275 @cindex brackets, nesting of
276 @cindex braces, nesting of
277 @cindex inner staff group
278 @cindex inner choir staff group
280 Two additional staff-group contexts are available that can be
281 nested within a @code{StaffGroup} or @code{ChoirStaff} context:
282 @code{InnerStaffGroup} and @code{InnerChoirStaff}. These contexts
283 create a new bracket adjacent to the bracket of their parent staff
286 An @code{InnerStaffGroup} is treated similarly to a
287 @code{StaffGroup}; bar lines are connected between each staff
290 @lilypond[verbatim,quote,relative=2]
292 \new Staff { c2 c | c2 c }
293 \new InnerStaffGroup <<
294 \new Staff { g2 g | g2 g }
295 \new Staff { e2 e | e2 e }
300 Bar lines are @emph{not} connected between staves of an
301 @code{InnerChoirStaff}, just like a @code{ChoirStaff}:
303 @lilypond[verbatim,quote,relative=2]
305 \new Staff { c2 c | c2 c }
306 \new InnerChoirStaff <<
307 \new Staff { g2 g | g2 g }
308 \new Staff { e2 e | e2 e }
310 \new Staff { c1 | c1 }
314 New nested staff group contexts can be defined. For details, see
315 @ref{Defining new contexts}.
320 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
327 @ref{Grouping staves},
328 @ref{Instrument names},
329 @ref{Defining new contexts}.
332 @rlsr{Staff notation}.
335 @rinternals{InnerStaffGroup},
336 @rinternals{StaffGroup},
337 @rinternals{InnerChoirStaff},
338 @rinternals{ChoirStaff},
339 @rinternals{SystemStartBar},
340 @rinternals{SystemStartBrace},
341 @rinternals{SystemStartBracket},
342 @rinternals{SystemStartSquare}.
345 @node Modifying single staves
346 @subsection Modifying single staves
348 This section explains how to change specific attributes of one
349 staff: for example, modifying the number of staff lines or the
350 staff size. Methods to start and stop staves and set ossia
351 sections are also described.
361 @unnumberedsubsubsec Staff symbol
363 @cindex adjusting staff symbol
364 @cindex drawing staff symbol
365 @cindex staff symbol, setting of
366 @cindex stop staff lines
367 @cindex start staff lines
368 @cindex staff lines, amount of
369 @cindex staff lines, number of
370 @cindex staff line, thickness of
371 @cindex amount of staff lines
372 @cindex thickness of staff lines
373 @cindex ledger lines, setting
374 @cindex setting of ledger lines
375 @cindex spacing of ledger lines
376 @cindex number of staff lines
378 The lines of a staff belong to the @code{StaffSymbol} grob.
379 @code{StaffSymbol} properties can be modified to change the
380 appearance of a staff, but they must be modified before the staff
383 @c FIXME most of this section should be moved to NR 5.3 or moved to LSR -td
385 The number of staff lines may be changed. The clef position and
386 the position of middle C may need to be modified to fit the new
387 staff. For an explanation, refer to the snippet section in
390 @lilypond[verbatim,quote,relative=2]
392 \override StaffSymbol #'line-count = #3
397 The vertical position of staff lines and the number of staff lines
398 can be defined at the same time. As the following example shows,
399 note positions are not influenced by the staff line positions.
401 @warning{The @code{'line-positions} property overrides the
402 @code{'line-count} property. The number of staff lines is
403 implicitly defined by the number of elements in the list of values
404 for @code{'line-positions}.}
406 @lilypond[verbatim,quote,relative=1]
408 \override StaffSymbol #'line-positions = #'(7 3 0 -4 -6 -7)
413 Staff line thickness can be modified. The thickness of ledger
414 lines and stems are also affected, since they depend on staff line
417 @lilypond[verbatim,quote,relative=1]
419 \override StaffSymbol #'thickness = #3
424 Ledger line thickness can be set independently of staff line
427 @lilypond[verbatim,quote,relative=1]
429 \override StaffSymbol #'ledger-line-thickness = #'(1 . 0.2)
434 The distance between staff lines can be changed. This setting
435 affects the spacing of ledger lines as well.
437 @lilypond[verbatim,quote,relative=1]
439 \override StaffSymbol #'staff-space = #1.5
444 The width of a staff can be modified. The units are staff
445 spaces. The spacing of objects inside the staff is not affected by
448 @lilypond[verbatim,quote,relative=1]
450 \override StaffSymbol #'width = #23
455 Further details about the properties of @code{StaffSymbol} can be
456 found in @rinternals{staff-symbol-interface}.
458 @funindex \startStaff
461 Modifications to staff properties in the middle of a score can be
462 placed between @code{\stopStaff} and @code{\startStaff}:
464 @lilypond[verbatim,quote,relative=2]
467 \override Staff.StaffSymbol #'line-count = #2
471 \revert Staff.StaffSymbol #'line-count
476 @cindex stopping a staff
479 In general, @code{\startStaff} and @code{\stopStaff} can be used
480 to stop or start a staff in the middle of a score.
482 @lilypond[verbatim,quote,relative=2]
499 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
500 {making-some-staff-lines-thicker-than-the-others.ly}
514 @rlsr{Staff notation}.
517 @rinternals{StaffSymbol},
518 @rinternals{staff-symbol-interface}.
523 When setting vertical staff line positions manually, bar lines are
524 always centered on position 0, so the maximum distance between the
525 outermost bar lines in either direction must be equal.
529 @unnumberedsubsubsec Ossia staves
531 @cindex staff, Frenched
533 @cindex Frenched staves
534 @cindex staff, resizing of
535 @cindex resizing of staves
537 @notation{Ossia} staves can be set by creating a new simultaneous
538 staff in the appropriate location:
540 @lilypond[verbatim,quote]
541 \new Staff \relative c'' {
545 \new Staff { e4 d f e }
552 However, the above example is usually not the desired result. To
553 create ossia staves that are above the original staff, have no
554 time signature or clef, and have a smaller font size, tweaks must
555 be used. The Learning Manual describes a specific technique to
556 achieve this goal, beginning with
557 @rlearning{Nesting music expressions}.
559 The following example uses the @code{alignAboveContext} property
560 to align the ossia staff. This method is most appropriate when
561 only a few ossia staves are needed.
563 @lilypond[verbatim,quote]
564 \new Staff = main \relative c'' {
570 \remove "Time_signature_engraver"
571 alignAboveContext = #"main"
573 \override StaffSymbol #'staff-space = #(magstep -3)
574 \override StaffSymbol #'thickness = #(magstep -3)
583 If many isolated ossia staves are needed, creating an empty
584 @code{Staff} context with a specific @emph{context id} may be more
585 appropriate; the ossia staves may then be created by
586 @emph{calling} this context and using @code{\startStaff} and
587 @code{\stopStaff} at the desired locations. The benefits of this
588 method are more apparent if the piece is longer than the following
591 @lilypond[verbatim,quote,ragged-right]
593 \new Staff = ossia \with {
594 \remove "Time_signature_engraver"
595 \override Clef #'transparent = ##t
597 \override StaffSymbol #'staff-space = #(magstep -3)
598 \override StaffSymbol #'thickness = #(magstep -3)
602 \new Staff \relative c' {
606 \context Staff = ossia {
607 \startStaff e4 g8 f e2 \stopStaff
614 \context Staff = ossia {
615 \startStaff g4 e8 f g2 \stopStaff
623 Using the @code{\RemoveEmptyStaffContext} command to create ossia
624 staves may be used as an alternative. This method is most
625 convenient when ossia staves occur immediately following a line
626 break. In this case, spacer rests do not need to be used at all;
627 only @code{\startStaff} and @code{\stopStaff} are necessary. For
628 more information about @code{\RemoveEmptyStaffContext}, see
631 @lilypond[verbatim,quote,ragged-right]
633 \new Staff = ossia \with {
634 \remove "Time_signature_engraver"
635 \override Clef #'transparent = ##t
637 \override StaffSymbol #'staff-space = #(magstep -3)
638 \override StaffSymbol #'thickness = #(magstep -3)
640 \new Staff \relative c' {
646 \context Staff = ossia {
647 c4 e8 d c2 \stopStaff
657 \RemoveEmptyStaffContext
658 \override VerticalAxisGroup #'remove-first = ##t
666 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
667 {vertically-aligning-ossias-and-lyrics.ly}
675 @rglos{Frenched staff}.
678 @rlearning{Nesting music expressions},
679 @rlearning{Size of objects},
680 @rlearning{Length and thickness of objects}.
686 @rlsr{Staff notation}.
689 @rinternals{StaffSymbol}.
693 @unnumberedsubsubsec Hiding staves
695 @cindex Frenched score
696 @cindex Frenched staff
697 @cindex staff, hiding
699 @cindex hiding of staves
702 Staff lines can be hidden by removing the
703 @code{Staff_symbol_engraver} from the @code{Staff} context. As an
704 alternative, @code{\stopStaff} may be used.
706 @lilypond[verbatim,quote]
708 \remove "Staff_symbol_engraver"
710 \relative c''' { a8 f e16 d c b a2 }
713 @funindex \RemoveEmptyStaffContext
715 Empty staves can be hidden by setting the
716 @code{\RemoveEmptyStaffContext} command in the @code{\layout}
717 block. In orchestral scores, this style is known as @q{Frenched
718 Score}. By default, this command hides and removes all empty
719 staves in a score except for those in the first system.
721 @warning{An empty staff may only include multi-measure rests,
722 skips, spacer rests, or a combination of these elements.}
724 @lilypond[verbatim,quote,ragged-right]
727 \RemoveEmptyStaffContext
748 @code{\RemoveEmptyStaffContext} can also be used to create ossia
749 sections for a staff. For details, see @ref{Ossia staves}.
751 @cindex hiding ancient staves
752 @cindex hiding rhythmic staves
753 @funindex \AncientRemoveEmptyStaffContext
754 @funindex \RemoveEmptyRhythmicStaffContext
756 The @code{\AncientRemoveEmptyStaffContext} command may be used to
757 hide empty staves in ancient music contexts. Similarly,
758 @code{\RemoveEmptyRhythmicStaffContext} may be used to hide empty
759 @code{RhythmicStaff} contexts.
764 @code{\RemoveEmptyStaffContext},
765 @code{\AncientRemoveEmptyStaffContext},
766 @code{\RemoveEmptyRhythmicStaffContext}.
771 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
772 {removing-the-first-empty-line.ly}
778 @rglos{Frenched staff}.
785 @rlsr{Staff notation}.
788 @rinternals{ChordNames},
789 @rinternals{FiguredBass},
792 @rinternals{VerticalAxisGroup},
793 @rinternals{Staff_symbol_engraver}.
798 Removing @code{Staff_symbol_engraver} also hides bar lines. If
799 bar line visibility is forced, formatting errors may occur. In
800 this case, use the following overrides instead of removing the
804 \override StaffSymbol #'stencil = ##f
805 \override NoteHead #'no-ledgers = ##t
810 @subsection Writing parts
812 This section explains how to insert tempo indications and
813 instrument names into a score. Methods to quote other voices and
814 format cue notes are also described.
819 * Quoting other voices::
820 * Formatting cue notes::
824 @node Metronome marks
825 @unnumberedsubsubsec Metronome marks
828 @cindex beats per minute
829 @cindex metronome marking
830 @cindex metronome marking with text
833 A basic metronome mark is simple to write:
835 @lilypond[verbatim,quote,relative=1]
841 Tempo indications with text can be used instead:
843 @lilypond[verbatim,quote,relative=2]
849 Combining a metronome mark and text will automatically place the
850 metronome mark within parentheses:
852 @lilypond[verbatim,quote,relative=2]
853 \tempo "Allegro" 4 = 160
858 In general, the text can be any markup object:
860 @lilypond[verbatim,quote,relative=2]
861 \tempo \markup { \italic Faster } 4 = 132
862 a8-. r8 b-. r gis-. r a-. r
865 A parenthesized metronome mark with no textual indication may be
866 written by including an empty string in the input:
868 @lilypond[verbatim,quote,relative=2]
876 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
877 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
879 @c perhaps also an example of how to move it horizontally?
881 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
882 {changing-the-tempo-without-a-metronome-mark.ly}
884 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
885 {creating-metronome-marks-in-markup-mode.ly}
887 For more details, see @ref{Formatting text}.
894 @rglos{metronomic indication},
895 @rglos{tempo indication},
896 @rglos{metronome mark}.
899 @ref{Formatting text},
903 @rlsr{Staff notation}.
906 @rinternals{MetronomeMark}.
909 @node Instrument names
910 @unnumberedsubsubsec Instrument names
912 @cindex instrument names
913 @cindex instrument names, short
915 Instrument names can be printed on the left side of staves in the
916 @code{Staff} and @code{PianoStaff} contexts. The value of
917 @code{instrumentName} is used for the first staff, and the value
918 of @code{shortInstrumentName} is used for all succeeding staves.
920 @lilypond[verbatim,quote,ragged-right,relative=1]
921 \set Staff.instrumentName = "Violin "
922 \set Staff.shortInstrumentName = "Vln "
928 Markup mode can be used to create more complicated instrument
931 @lilypond[verbatim,quote,relative=2]
932 \set Staff.instrumentName = \markup {
933 \column { "Clarinetti"
934 \line { "in B" \smaller \flat } } }
938 @cindex instrument names, centering
940 When two or more staff contexts are grouped together, the
941 instrument names and short instrument names are centered by
942 default. To center multi-line instrument names,
943 @code{\center-column} must be used:
945 @lilypond[verbatim,quote,indent=1.5\cm,relative=2]
948 \set Staff.instrumentName = "Flute"
952 \set Staff.instrumentName = \markup \center-column {
954 \line { "in B" \smaller \flat }
964 However, if the instrument names are longer, the instrument names
965 in a staff group may not be centered unless the @code{indent} and
966 @code{short-indent} settings are increased. For details about
967 these settings, see @ref{Horizontal dimensions}.
969 @lilypond[verbatim,quote,ragged-right]
972 short-indent = 1.5\cm
977 \set Staff.instrumentName = "Alto Flute in G"
978 \set Staff.shortInstrumentName = "Fl."
983 \set Staff.instrumentName = "Clarinet"
984 \set Staff.shortInstrumentName = "Clar."
991 To add instrument names to other contexts (such as
992 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}),
993 @code{Instrument_name_engraver} must be added to that context.
994 For details, see @ref{Modifying context plug-ins}.
996 @cindex instrument names, changing
998 Instrument names may be changed in the middle of a piece:
1000 @lilypond[verbatim,quote,ragged-right,relative=1]
1001 \set Staff.instrumentName = "First"
1002 \set Staff.shortInstrumentName = "one"
1005 \set Staff.instrumentName = "Second"
1006 \set Staff.shortInstrumentName = "two"
1011 @cindex instrument switch
1012 @cindex switching instruments
1014 If an instrument @emph{switch} is needed,
1015 @code{\addInstrumentDefinition} may be used in combination with
1016 @code{\instrumentSwitch} to create a detailed list of the
1017 necessary changes for the switch. The
1018 @code{\addInstrumentDefinition} command has two arguments: an
1019 identifying string, and an association list of context properties
1020 and values to be used for the instrument. It must be placed in
1021 the toplevel scope. @code{\instrumentSwitch} is used in the music
1022 expression to declare the instrument switch:
1024 @lilypond[verbatim,quote,ragged-right]
1025 \addInstrumentDefinition #"contrabassoon"
1026 #`((instrumentTransposition . ,(ly:make-pitch -1 0 0))
1027 (shortInstrumentName . "Cbsn.")
1028 (clefGlyph . "clefs.F")
1029 (middleCPosition . 6)
1031 (instrumentCueName . ,(make-bold-markup "cbsn."))
1032 (midiInstrument . "bassoon"))
1035 instrumentName = "Bassoon"
1039 \compressFullBarRests
1042 \instrumentSwitch "contrabassoon"
1052 @ref{Horizontal dimensions},
1053 @ref{Modifying context plug-ins}.
1056 @rlsr{Staff notation}.
1058 Internals Reference:
1059 @rinternals{InstrumentName},
1060 @rinternals{PianoStaff},
1064 @node Quoting other voices
1065 @unnumberedsubsubsec Quoting other voices
1068 @cindex quoting other voices
1072 It is very common for one voice to double the some of the music from
1073 another voice. For example, the first and second violins may play the
1074 same notes during a passage of music. In LilyPond this is accomplished
1075 by letting one voice @emph{quote} the other voice without having to
1078 Before a part can be quoted, the @code{\addQuote} command must be used
1079 to initialize the quoted fragment. This command must be used in the
1080 toplevel scope. The first argument is an identifying string, and the
1081 second is a music expression:
1084 flute = \relative c'' @{
1087 \addQuote "flute" @{ \flute @}
1090 The @code{\quoteDuring} command is used to indicate the point where the
1091 quotation begins. It is followed by two arguments: the name of the
1092 quoted voice, as defined with @code{\addQuote}, and a music expression
1093 that indicates the duration of the quote, usually spacer rests or
1094 multi-measure rests. The corresponding music from the quoted voice is
1095 inserted into the music expression:
1097 @lilypond[verbatim,quote]
1098 flute = \relative c'' {
1101 \addQuote "flute" { \flute }
1104 c4 cis \quoteDuring #"flute" { s2 }
1108 If the music expression used for @code{\quoteDuring} contains
1109 anything but a spacer rest or multi-measure rest, a polyphonic
1110 situation is created, which is often not desirable:
1112 @lilypond[verbatim,quote]
1113 flute = \relative c'' {
1116 \addQuote "flute" { \flute }
1119 c4 cis \quoteDuring #"flute" { c4 b }
1123 Quotations recognize instrument transposition settings for both
1124 the source and target instruments if the @code{\transposition}
1125 command is used. For details about @code{\transposition}, see
1126 @ref{Instrument transpositions}.
1128 @lilypond[verbatim,quote]
1129 clarinet = \relative c'' {
1133 \addQuote "clarinet" { \clarinet }
1136 c4 cis \quoteDuring #"clarinet" { s2 }
1140 It is possible to tag quotations with unique names in order to
1141 process them in different ways. For details about this procedure,
1142 see @ref{Using tags}.
1147 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1148 {quoting-another-voice-with-transposition.ly}
1151 @cindex articulation-event
1152 @cindex dynamic-event
1154 @funindex quotedEventTypes
1156 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1157 {quoting-another-voice.ly}
1163 @ref{Instrument transpositions},
1167 @rlsr{Staff notation}.
1169 Internals Reference:
1170 @rinternals{QuoteMusic},
1176 Only the contents of the first @code{Voice} occurring in an
1177 @code{\addQuote} command will be considered for quotation, so
1178 @var{music} cannot contain @code{\new} and @code{\context Voice}
1179 statements that would switch to a different Voice.
1181 Quoting grace notes is broken and can even cause LilyPond to
1184 Quoting nested triplets may result in poor notation.
1186 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
1187 written entirely in lower-case letters: @code{\addquote}.
1190 @node Formatting cue notes
1191 @unnumberedsubsubsec Formatting cue notes
1195 @cindex cue notes, formatting
1197 @cindex quoting other voices
1198 @cindex cues, formatting
1200 The previous section explains how to create quotations. The
1201 @code{\cueDuring} command is a more specialized form of
1202 @code{\quoteDuring}, being particularly useful for inserting cue
1203 notes into a part. The syntax is as follows:
1206 \cueDuring #@var{partname} #@var{voice} @var{music}
1209 This command copies the corresponding measures from @var{partname}
1210 into a @code{CueVoice} context. The @code{CueVoice} is created
1211 implicitly, and occurs simultaneously with @var{music}, which
1212 creates a polyphonic situation. The @var{voice} argument
1213 determines whether the cue notes should be notated as a first or
1214 second voice; @code{UP} corresponds to the first voice, and
1215 @code{DOWN} corresponds to the second.
1217 @lilypond[verbatim,quote]
1218 oboe = \relative c'' {
1222 \addQuote "oboe" { \oboe }
1224 \new Voice \relative c'' {
1225 \cueDuring #"oboe" #UP { R1 }
1231 In the above example, the @code{Voice} context had to be
1232 explicitly declared, or else the entire music expression would
1233 belong to the @code{CueVoice} context.
1235 The name of the cued instrument can be printed by setting the
1236 @code{instrumentCueName} property in the @code{CueVoice} context.
1238 @lilypond[verbatim,quote]
1239 oboe = \relative c''' {
1242 \addQuote "oboe" { \oboe }
1244 \new Staff \relative c'' <<
1245 \new CueVoice \with {
1246 instrumentCueName = "ob."
1249 \cueDuring #"oboe" #UP { R1 }
1255 In addition to printing the name of the cued instrument, when cue
1256 notes end, the name of the original instrument should be printed,
1257 and any other changes introduced by the cued part should be
1258 undone. This can be accomplished by using
1259 @code{\addInstrumentDefinition} and @code{\instrumentSwitch}. For
1260 an example and explanation, see @ref{Instrument names}.
1262 The @code{\killCues} command removes cue notes from a music
1263 expression. This can be useful if cue notes need to be removed
1264 from a part but may be restored at a later time.
1266 @lilypond[verbatim,quote]
1267 flute = \relative c''' {
1270 \addQuote "flute" { \flute }
1272 \new Voice \relative c'' {
1274 \cueDuring #"flute" #UP { R1 }
1280 The @code{\transposedCueDuring} command is useful for adding
1281 instrumental cues from a completely different register. The
1282 syntax is similar to @code{\cueDuring}, but it requires one extra
1283 argument to specify the transposition of the cued instrument. For
1284 more information about transposition, see
1285 @ref{Instrument transpositions}.
1287 @lilypond[verbatim,quote]
1288 piccolo = \relative c''' {
1294 \addQuote "piccolo" { \piccolo }
1296 cbassoon = \relative c, {
1299 \transposedCueDuring #"piccolo" #UP c,, { R1 }
1304 \new Staff = "piccolo" \piccolo
1305 \new Staff = "cbassoon" \cbassoon
1309 It is possible to tag cued parts with unique names in order to
1310 process them in different ways. For details about this procedure,
1311 see @ref{Using tags}.
1317 @ref{Instrument transpositions},
1318 @ref{Instrument names},
1322 @rlsr{Staff notation}.
1324 Internals Reference:
1325 @rinternals{CueVoice},
1331 Collisions can occur with rests, when using @code{\cueDuring},
1332 between @code{Voice} and @code{CueVoice} contexts.