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 @funindex RhythmicStaff
62 @funindex MensuralStaff
63 @funindex VaticanaStaff
64 @funindex GregorianTranscriptionStaff
66 @notation{Staves} (singular: @notation{staff}) are created with
67 the @code{\new} or @code{\context} commands. For details, see
68 @ref{Creating contexts}.
70 The basic staff context is @code{Staff}:
72 @lilypond[verbatim,quote,relative=2]
73 \new Staff { c4 d e f }
76 The @code{DrumStaff} context creates a five-line staff set up for
77 a typical drum set. Each instrument is shown with a different
78 symbol. The instruments are entered in drum mode following a
79 @code{\drummode} command, with each instrument specified by name.
80 For details, see @ref{Percussion staves}.
82 @lilypond[verbatim,quote]
84 \drummode { cymc hh ss tomh }
88 @code{RhythmicStaff} creates a single-line staff that only
89 displays the rhythmic values of the input. Real durations are
90 preserved. For details, see @ref{Showing melody rhythms}.
92 @lilypond[verbatim,quote,relative=2]
93 \new RhythmicStaff { c4 d e f }
96 @code{TabStaff} creates a tablature with six strings in standard
97 guitar tuning. For details, see @ref{Default tablatures}.
99 @lilypond[verbatim,quote,relative=2]
100 \new TabStaff { c4 d e f }
103 There are two staff contexts specific for the notation of ancient
104 music: @code{MensuralStaff} and @code{VaticanaStaff}. They are
105 described in @ref{Pre-defined contexts}.
107 The @code{GregorianTranscriptionStaff} context creates a staff to
108 notate modern Gregorian chant. It does not show bar lines.
110 @lilypond[verbatim,quote,relative=2]
111 \new GregorianTranscriptionStaff { c4 d e f e d }
114 New single staff contexts may be defined. For details, see
115 @ref{Defining new contexts}.
124 @ref{Creating contexts},
125 @ref{Percussion staves},
126 @ref{Showing melody rhythms},
127 @ref{Default tablatures},
128 @ref{Pre-defined contexts},
130 @ref{Gregorian chant contexts},
131 @ref{Mensural contexts},
132 @ref{Defining new contexts}.
135 @rlsr{Staff notation}.
139 @rinternals{DrumStaff},
140 @rinternals{GregorianTranscriptionStaff},
141 @rinternals{RhythmicStaff},
142 @rinternals{TabStaff},
143 @rinternals{MensuralStaff},
144 @rinternals{VaticanaStaff},
145 @rinternals{StaffSymbol}.
148 @node Grouping staves
149 @unnumberedsubsubsec Grouping staves
151 @cindex start of system
152 @cindex staff, multiple
153 @cindex staves, multiple
154 @cindex system start delimiters
155 @cindex bracket, vertical
156 @cindex brace, vertical
166 Various contexts exist to group single staves together in order to
167 form multi-stave systems. Each grouping context sets the style of
168 the system start delimiter and the behavior of bar lines.
170 If no context is specified, the default properties will be used:
171 the group is started with a vertical line, and the bar lines are
174 @lilypond[verbatim,quote,relative=2]
181 In the @code{StaffGroup} context, the group is started with a
182 bracket and bar lines are drawn through all the staves.
184 @lilypond[verbatim,quote,relative=2]
191 In a @code{ChoirStaff}, the group starts with a bracket, but bar
192 lines are not connected.
194 @lilypond[verbatim,quote,relative=2]
201 In a @code{GrandStaff}, the group begins with a brace, and bar
202 lines are connected between the staves.
204 @lilypond[verbatim,quote,relative=2]
211 The @code{PianoStaff} is identical to a @code{GrandStaff}, except
212 that it supports printing the instrument name directly. For
213 details, see @ref{Instrument names}.
215 @lilypond[verbatim,quote,relative=2]
217 \set PianoStaff.instrumentName = #"Piano"
223 Each staff group context sets the property
224 @code{systemStartDelimiter} to one of the following values:
225 @code{SystemStartBar}, @code{SystemStartBrace}, or
226 @code{SystemStartBracket}. A fourth delimiter,
227 @code{SystemStartSquare}, is also available, but it must be
228 explicitly specified.
230 New staff group contexts may be defined. For details, see
231 @ref{Defining new contexts}.
236 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
237 {use-square-bracket-at-the-start-of-a-staff-group.ly}
239 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
240 {display-bracket-with-only-one-staff-in-a-system.ly}
242 @cindex mensurstriche layout
243 @cindex renaissance music
244 @cindex transcription of mensural music
245 @cindex mensural music, transcription of
247 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
248 {mensurstriche-layout-bar-lines-between-the-staves.ly}
258 @ref{Instrument names},
259 @ref{Defining new contexts}.
262 @rlsr{Staff notation}.
266 @rinternals{StaffGroup},
267 @rinternals{ChoirStaff},
268 @rinternals{GrandStaff},
269 @rinternals{PianoStaff},
270 @rinternals{SystemStartBar},
271 @rinternals{SystemStartBrace},
272 @rinternals{SystemStartBracket},
273 @rinternals{SystemStartSquare}.
276 @node Nested staff groups
277 @unnumberedsubsubsec Nested staff groups
279 @cindex staff, nested
280 @cindex staves, nested
281 @cindex nesting of staves
282 @cindex system start delimiters, nested
283 @cindex nested staff brackets
284 @cindex brackets, nesting of
285 @cindex braces, nesting of
287 Staff-group contexts can be nested to arbitrary depths. In this
288 case, each child context creates a new bracket adjacent to the
289 bracket of its parent group.
291 @lilypond[verbatim,quote,relative=2]
293 \new Staff { c2 c | c2 c }
295 \new Staff { g2 g | g2 g }
296 \new StaffGroup \with {
297 systemStartDelimiter = #'SystemStartSquare
300 \new Staff { e2 e | e2 e }
301 \new Staff { c2 c | c2 c }
307 New nested staff group contexts can be defined. For details, see
308 @ref{Defining new contexts}.
313 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
319 @ref{Grouping staves},
320 @ref{Instrument names},
321 @ref{Defining new contexts}.
324 @rlsr{Staff notation}.
327 @rinternals{StaffGroup},
328 @rinternals{ChoirStaff},
329 @rinternals{SystemStartBar},
330 @rinternals{SystemStartBrace},
331 @rinternals{SystemStartBracket},
332 @rinternals{SystemStartSquare}.
335 @node Modifying single staves
336 @subsection Modifying single staves
338 This section explains how to change specific attributes of one
339 staff: for example, modifying the number of staff lines or the
340 staff size. Methods to start and stop staves and set ossia
341 sections are also described.
351 @unnumberedsubsubsec Staff symbol
353 @cindex adjusting staff symbol
354 @cindex drawing staff symbol
355 @cindex staff symbol, setting of
356 @cindex staff symbol, drawing
357 @cindex stop staff lines
358 @cindex start staff lines
359 @cindex staff lines, amount of
360 @cindex staff lines, number of
361 @cindex staff line, thickness of
362 @cindex amount of staff lines
363 @cindex thickness of staff lines
364 @cindex ledger lines, setting
365 @cindex setting of ledger lines
366 @cindex spacing of ledger lines
367 @cindex number of staff lines
369 The lines of a staff belong to the @code{StaffSymbol} grob.
370 @code{StaffSymbol} properties can be modified to change the
371 appearance of a staff, but they must be modified before the staff
374 The number of staff lines may be changed. The clef position and
375 the position of middle C may need to be modified to fit the new
376 staff. For an explanation, refer to the snippet section in
379 @lilypond[verbatim,quote,relative=2]
381 \override StaffSymbol #'line-count = #3
386 Staff line thickness can be modified. The thickness of ledger
387 lines and stems are also affected, since they depend on staff line
390 @lilypond[verbatim,quote,relative=1]
392 \override StaffSymbol #'thickness = #3
397 Ledger line thickness can be set independently of staff line
398 thickness. In the example the two numbers are factors multiplying
399 the staff line thickness and the staff line spacing. The two
400 contributions are added to give the ledger line thickness.
402 @lilypond[verbatim,quote,relative=1]
404 \override StaffSymbol #'ledger-line-thickness = #'(1 . 0.2)
409 The distance between staff lines can be changed. This setting
410 affects the spacing of ledger lines as well.
412 @lilypond[verbatim,quote,relative=1]
414 \override StaffSymbol #'staff-space = #1.5
419 Further details about the properties of @code{StaffSymbol} can be
420 found in @rinternals{staff-symbol-interface}.
422 @cindex stopping a staff
423 @cindex starting a staff
424 @cindex staff, starting
425 @cindex staff, stopping
427 @funindex \startStaff
432 Modifications to staff properties in the middle of a score can be
433 placed between @code{\stopStaff} and @code{\startStaff}:
435 @lilypond[verbatim,quote,relative=2]
438 \override Staff.StaffSymbol #'line-count = #2
442 \revert Staff.StaffSymbol #'line-count
448 In general, @code{\startStaff} and @code{\stopStaff} can be used
449 to stop or start a staff in the middle of a score.
451 @lilypond[verbatim,quote,relative=2]
468 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
469 {making-some-staff-lines-thicker-than-the-others.ly}
482 @rlsr{Staff notation}.
485 @rinternals{StaffSymbol},
486 @rinternals{staff-symbol-interface}.
490 @unnumberedsubsubsec Ossia staves
492 @cindex staff, Frenched
494 @cindex Frenched staves
495 @cindex staff, resizing of
496 @cindex resizing of staves
498 @funindex \startStaff
503 @notation{Ossia} staves can be set by creating a new simultaneous
504 staff in the appropriate location:
506 @lilypond[verbatim,quote]
507 \new Staff \relative c'' {
511 \new Staff { e4 d f e }
518 However, the above example is not what is usually desired. To
519 create ossia staves that are above the original staff, have no
520 time signature or clef, and have a smaller font size, tweaks must
521 be used. The Learning Manual describes a specific technique to
522 achieve this goal, beginning with
523 @rlearning{Nesting music expressions}.
525 The following example uses the @code{alignAboveContext} property
526 to align the ossia staff. This method is most appropriate when
527 only a few ossia staves are needed.
529 @lilypond[verbatim,quote]
530 \new Staff = main \relative c'' {
536 \remove "Time_signature_engraver"
537 alignAboveContext = #"main"
539 \override StaffSymbol #'staff-space = #(magstep -3)
540 \override StaffSymbol #'thickness = #(magstep -3)
549 If many isolated ossia staves are needed, creating an empty
550 @code{Staff} context with a specific @emph{context id} may be more
551 appropriate; the ossia staves may then be created by
552 @emph{calling} this context and using @code{\startStaff} and
553 @code{\stopStaff} at the desired locations. The benefits of this
554 method are more apparent if the piece is longer than the following
557 @lilypond[verbatim,quote,ragged-right]
559 \new Staff = ossia \with {
560 \remove "Time_signature_engraver"
561 \override Clef #'transparent = ##t
563 \override StaffSymbol #'staff-space = #(magstep -3)
564 \override StaffSymbol #'thickness = #(magstep -3)
568 \new Staff \relative c' {
572 \context Staff = ossia {
573 \startStaff e4 g8 f e2 \stopStaff
580 \context Staff = ossia {
581 \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. For more information about
594 @code{\RemoveEmptyStaffContext}, see @ref{Hiding staves}.
596 @lilypond[verbatim,quote,ragged-right]
598 \new Staff = ossia \with {
599 \remove "Time_signature_engraver"
600 \override Clef #'transparent = ##t
602 \override StaffSymbol #'staff-space = #(magstep -3)
603 \override StaffSymbol #'thickness = #(magstep -3)
608 \new Staff \relative c' {
620 \RemoveEmptyStaffContext
621 \override VerticalAxisGroup #'remove-first = ##t
629 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
630 {vertically-aligning-ossias-and-lyrics.ly}
637 @rglos{Frenched staff}.
640 @rlearning{Nesting music expressions},
641 @rlearning{Size of objects},
642 @rlearning{Length and thickness of objects}.
648 @rlsr{Staff notation}.
651 @rinternals{StaffSymbol}.
655 @unnumberedsubsubsec Hiding staves
657 @cindex Frenched score
658 @cindex Frenched staff
659 @cindex staff, hiding
661 @cindex hiding of staves
664 @funindex \RemoveEmptyStaffContext
665 @funindex RemoveEmptyStaffContext
666 @funindex Staff_symbol_engraver
671 Staff lines can be hidden by removing the
672 @code{Staff_symbol_engraver} from the @code{Staff} context. As an
673 alternative, @code{\stopStaff} may be used.
675 @lilypond[verbatim,quote]
677 \remove "Staff_symbol_engraver"
679 \relative c''' { a8 f e16 d c b a2 }
683 Empty staves can be hidden by setting the
684 @code{\RemoveEmptyStaffContext} command in the @code{\layout}
685 block. In orchestral scores, this style is known as @q{Frenched
686 Score}. By default, this command hides and removes all empty
687 staves in a score except for those in the first system.
689 @warning{A staff is considered empty when it contains only
690 multi-measure rests, skips, spacer rests, or a combination of these
693 @lilypond[verbatim,quote,ragged-right]
696 \RemoveEmptyStaffContext
717 @code{\RemoveEmptyStaffContext} can also be used to create ossia
718 sections for a staff. For details, see @ref{Ossia staves}.
720 @cindex hiding ancient staves
721 @cindex hiding rhythmic staves
723 @funindex \RemoveEmptyStaffContext
724 @funindex RemoveEmptyStaffContext
725 @funindex \AncientRemoveEmptyStaffContext
726 @funindex AncientRemoveEmptyStaffContext
727 @funindex \RemoveEmptyRhythmicStaffContext
728 @funindex RemoveEmptyRhythmicStaffContext
730 The @code{\AncientRemoveEmptyStaffContext} command may be used to
731 hide empty staves in ancient music contexts. Similarly,
732 @code{\RemoveEmptyRhythmicStaffContext} may be used to hide empty
733 @code{RhythmicStaff} contexts.
737 @code{\RemoveEmptyStaffContext},
738 @code{\AncientRemoveEmptyStaffContext},
739 @code{\RemoveEmptyRhythmicStaffContext}.
745 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
746 {removing-the-first-empty-line.ly}
751 @rglos{Frenched staff}.
754 @rlearning{Visibility and color of objects}.
760 @ref{Invisible rests},
761 @ref{Visibility of objects}.
764 @rlsr{Staff notation}.
767 @rinternals{ChordNames},
768 @rinternals{FiguredBass},
771 @rinternals{VerticalAxisGroup},
772 @rinternals{Staff_symbol_engraver}.
777 Removing @code{Staff_symbol_engraver} also hides bar lines. If
778 bar line visibility is forced, formatting errors may occur. In
779 this case, use the following overrides instead of removing the
783 \override StaffSymbol #'stencil = ##f
784 \override NoteHead #'no-ledgers = ##t
789 @subsection Writing parts
791 This section explains how to insert tempo indications and
792 instrument names into a score. Methods to quote other voices and
793 format cue notes are also described.
798 * Quoting other voices::
799 * Formatting cue notes::
803 @node Metronome marks
804 @unnumberedsubsubsec Metronome marks
807 @cindex beats per minute
808 @cindex metronome mark
809 @cindex metronome marking with text
814 A basic metronome mark is simple to write:
816 @lilypond[verbatim,quote,relative=1]
822 Tempo indications with text can be used instead:
824 @lilypond[verbatim,quote,relative=2]
830 Combining a metronome mark and text will automatically place the
831 metronome mark within parentheses:
833 @lilypond[verbatim,quote,relative=2]
834 \tempo "Allegro" 4 = 160
839 In general, the text can be any markup object:
841 @lilypond[verbatim,quote,relative=2]
842 \tempo \markup { \italic Faster } 4 = 132
843 a8-. r8 b-. r gis-. r a-. r
846 A parenthesized metronome mark with no textual indication may be
847 written by including an empty string in the input:
849 @lilypond[verbatim,quote,relative=2]
857 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
858 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
860 @c perhaps also an example of how to move it horizontally?
862 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
863 {changing-the-tempo-without-a-metronome-mark.ly}
865 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
866 {creating-metronome-marks-in-markup-mode.ly}
868 For more details, see @ref{Formatting text}.
874 @rglos{metronomic indication},
875 @rglos{tempo indication},
876 @rglos{metronome mark}.
879 @ref{Formatting text},
883 @rlsr{Staff notation}.
886 @rinternals{MetronomeMark}.
889 @node Instrument names
890 @unnumberedsubsubsec Instrument names
892 @cindex instrument names
893 @cindex instrument names, short
895 Instrument names can be printed on the left side of staves in the
896 @code{Staff} and @code{PianoStaff} contexts. The value of
897 @code{instrumentName} is used for the first staff, and the value
898 of @code{shortInstrumentName} is used for all succeeding staves.
900 @lilypond[verbatim,quote,ragged-right,relative=1]
901 \set Staff.instrumentName = #"Violin "
902 \set Staff.shortInstrumentName = #"Vln "
908 Markup mode can be used to create more complicated instrument
911 @lilypond[verbatim,quote,relative=2]
912 \set Staff.instrumentName = \markup {
913 \column { "Clarinetti"
914 \line { "in B" \smaller \flat } } }
918 @cindex instrument names, centering
920 When two or more staff contexts are grouped together, the
921 instrument names and short instrument names are centered by
922 default. To center multi-line instrument names,
923 @code{\center-column} must be used:
925 @lilypond[verbatim,quote,indent=1.5\cm,relative=2]
928 \set Staff.instrumentName = #"Flute"
932 \set Staff.instrumentName = \markup \center-column {
934 \line { "in B" \smaller \flat }
942 @funindex short-indent
944 However, if the instrument names are longer, the instrument names
945 in a staff group may not be centered unless the @code{indent} and
946 @code{short-indent} settings are increased. For details about
947 these settings, see @ref{Horizontal dimensions}.
949 @lilypond[verbatim,quote,ragged-right]
952 short-indent = 1.5\cm
957 \set Staff.instrumentName = #"Alto Flute in G"
958 \set Staff.shortInstrumentName = #"Fl."
963 \set Staff.instrumentName = #"Clarinet"
964 \set Staff.shortInstrumentName = #"Clar."
971 @cindex instrument names, adding to other contexts
973 To add instrument names to other contexts (such as
974 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}),
975 @code{Instrument_name_engraver} must be added to that context.
976 For details, see @ref{Modifying context plug-ins}.
978 @cindex instrument names, changing
979 @cindex changing instrument names
981 Instrument names may be changed in the middle of a piece:
983 @lilypond[verbatim,quote,ragged-right,relative=1]
984 \set Staff.instrumentName = #"First"
985 \set Staff.shortInstrumentName = #"one"
988 \set Staff.instrumentName = #"Second"
989 \set Staff.shortInstrumentName = #"two"
994 @cindex instrument switch
995 @cindex switching instruments
997 @funindex \addInstrumentDefinition
998 @funindex addInstrumentDefinition
999 @funindex \instrumentSwitch
1000 @funindex instrumentSwitch
1002 If an instrument @emph{switch} is needed,
1003 @code{\addInstrumentDefinition} may be used in combination with
1004 @code{\instrumentSwitch} to create a detailed list of the
1005 necessary changes for the switch. The
1006 @code{\addInstrumentDefinition} command has two arguments: an
1007 identifying string, and an association list of context properties
1008 and values to be used for the instrument. It must be placed in
1009 the toplevel scope. @code{\instrumentSwitch} is used in the music
1010 expression to declare the instrument switch:
1012 @lilypond[verbatim,quote,ragged-right]
1013 \addInstrumentDefinition #"contrabassoon"
1014 #`((instrumentTransposition . ,(ly:make-pitch -1 0 0))
1015 (shortInstrumentName . "Cbsn.")
1016 (clefGlyph . "clefs.F")
1017 (middleCPosition . 6)
1019 (instrumentCueName . ,(make-bold-markup "cbsn."))
1020 (midiInstrument . "bassoon"))
1023 instrumentName = #"Bassoon"
1027 \compressFullBarRests
1030 \instrumentSwitch "contrabassoon"
1039 @ref{Horizontal dimensions},
1040 @ref{Modifying context plug-ins}.
1043 @rlsr{Staff notation}.
1045 Internals Reference:
1046 @rinternals{InstrumentName},
1047 @rinternals{PianoStaff},
1051 @node Quoting other voices
1052 @unnumberedsubsubsec Quoting other voices
1055 @cindex quoting other voices
1061 @funindex \quoteDuring
1062 @funindex quoteDuring
1063 @funindex \transposition
1064 @funindex transposition
1066 It is very common for one voice to double some of the music from
1067 another voice. For example, the first and second violins may play the
1068 same notes during a passage of music. In LilyPond this is accomplished
1069 by letting one voice @emph{quote} the other voice without having to
1072 Before a part can be quoted, the @code{\addQuote} command must be used
1073 to initialize the quoted fragment. This command must be used in the
1074 toplevel scope. The first argument is an identifying string, and the
1075 second is a music expression:
1078 flute = \relative c'' @{
1081 \addQuote "flute" @{ \flute @}
1084 The @code{\quoteDuring} command is used to indicate the point where the
1085 quotation begins. It is followed by two arguments: the name of the
1086 quoted voice, as defined with @code{\addQuote}, and a music expression
1087 that indicates the duration of the quote, usually spacer rests or
1088 multi-measure rests. The corresponding music (including all articulations,
1089 dynamics, markup, etc.) from the quoted voice is inserted into the music
1092 @lilypond[verbatim,quote]
1093 flute = \relative c'' {
1094 a4 gis g->\f gis^\markup{quoted}
1096 \addQuote "flute" { \flute }
1099 c4 cis \quoteDuring #"flute" { s2 }
1103 If the music expression used for @code{\quoteDuring} contains
1104 anything but a spacer rest or multi-measure rest, a polyphonic
1105 situation is created, which is often not desirable:
1107 @lilypond[verbatim,quote]
1108 flute = \relative c'' {
1111 \addQuote "flute" { \flute }
1114 c4 cis \quoteDuring #"flute" { c4 b }
1118 Quotations recognize instrument transposition settings for both
1119 the source and target instruments if the @code{\transposition}
1120 command is used. For details about @code{\transposition}, see
1121 @ref{Instrument transpositions}.
1123 @lilypond[verbatim,quote]
1124 clarinet = \relative c'' {
1128 \addQuote "clarinet" { \clarinet }
1131 c4 cis \quoteDuring #"clarinet" { s2 }
1135 It is possible to tag quotations with unique names in order to
1136 process them in different ways. For details about this procedure,
1137 see @ref{Using tags}.
1139 It is also possible to adjust which objects from the original voice are quoted
1140 by changing the @code{quotedEventTypes} property. By default, its value is
1141 @code{#'(StreamEvent)}, which means that everything is quoted. Setting it
1142 to e.g. @code{#'(note-event rest-event tie-event)} causes lilypond to quote
1143 only notes, rests and ties, but no articulations, markup or dynamics.
1145 @lilypond[verbatim,quote]
1146 clarinet = \relative c'' {
1147 a4 gis g->\f gis^\markup{quoted}
1149 \addQuote "clarinet" { \clarinet }
1152 \set Score.quotedEventTypes = #'(note-event rest-event tie-event)
1153 c4 cis \quoteDuring #"clarinet" { s2 }
1159 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1160 {quoting-another-voice-with-transposition.ly}
1163 @cindex articulation-event
1164 @cindex dynamic-event
1167 @funindex quotedEventTypes
1168 @funindex quotedCueEventTypes
1170 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1171 {quoting-another-voice.ly}
1176 @ref{Instrument transpositions},
1180 @rlsr{Staff notation}.
1182 Internals Reference:
1183 @rinternals{QuoteMusic},
1189 Only the contents of the first @code{Voice} occurring in an
1190 @code{\addQuote} command will be considered for quotation, so
1191 @var{music} cannot contain @code{\new} and @code{\context Voice}
1192 statements that would switch to a different Voice.
1194 Quoting grace notes is broken and can even cause LilyPond to
1197 Quoting nested triplets may result in poor notation.
1199 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
1200 written entirely in lower-case letters: @code{\addquote}.
1203 @node Formatting cue notes
1204 @unnumberedsubsubsec Formatting cue notes
1208 @cindex cue notes, formatting
1210 @cindex quoting other voices
1211 @cindex cues, formatting
1213 @funindex \cueDuring
1215 @funindex \quoteDuring
1216 @funindex quoteDuring
1218 The previous section explains how to create quotations. The
1219 @code{\cueDuring} command is a more specialized form of
1220 @code{\quoteDuring}, being particularly useful for inserting cue
1221 notes into a part. The syntax is as follows:
1224 \cueDuring #@var{partname} #@var{voice} @var{music}
1227 This command copies only the notes and rests from the corresponding measures
1228 from @var{partname} into a @code{CueVoice} context. The @code{CueVoice} is
1229 created implicitly, and occurs simultaneously with @var{music}, which
1230 creates a polyphonic situation. The @var{voice} argument
1231 determines whether the cue notes should be notated as a first or
1232 second voice; @code{UP} corresponds to the first voice, and
1233 @code{DOWN} corresponds to the second.
1235 @lilypond[verbatim,quote]
1236 oboe = \relative c'' {
1237 r2 r8 d16(\f f e g f a)
1240 \addQuote "oboe" { \oboe }
1242 \new Voice \relative c'' {
1243 \cueDuring #"oboe" #UP { R1 }
1249 In the above example, the @code{Voice} context had to be
1250 explicitly declared, or else the entire music expression would
1251 belong to the @code{CueVoice} context.
1253 It is possible to adjust which aspects of the music are quoted with
1254 @code{\cueDuring} by setting the @code{quotedCueEventTypes} property. Its
1255 default value is @code{#'(note-event rest-event tie-event beam-event
1256 tuplet-span-event)}, which means that only notes, rest, ties, beams and
1257 tuplets are quoted, but not articulations, dynamic marks, markup etc.
1259 @lilypond[verbatim,quote]
1260 oboe = \relative c'' {
1261 r2 r8 d16(\f f e g f a)
1264 \addQuote "oboe" { \oboe }
1266 \new Voice \relative c'' {
1267 \set Score.quotedCueEventTypes = #'(note-event rest-event tie-event
1268 beam-event tuplet-span-event
1269 dynamic-event slur-event)
1270 \cueDuring #"oboe" #UP { R1 }
1277 The name of the cued instrument can be printed by setting the
1278 @code{instrumentCueName} property in the @code{CueVoice} context.
1280 @lilypond[verbatim,quote]
1281 oboe = \relative c''' {
1284 \addQuote "oboe" { \oboe }
1286 \new Staff \relative c'' <<
1287 \new CueVoice \with {
1288 instrumentCueName = "ob."
1291 \cueDuring #"oboe" #UP { R1 }
1297 @cindex removing cues
1298 @cindex removing cue notes
1299 @cindex cue notes, removing
1303 @funindex \transposedCueDuring
1304 @funindex transposedCueDuring
1306 In addition to printing the name of the cued instrument, when cue
1307 notes end, the name of the original instrument should be printed,
1308 and any other changes introduced by the cued part should be
1309 undone. This can be accomplished by using
1310 @code{\addInstrumentDefinition} and @code{\instrumentSwitch}. For
1311 an example and explanation, see @ref{Instrument names}.
1313 The @code{\killCues} command removes cue notes from a music
1314 expression. This can be useful if cue notes need to be removed
1315 from a part but may be restored at a later time.
1317 @lilypond[verbatim,quote]
1318 flute = \relative c''' {
1321 \addQuote "flute" { \flute }
1323 \new Voice \relative c'' {
1325 \cueDuring #"flute" #UP { R1 }
1331 The @code{\transposedCueDuring} command is useful for adding
1332 instrumental cues from a completely different register. The
1333 syntax is similar to @code{\cueDuring}, but it requires one extra
1334 argument to specify the transposition of the cued instrument. For
1335 more information about transposition, see
1336 @ref{Instrument transpositions}.
1338 @lilypond[verbatim,quote]
1339 piccolo = \relative c''' {
1345 \addQuote "piccolo" { \piccolo }
1347 cbassoon = \relative c, {
1350 \transposedCueDuring #"piccolo" #UP c,, { R1 }
1355 \new Staff = "piccolo" \piccolo
1356 \new Staff = "cbassoon" \cbassoon
1360 It is possible to tag cued parts with unique names in order to
1361 process them in different ways. For details about this procedure,
1362 see @ref{Using tags}.
1364 @cindex notes, smaller
1365 @cindex smaller notes
1367 A @code{CueVoice} context may be created explicitly if notes of a
1368 smaller size are required, for example to set an alternative
1369 sequence of notes more suitable for a higher or lower voice.
1371 @lilypond[verbatim,relative=2]
1388 @ref{Instrument transpositions},
1389 @ref{Instrument names},
1393 @rlsr{Staff notation}.
1395 Internals Reference:
1396 @rinternals{CueVoice},
1402 Collisions can occur with rests, when using @code{\cueDuring},
1403 between @code{Voice} and @code{CueVoice} contexts.