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
31 grouping staves, which are marked at the beginning of each line
32 with either a bracket or a brace.
35 * Instantiating new staves::
37 * Nested staff groups::
41 @node Instantiating new staves
42 @unnumberedsubsubsec Instantiating new staves
45 @cindex staff initiation
46 @cindex staff instantiation
50 @cindex percussion staff
51 @cindex Gregorian transcription staff
52 @cindex rhythmic staff
56 @notation{Staves} (singular: @notation{staff}) are created with
57 the @code{\new} or @code{\context} commands. For details, see
58 @ref{Creating contexts}.
60 The basic staff context is @code{Staff}:
62 @lilypond[verbatim,quote,relative=2]
63 \new Staff { c4 d e f }
66 @code{DrumStaff} creates a five-line staff set up for a
67 typical drum set. It uses different names for each instrument.
68 The instrument names are set using the @code{\drummode} command.
69 For details, see @ref{Percussion staves}.
71 @lilypond[verbatim,quote]
73 \drummode { cymc hh ss tomh }
77 @c FIXME: remove when mentioned in NR 2.8
78 @code{GregorianTranscriptionStaff} creates a staff to notate
79 modern Gregorian chant. It does not show bar lines.
81 @lilypond[verbatim,quote,relative=2]
82 \new GregorianTranscriptionStaff { c4 d e f }
85 @code{RhythmicStaff} creates a single-line staff that only
86 displays the rhythmic values of the input. Real durations are
87 preserved. For details, see @ref{Showing melody rhythms}.
89 @lilypond[verbatim,quote,relative=2]
90 \new RhythmicStaff { c4 d e f }
93 @code{TabStaff} creates a tablature with six strings in standard
94 guitar tuning. For details, see @ref{Default tablatures}.
96 @lilypond[verbatim,quote,relative=2]
97 \new TabStaff { c4 d e f }
100 There are two staff contexts specific for the notation of ancient
101 music: @code{MensuralStaff} and @code{VaticanaStaff}. They are
102 described in @ref{Pre-defined contexts}.
104 New single staff contexts may be defined. For details, see
105 @ref{Defining new contexts}.
115 @ref{Creating contexts},
116 @ref{Percussion staves},
117 @ref{Showing melody rhythms},
118 @ref{Default tablatures},
119 @ref{Pre-defined contexts},
121 @ref{Gregorian chant contexts},
122 @ref{Mensural contexts},
123 @ref{Defining new contexts}.
126 @rlsr{Staff notation}.
130 @rinternals{DrumStaff},
131 @rinternals{GregorianTranscriptionStaff},
132 @rinternals{RhythmicStaff},
133 @rinternals{TabStaff},
134 @rinternals{MensuralStaff},
135 @rinternals{VaticanaStaff},
136 @rinternals{StaffSymbol}.
139 @node Grouping staves
140 @unnumberedsubsubsec Grouping staves
142 @cindex start of system
143 @cindex staff, multiple
144 @cindex staves, multiple
145 @cindex system start delimiters
146 @cindex bracket, vertical
147 @cindex brace, vertical
156 Various contexts exist to group single staves together in order to
157 form multi-stave systems. Each grouping context sets the style of
158 the system start delimiter and the behavior of bar lines.
160 If no context is specified, the default properties will be used:
161 the group is started with a vertical line, and the bar lines are
164 @lilypond[verbatim,quote,relative=2]
171 In the @code{StaffGroup} context, the group is started with a
172 bracket and bar lines are drawn through all the staves.
174 @lilypond[verbatim,quote,relative=2]
181 In a @code{ChoirStaff}, the group starts with a bracket, but bar
182 lines are not connected.
184 @lilypond[verbatim,quote,relative=2]
191 In a @code{GrandStaff}, the group begins with a brace, and bar
192 lines are connected between the staves.
194 @lilypond[verbatim,quote,relative=2]
201 The @code{PianoStaff} is identical to a @code{GrandStaff}, except
202 that it supports printing the instrument name directly. For
203 details, see @ref{Instrument names}.
205 @lilypond[verbatim,quote,relative=2]
207 \set PianoStaff.instrumentName = "Piano"
213 Each staff group context sets the property
214 @code{systemStartDelimiter} to one of the following values:
215 @code{SystemStartBar}, @code{SystemStartBrace}, or
216 @code{SystemStartBracket}. A fourth delimiter,
217 @code{SystemStartSquare}, is also available, but it must be
218 explicitly specified.
220 New staff group contexts may be defined. For details, see
221 @ref{Defining new contexts}.
226 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
227 {use-square-bracket-at-the-start-of-a-staff-group.ly}
229 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
230 {display-bracket-with-only-one-staff-in-a-system.ly}
232 @cindex mensurstriche layout
233 @cindex renaissance music
234 @cindex transcription of mensural music
235 @cindex mensural music, transcription of
237 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
238 {mensurstriche-layout-bar-lines-between-the-staves.ly}
239 @c FIXME: move to NR 2.8.x when sectioning is ready
250 @ref{Instrument names},
251 @ref{Defining new contexts}.
254 @rlsr{Staff notation}.
258 @rinternals{StaffGroup},
259 @rinternals{ChoirStaff},
260 @rinternals{GrandStaff},
261 @rinternals{PianoStaff},
262 @rinternals{SystemStartBar},
263 @rinternals{SystemStartBrace},
264 @rinternals{SystemStartBracket},
265 @rinternals{SystemStartSquare}.
268 @node Nested staff groups
269 @unnumberedsubsubsec Nested staff groups
271 @cindex staff, nested
272 @cindex staves, nested
273 @cindex nesting of staves
274 @cindex system start delimiters, nested
275 @cindex nested staff brackets
276 @cindex brackets, nesting of
277 @cindex braces, nesting of
278 @cindex inner staff group
279 @cindex inner choir staff group
281 Two additional staff-group contexts are available that can be
282 nested within a @code{StaffGroup} or @code{ChoirStaff} context:
283 @code{InnerStaffGroup} and @code{InnerChoirStaff}. These contexts
284 create a new bracket adjacent to the bracket of their parent staff
287 An @code{InnerStaffGroup} is treated similarly to a
288 @code{StaffGroup}; bar lines are connected between each staff
291 @lilypond[verbatim,quote,relative=2]
293 \new Staff { c2 c | c2 c }
294 \new InnerStaffGroup <<
295 \new Staff { g2 g | g2 g }
296 \new Staff { e2 e | e2 e }
301 Bar lines are @emph{not} connected between staves of an
302 @code{InnerChoirStaff}, just like a @code{ChoirStaff}:
304 @lilypond[verbatim,quote,relative=2]
306 \new Staff { c2 c | c2 c }
307 \new InnerChoirStaff <<
308 \new Staff { g2 g | g2 g }
309 \new Staff { e2 e | e2 e }
311 \new Staff { c1 | c1 }
315 New nested staff group contexts can be defined. For details, see
316 @ref{Defining new contexts}.
321 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
328 @ref{Grouping staves},
329 @ref{Instrument names},
330 @ref{Defining new contexts}.
333 @rlsr{Staff notation}.
336 @rinternals{InnerStaffGroup},
337 @rinternals{StaffGroup},
338 @rinternals{InnerChoirStaff},
339 @rinternals{ChoirStaff},
340 @rinternals{SystemStartBar},
341 @rinternals{SystemStartBrace},
342 @rinternals{SystemStartBracket},
343 @rinternals{SystemStartSquare}.
346 @node Modifying single staves
347 @subsection Modifying single staves
349 This section explains how to change specific attributes of one
350 staff: for example, modifying the number of staff lines or the
351 staff size. Methods to start and stop staves and set ossia
352 sections are also described.
362 @unnumberedsubsubsec Staff symbol
364 @cindex adjusting staff symbol
365 @cindex drawing staff symbol
366 @cindex staff symbol, setting of
367 @cindex stop staff lines
368 @cindex start staff lines
369 @cindex staff lines, amount of
370 @cindex staff lines, number of
371 @cindex staff line, thickness of
372 @cindex amount of staff lines
373 @cindex thickness of staff lines
374 @cindex ledger lines, setting
375 @cindex setting of ledger lines
376 @cindex spacing of ledger lines
377 @cindex number of staff lines
379 The lines of a staff belong to the @code{StaffSymbol} grob.
380 @code{StaffSymbol} properties can be modified to change the
381 appearance of a staff, but they must be modified before the staff
384 The number of staff lines may be changed. The clef position and
385 the position of middle C may need to be modified to fit the new
386 staff. For an explanation, refer to the snippet section in
389 @lilypond[verbatim,quote,relative=2]
391 \override StaffSymbol #'line-count = #3
396 The vertical position of staff lines and the number of staff lines
397 can be defined at the same time. As the following example shows,
398 note positions are not influenced by the staff line positions.
400 @warning{The @code{'line-positions} property overrides the
401 @code{'line-count} property. The number of staff lines is
402 implicitly defined by the number of elements in the list of values
403 for @code{'line-positions}.}
405 @lilypond[verbatim,quote,relative=1]
407 \override StaffSymbol #'line-positions = #'(7 3 0 -4 -6 -7)
412 Staff line thickness can be modified. The thickness of ledger
413 lines and stems are also affected, since they depend on staff line
416 @lilypond[verbatim,quote,relative=1]
418 \override StaffSymbol #'thickness = #3
423 Ledger line thickness can be set independently of staff line
426 @lilypond[verbatim,quote,relative=1]
428 \override StaffSymbol #'ledger-line-thickness = #'(1 . 0.2)
433 The distance between staff lines can be changed. This setting
434 affects the spacing of ledger lines as well.
436 @lilypond[verbatim,quote,relative=1]
438 \override StaffSymbol #'staff-space = #1.5
443 The width of a staff can be modified. The units are staff
444 spaces. The spacing of objects inside the staff is not affected by
447 @lilypond[verbatim,quote,relative=1]
449 \override StaffSymbol #'width = #23
454 Further details about the properties of @code{StaffSymbol} can be
455 found in @rinternals{staff-symbol-interface}.
457 @funindex \startStaff
460 Modifications to staff properties in the middle of a score can be
461 placed between @code{\stopStaff} and @code{\startStaff}:
463 @lilypond[verbatim,quote,relative=2]
466 \override Staff.StaffSymbol #'line-count = #2
470 \revert Staff.StaffSymbol #'line-count
475 @cindex stopping a staff
478 In general, @code{\startStaff} and @code{\stopStaff} can be used
479 to stop or start a staff in the middle of a score.
481 @lilypond[verbatim,quote,relative=2]
498 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
499 {making-some-staff-lines-thicker-than-the-others.ly}
513 @rlsr{Staff notation}.
516 @rinternals{StaffSymbol},
517 @rinternals{staff-symbol-interface}.
522 When setting vertical staff line positions manually, bar lines are
523 always centered on position 0, so the maximum distance between the
524 outermost bar lines in either direction must be equal.
528 @unnumberedsubsubsec Ossia staves
530 @cindex staff, Frenched
532 @cindex Frenched staves
533 @cindex staff, resizing of
534 @cindex resizing of staves
536 @notation{Ossia} staves can be set by creating a new simultaneous
537 staff in the appropriate location:
539 @lilypond[verbatim,quote]
540 \new Staff \relative c'' {
544 \new Staff { e4 d f e }
551 However, the above example is usually not the desired result. To
552 create ossia staves that are above the original staff, have no
553 time signature or clef, and have a smaller font size, tweaks must
554 be used. The Learning Manual describes a specific technique to
555 achieve this goal, beginning with
556 @rlearning{Nesting music expressions}.
558 The following example uses the @code{alignAboveContext} property
559 to align the ossia staff. This method is most appropriate when
560 only a few ossia staves are needed.
562 @lilypond[verbatim,quote]
563 \new Staff = main \relative c'' {
569 \remove "Time_signature_engraver"
570 alignAboveContext = #"main"
572 \override StaffSymbol #'staff-space = #(magstep -3)
573 \override StaffSymbol #'thickness = #(magstep -3)
582 If many isolated ossia staves are needed, creating an empty
583 @code{Staff} context with a specific @emph{context id} may be more
584 appropriate; the ossia staves may then be created by
585 @emph{calling} this context and using @code{\startStaff} and
586 @code{\stopStaff} at the desired locations. The benefits of this
587 method are more apparent if the piece is longer than the following
590 @lilypond[verbatim,quote,ragged-right]
592 \new Staff = ossia \with {
593 \remove "Time_signature_engraver"
594 \override Clef #'transparent = ##t
596 \override StaffSymbol #'staff-space = #(magstep -3)
597 \override StaffSymbol #'thickness = #(magstep -3)
601 \new Staff \relative c' {
605 \context Staff = ossia {
606 \startStaff e4 g8 f e2 \stopStaff
613 \context Staff = ossia {
614 \startStaff g4 e8 f g2 \stopStaff
622 Using the @code{\RemoveEmptyStaffContext} command to create ossia
623 staves may be used as an alternative. This method is most
624 convenient when ossia staves occur immediately following a line
625 break. In this case, spacer rests do not need to be used at all;
626 only @code{\startStaff} and @code{\stopStaff} are necessary. For
627 more information about @code{\RemoveEmptyStaffContext}, see
630 @lilypond[verbatim,quote,ragged-right]
632 \new Staff = ossia \with {
633 \remove "Time_signature_engraver"
634 \override Clef #'transparent = ##t
636 \override StaffSymbol #'staff-space = #(magstep -3)
637 \override StaffSymbol #'thickness = #(magstep -3)
639 \new Staff \relative c' {
645 \context Staff = ossia {
646 c4 e8 d c2 \stopStaff
656 \RemoveEmptyStaffContext
657 \override VerticalAxisGroup #'remove-first = ##t
665 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
666 {vertically-aligning-ossias-and-lyrics.ly}
674 @rglos{Frenched staff}.
677 @rlearning{Nesting music expressions},
678 @rlearning{Size of objects},
679 @rlearning{Length and thickness of objects}.
685 @rlsr{Staff notation}.
688 @rinternals{StaffSymbol}.
692 @unnumberedsubsubsec Hiding staves
694 @cindex Frenched score
695 @cindex Frenched staff
696 @cindex staff, hiding
698 @cindex hiding of staves
701 Staff lines can be hidden by removing the
702 @code{Staff_symbol_engraver} from the @code{Staff} context. As an
703 alternative, @code{\stopStaff} may be used.
705 @lilypond[verbatim,quote]
707 \remove "Staff_symbol_engraver"
709 \relative c''' { a8 f e16 d c b a2 }
712 @funindex \RemoveEmptyStaffContext
714 Empty staves can be hidden by setting the
715 @code{\RemoveEmptyStaffContext} command in the @code{\layout}
716 block. In orchestral scores, this style is known as @q{Frenched
717 Score}. By default, this command hides and removes all empty
718 staves in a score except for those in the first system.
720 @warning{An empty staff may only include multi-measure rests,
721 skips, spacer rests, or a combination of these elements.}
723 @lilypond[verbatim,quote,ragged-right]
726 \RemoveEmptyStaffContext
747 @code{\RemoveEmptyStaffContext} can also be used to create ossia
748 sections for a staff. For details, see @ref{Ossia staves}.
750 @cindex hiding ancient staves
751 @cindex hiding rhythmic staves
752 @funindex \AncientRemoveEmptyStaffContext
753 @funindex \RemoveEmptyRhythmicStaffContext
755 The @code{\AncientRemoveEmptyStaffContext} command may be used to
756 hide empty staves in ancient music contexts. Similarly,
757 @code{\RemoveEmptyRhythmicStaffContext} may be used to hide empty
758 @code{RhythmicStaff} contexts.
763 @code{\RemoveEmptyStaffContext},
764 @code{\AncientRemoveEmptyStaffContext},
765 @code{\RemoveEmptyRhythmicStaffContext}.
770 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
771 {removing-the-first-empty-line.ly}
777 @rglos{Frenched staff}.
784 @rlsr{Staff notation}.
787 @rinternals{ChordNames},
788 @rinternals{FiguredBass},
791 @rinternals{VerticalAxisGroup},
792 @rinternals{Staff_symbol_engraver}.
797 Removing @code{Staff_symbol_engraver} also hides bar lines. If
798 bar line visibility is forced, formatting errors may occur. In
799 this case, use the following overrides instead of removing the
803 \override StaffSymbol #'stencil = ##f
804 \override NoteHead #'no-ledgers = ##t
809 @subsection Writing parts
811 This section explains how to insert tempo indications and
812 instrument names into a score. Methods to quote other voices and
813 format cue notes are also described.
818 * Quoting other voices::
819 * Formatting cue notes::
823 @node Metronome marks
824 @unnumberedsubsubsec Metronome marks
827 @cindex beats per minute
828 @cindex metronome marking
829 @cindex metronome marking with text
832 A basic metronome mark is simple to write:
834 @lilypond[verbatim,quote,relative=1]
840 Tempo indications with text can be used instead:
842 @lilypond[verbatim,quote,relative=2]
848 Combining a metronome mark and text will automatically place the
849 metronome mark within parentheses:
851 @lilypond[verbatim,quote,relative=2]
852 \tempo "Allegro" 4 = 160
857 In general, the text can be any markup object:
859 @lilypond[verbatim,quote,relative=2]
860 \tempo \markup { \italic Faster } 4 = 132
861 a8-. r8 b-. r gis-. r a-. r
864 A parenthesized metronome mark with no textual indication may be
865 written by including an empty string in the input:
867 @lilypond[verbatim,quote,relative=2]
875 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
876 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
878 @c perhaps also an example of how to move it horizontally?
880 @c TODO add snippet when ready
881 @c @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
882 @c {changing-the-tempo-without-a-visible-metronome-mark.ly}
884 To change the tempo in the MIDI output without printing anything,
885 make the metronome marking invisible
888 \once \override Score.MetronomeMark #'transparent = ##t
891 @c TODO add snippet when ready
892 @c @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
893 @c {creating-metronome-marks-in-markup-mode.ly}
895 To print other metronome markings, use these markup commands
897 @lilypond[verbatim,quote,relative=1]
900 \smaller \general-align #Y #DOWN \note #"16." #1
902 \smaller \general-align #Y #DOWN \note #"8" #1
906 For more details, see @ref{Formatting text}.
913 @rglos{metronomic indication},
914 @rglos{tempo indication},
915 @rglos{metronome mark}.
918 @ref{Formatting text},
922 @rlsr{Staff notation}.
925 @rinternals{MetronomeMark}.
928 @node Instrument names
929 @unnumberedsubsubsec Instrument names
931 @cindex instrument names
932 @cindex instrument names, short
934 Instrument names can be printed on the left side of staves in the
935 @code{Staff} and @code{PianoStaff} contexts. The value of
936 @code{instrumentName} is used for the first staff, and the value
937 of @code{shortInstrumentName} is used for all succeeding staves.
939 @lilypond[verbatim,quote,ragged-right,relative=1]
940 \set Staff.instrumentName = "Violin "
941 \set Staff.shortInstrumentName = "Vln "
947 Markup mode can be used to create more complicated instrument
950 @lilypond[verbatim,quote,relative=2]
951 \set Staff.instrumentName = \markup {
952 \column { "Clarinetti"
953 \line { "in B" \smaller \flat } } }
957 @cindex instrument names, centering
959 When two or more staff contexts are grouped together, the
960 instrument names and short instrument names are centered by
961 default. To center multi-line instrument names,
962 @code{\center-column} must be used:
964 @lilypond[verbatim,quote,indent=1.5\cm,relative=2]
967 \set Staff.instrumentName = "Flute"
971 \set Staff.instrumentName = \markup \center-column {
973 \line { "in B" \smaller \flat }
983 However, if the instrument names are longer, the instrument names
984 in a staff group may not be centered unless the @code{indent} and
985 @code{short-indent} settings are increased. For details about
986 these settings, see @ref{Horizontal dimensions}.
988 @lilypond[verbatim,quote,ragged-right]
991 short-indent = 1.5\cm
996 \set Staff.instrumentName = "Alto Flute in G"
997 \set Staff.shortInstrumentName = "Fl."
1002 \set Staff.instrumentName = "Clarinet"
1003 \set Staff.shortInstrumentName = "Clar."
1010 To add instrument names to other contexts (such as
1011 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}),
1012 @code{Instrument_name_engraver} must be added to that context.
1013 For details, see @ref{Modifying context plug-ins}.
1015 @cindex instrument names, changing
1017 Instrument names may be changed in the middle of a piece:
1019 @lilypond[verbatim,quote,ragged-right,relative=1]
1020 \set Staff.instrumentName = "First"
1021 \set Staff.shortInstrumentName = "one"
1024 \set Staff.instrumentName = "Second"
1025 \set Staff.shortInstrumentName = "two"
1030 @cindex instrument switch
1031 @cindex switching instruments
1033 If an instrument @emph{switch} is needed,
1034 @code{\addInstrumentDefinition} may be used in combination with
1035 @code{\instrumentSwitch} to create a detailed list of the
1036 necessary changes for the switch. The
1037 @code{\addInstrumentDefinition} command has two arguments: an
1038 identifying string, and an association list of context properties
1039 and values to be used for the instrument. It must be placed in
1040 the toplevel scope. @code{\instrumentSwitch} is used in the music
1041 expression to declare the instrument switch:
1043 @lilypond[verbatim,quote,ragged-right]
1044 \addInstrumentDefinition #"contrabassoon"
1045 #`((instrumentTransposition . ,(ly:make-pitch -1 0 0))
1046 (shortInstrumentName . "Cbsn.")
1047 (clefGlyph . "clefs.F")
1048 (middleCPosition . 6)
1050 (instrumentCueName . ,(make-bold-markup "cbsn."))
1051 (midiInstrument . "bassoon"))
1054 instrumentName = "Bassoon"
1058 \compressFullBarRests
1061 \instrumentSwitch "contrabassoon"
1071 @ref{Horizontal dimensions},
1072 @ref{Modifying context plug-ins}.
1075 @rlsr{Staff notation}.
1077 Internals Reference:
1078 @rinternals{InstrumentName},
1079 @rinternals{PianoStaff},
1083 @node Quoting other voices
1084 @unnumberedsubsubsec Quoting other voices
1087 @cindex quoting other voices
1091 It is very common for one voice to double the some of the music from
1092 another voice. For example, the first and second violins may play the
1093 same notes during a passage of music. In LilyPond this is accomplished
1094 by letting one voice @emph{quote} the other voice without having to
1097 Before a part can be quoted, the @code{\addQuote} command must be used
1098 to initialize the quoted fragment. This command must be used in the
1099 toplevel scope. The first argument is an identifying string, and the
1100 second is a music expression:
1103 flute = \relative c'' @{
1106 \addQuote "flute" @{ \flute @}
1109 The @code{\quoteDuring} command is used to indicate the point where the
1110 quotation begins. It is followed by two arguments: the name of the
1111 quoted voice, as defined with @code{\addQuote}, and a music expression
1112 that indicates the duration of the quote, usually spacer rests or
1113 multi-measure rests. The corresponding music from the quoted voice is
1114 inserted into the music expression:
1116 @lilypond[verbatim,quote]
1117 flute = \relative c'' {
1120 \addQuote "flute" { \flute }
1123 c4 cis \quoteDuring #"flute" { s2 }
1127 If the music expression used for @code{\quoteDuring} contains
1128 anything but a spacer rest or multi-measure rest, a polyphonic
1129 situation is created, which is often not desirable:
1131 @lilypond[verbatim,quote]
1132 flute = \relative c'' {
1135 \addQuote "flute" { \flute }
1138 c4 cis \quoteDuring #"flute" { c4 b }
1142 Quotations recognize instrument transposition settings for both
1143 the source and target instruments if the @code{\transposition}
1144 command is used. For details about @code{\transposition}, see
1145 @ref{Instrument transpositions}.
1147 @lilypond[verbatim,quote]
1148 clarinet = \relative c'' {
1152 \addQuote "clarinet" { \clarinet }
1155 c4 cis \quoteDuring #"clarinet" { s2 }
1159 It is possible to tag quotations with unique names in order to
1160 process them in different ways. For details about this procedure,
1161 see @ref{Using tags}.
1166 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1167 {quoting-another-voice-with-transposition.ly}
1170 @cindex articulation-event
1171 @cindex dynamic-event
1173 @funindex quotedEventTypes
1175 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1176 {quoting-another-voice.ly}
1182 @ref{Instrument transpositions},
1186 @rlsr{Staff notation}.
1188 Internals Reference:
1189 @rinternals{QuoteMusic},
1195 Only the contents of the first @code{Voice} occurring in an
1196 @code{\addQuote} command will be considered for quotation, so
1197 @var{music} cannot contain @code{\new} and @code{\context Voice}
1198 statements that would switch to a different Voice.
1200 Quoting grace notes is broken and can even cause LilyPond to
1203 Quoting nested triplets may result in poor notation.
1205 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
1206 written entirely in lower-case letters: @code{\addquote}.
1209 @node Formatting cue notes
1210 @unnumberedsubsubsec Formatting cue notes
1214 @cindex cue notes, formatting
1216 @cindex quoting other voices
1217 @cindex cues, formatting
1219 The previous section explains how to create quotations. The
1220 @code{\cueDuring} command is a more specialized form of
1221 @code{\quoteDuring}, being particularly useful for inserting cue
1222 notes into a part. The syntax is as follows:
1225 \cueDuring #@var{partname} #@var{voice} @var{music}
1228 This command copies the corresponding measures from @var{partname}
1229 into a @code{CueVoice} context. The @code{CueVoice} is created
1230 implicitly, and occurs simultaneously with @var{music}, which
1231 creates a polyphonic situation. The @var{voice} argument
1232 determines whether the cue notes should be notated as a first or
1233 second voice; @code{UP} corresponds to the first voice, and
1234 @code{DOWN} corresponds to the second.
1236 @lilypond[verbatim,quote]
1237 oboe = \relative c'' {
1241 \addQuote "oboe" { \oboe }
1243 \new Voice \relative c'' {
1244 \cueDuring #"oboe" #UP { R1 }
1250 In the above example, the @code{Voice} context had to be
1251 explicitly declared, or else the entire music expression would
1252 belong to the @code{CueVoice} context.
1254 The name of the cued instrument can be printed by setting the
1255 @code{instrumentCueName} property in the @code{CueVoice} context.
1257 @lilypond[verbatim,quote]
1258 oboe = \relative c''' {
1261 \addQuote oboe { \oboe }
1263 \new Staff \relative c'' <<
1264 \new CueVoice \with {
1265 instrumentCueName = "ob."
1268 \cueDuring #"oboe" #UP { R1 }
1274 In addition to printing the name of the cued instrument, when cue
1275 notes end, the name of the original instrument should be printed,
1276 and any other changes introduced by the cued part should be
1277 undone. This can be accomplished by using
1278 @code{\addInstrumentDefinition} and @code{\instrumentSwitch}. For
1279 an example and explanation, see @ref{Instrument names}.
1281 The @code{\killCues} command removes cue notes from a music
1282 expression. This can be useful if cue notes need to be removed
1283 from a part but may be restored at a later time.
1285 @lilypond[verbatim,quote]
1286 flute = \relative c''' {
1289 \addQuote flute { \flute }
1291 \new Voice \relative c'' {
1293 \cueDuring #"flute" #UP { R1 }
1299 The @code{\transposedCueDuring} command is useful for adding
1300 instrumental cues from a completely different register. The
1301 syntax is similar to @code{\cueDuring}, but it requires one extra
1302 argument to specify the transposition of the cued instrument. For
1303 more information about transposition, see
1304 @ref{Instrument transpositions}.
1306 @lilypond[verbatim,quote]
1307 piccolo = \relative c''' {
1313 \addQuote "piccolo" { \piccolo }
1315 cbassoon = \relative c, {
1318 \transposedCueDuring #"piccolo" #UP c,, { R1 }
1323 \new Staff = "piccolo" \piccolo
1324 \new Staff = "cbassoon" \cbassoon
1328 It is possible to tag cued parts with unique names in order to
1329 process them in different ways. For details about this procedure,
1330 see @ref{Using tags}.
1336 @ref{Instrument transpositions},
1337 @ref{Instrument names},
1341 @rlsr{Staff notation}.
1343 Internals Reference:
1344 @rinternals{CueVoice},
1350 Collisions can occur with rests, when using @code{\cueDuring},
1351 between @code{Voice} and @code{CueVoice} contexts.