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. For details, see the Contributors'
7 Guide, node Updating translation committishes..
13 @section Staff notation
15 @lilypondfile[quote]{staff-headword.ly}
17 This section explains how to influence the appearance of staves,
18 how to print scores with more than one staff, and how to add tempo
19 indications and cue notes to staves.
23 * Modifying single staves::
28 @node Displaying staves
29 @subsection Displaying staves
31 This section describes the different methods of creating and
35 * Instantiating new staves::
37 * Nested staff groups::
38 * Separating systems::
42 @node Instantiating new staves
43 @unnumberedsubsubsec Instantiating new staves
46 @cindex staff initiation
47 @cindex staff instantiation
51 @cindex staff, percussion
53 @cindex percussion staff
54 @cindex Gregorian transcription staff
55 @cindex rhythmic staff
62 @funindex RhythmicStaff
64 @funindex MensuralStaff
65 @funindex VaticanaStaff
66 @funindex GregorianTranscriptionStaff
68 @notation{Staves} (singular: @notation{staff}) are created with
69 the @code{\new} or @code{\context} commands. For details, see
70 @ref{Creating contexts}.
72 The basic staff context is @code{Staff}:
74 @lilypond[verbatim,quote,relative=2]
75 \new Staff { c4 d e f }
78 The @code{DrumStaff} context creates a five-line staff set up for
79 a typical drum set. Each instrument is shown with a different
80 symbol. The instruments are entered in drum mode following a
81 @code{\drummode} command, with each instrument specified by name.
82 For details, see @ref{Percussion staves}.
84 @lilypond[verbatim,quote]
86 \drummode { cymc hh ss tomh }
90 @code{RhythmicStaff} creates a single-line staff that only
91 displays the rhythmic values of the input. Real durations are
92 preserved. For details, see @ref{Showing melody rhythms}.
94 @lilypond[verbatim,quote,relative=2]
95 \new RhythmicStaff { c4 d e f }
98 @code{TabStaff} creates a tablature with six strings in standard
99 guitar tuning. For details, see @ref{Default tablatures}.
101 @lilypond[verbatim,quote,relative=2]
102 \new TabStaff { c4 d e f }
105 There are two staff contexts specific for the notation of ancient
106 music: @code{MensuralStaff} and @code{VaticanaStaff}. They are
107 described in @ref{Pre-defined contexts}.
109 The @code{GregorianTranscriptionStaff} context creates a staff to
110 notate modern Gregorian chant. It does not show bar lines.
112 @lilypond[verbatim,quote,relative=2]
113 \new GregorianTranscriptionStaff { c4 d e f e d }
116 New single staff contexts may be defined. For details, see
117 @ref{Defining new contexts}.
126 @ref{Creating contexts},
127 @ref{Percussion staves},
128 @ref{Showing melody rhythms},
129 @ref{Default tablatures},
130 @ref{Pre-defined contexts},
132 @ref{Gregorian chant contexts},
133 @ref{Mensural contexts},
134 @ref{Defining new contexts}.
137 @rlsr{Staff notation}.
141 @rinternals{DrumStaff},
142 @rinternals{GregorianTranscriptionStaff},
143 @rinternals{RhythmicStaff},
144 @rinternals{TabStaff},
145 @rinternals{MensuralStaff},
146 @rinternals{VaticanaStaff},
147 @rinternals{StaffSymbol}.
150 @node Grouping staves
151 @unnumberedsubsubsec Grouping staves
153 @cindex start of system
154 @cindex staff, multiple
155 @cindex staves, multiple
156 @cindex system start delimiters
157 @cindex bracket, vertical
158 @cindex brace, vertical
168 Various contexts exist to group single staves together in order to
169 form multi-stave systems. Each grouping context sets the style of
170 the system start delimiter and the behavior of bar lines.
172 If no context is specified, the default properties will be used:
173 the group is started with a vertical line, and the bar lines are
176 @lilypond[verbatim,quote,relative=2]
183 In the @code{StaffGroup} context, the group is started with a
184 bracket and bar lines are drawn through all the staves.
186 @lilypond[verbatim,quote,relative=2]
193 In a @code{ChoirStaff}, the group starts with a bracket, but bar
194 lines are not connected.
196 @lilypond[verbatim,quote,relative=2]
203 In a @code{GrandStaff}, the group begins with a brace, and bar
204 lines are connected between the staves.
206 @lilypond[verbatim,quote,relative=2]
213 The @code{PianoStaff} is identical to a @code{GrandStaff}, except
214 that it supports printing the instrument name directly. For
215 details, see @ref{Instrument names}.
217 @lilypond[verbatim,quote,relative=2]
219 \set PianoStaff.instrumentName = #"Piano"
225 Each staff group context sets the property
226 @code{systemStartDelimiter} to one of the following values:
227 @code{SystemStartBar}, @code{SystemStartBrace}, or
228 @code{SystemStartBracket}. A fourth delimiter,
229 @code{SystemStartSquare}, is also available, but it must be
230 explicitly specified.
232 New staff group contexts may be defined. For details, see
233 @ref{Defining new contexts}.
238 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
239 {use-square-bracket-at-the-start-of-a-staff-group.ly}
241 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
242 {display-bracket-with-only-one-staff-in-a-system.ly}
244 @cindex mensurstriche layout
245 @cindex renaissance music
246 @cindex transcription of mensural music
247 @cindex mensural music, transcription of
249 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
250 {mensurstriche-layout-bar-lines-between-the-staves.ly}
260 @ref{Instrument names},
261 @ref{Defining new contexts}.
264 @rlsr{Staff notation}.
268 @rinternals{StaffGroup},
269 @rinternals{ChoirStaff},
270 @rinternals{GrandStaff},
271 @rinternals{PianoStaff},
272 @rinternals{SystemStartBar},
273 @rinternals{SystemStartBrace},
274 @rinternals{SystemStartBracket},
275 @rinternals{SystemStartSquare}.
278 @node Nested staff groups
279 @unnumberedsubsubsec Nested staff groups
281 @cindex staff, nested
282 @cindex staves, nested
283 @cindex nesting of staves
284 @cindex system start delimiters, nested
285 @cindex nested staff brackets
286 @cindex brackets, nesting of
287 @cindex braces, nesting of
289 Staff-group contexts can be nested to arbitrary depths. In this
290 case, each child context creates a new bracket adjacent to the
291 bracket of its parent group.
293 @lilypond[verbatim,quote,relative=2]
295 \new Staff { c2 c | c2 c }
297 \new Staff { g2 g | g2 g }
298 \new StaffGroup \with {
299 systemStartDelimiter = #'SystemStartSquare
302 \new Staff { e2 e | e2 e }
303 \new Staff { c2 c | c2 c }
309 New nested staff group contexts can be defined. For details, see
310 @ref{Defining new contexts}.
315 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
321 @ref{Grouping staves},
322 @ref{Instrument names},
323 @ref{Defining new contexts}.
326 @rlsr{Staff notation}.
329 @rinternals{StaffGroup},
330 @rinternals{ChoirStaff},
331 @rinternals{SystemStartBar},
332 @rinternals{SystemStartBrace},
333 @rinternals{SystemStartBracket},
334 @rinternals{SystemStartSquare}.
336 @node Separating systems
337 @unnumberedsubsubsec Separating systems
339 @cindex system separator mark
341 If the number of systems per page changes from page to page it is
342 customary to separate the systems by placing a system separator mark
343 between them. By default the system separator is blank, but can be
344 turned on with a @code{\paper} option.
346 @c \book is required here to display the system separator
347 @c ragged-right is required as there are two systems
348 @lilypond[verbatim,quote,ragged-right]
369 system-separator-markup = \slashSeparator
370 % following commands are needed only to format this documentation
372 paper-height = 100\mm
380 @ref{Page formatting}.
383 @rlsr{Staff notation}.
386 @node Modifying single staves
387 @subsection Modifying single staves
389 This section explains how to change specific attributes of one
390 staff: for example, modifying the number of staff lines or the
391 staff size. Methods to start and stop staves and set ossia
392 sections are also described.
402 @unnumberedsubsubsec Staff symbol
404 @cindex adjusting staff symbol
405 @cindex drawing staff symbol
406 @cindex staff symbol, setting of
407 @cindex staff symbol, drawing
408 @cindex stop staff lines
409 @cindex start staff lines
410 @cindex staff lines, amount of
411 @cindex staff lines, number of
412 @cindex staff line, thickness of
413 @cindex amount of staff lines
414 @cindex thickness of staff lines
415 @cindex ledger lines, setting
416 @cindex setting of ledger lines
417 @cindex spacing of ledger lines
418 @cindex number of staff lines
420 The lines of a staff belong to the @code{StaffSymbol} grob.
421 @code{StaffSymbol} properties can be modified to change the
422 appearance of a staff, but they must be modified before the staff
425 The number of staff lines may be changed. The clef position and
426 the position of middle C may need to be modified to fit the new
427 staff. For an explanation, refer to the snippet section in
430 @lilypond[verbatim,quote,relative=2]
432 \override StaffSymbol #'line-count = #3
437 Staff line thickness can be modified. The thickness of ledger
438 lines and stems are also affected, since they depend on staff line
441 @lilypond[verbatim,quote,relative=1]
443 \override StaffSymbol #'thickness = #3
448 Ledger line thickness can be set independently of staff line
449 thickness. In the example the two numbers are factors multiplying
450 the staff line thickness and the staff line spacing. The two
451 contributions are added to give the ledger line thickness.
453 @lilypond[verbatim,quote,relative=1]
455 \override StaffSymbol #'ledger-line-thickness = #'(1 . 0.2)
460 The distance between staff lines can be changed. This setting
461 affects the spacing of ledger lines as well.
463 @lilypond[verbatim,quote,relative=1]
465 \override StaffSymbol #'staff-space = #1.5
470 Further details about the properties of @code{StaffSymbol} can be
471 found in @rinternals{staff-symbol-interface}.
473 @cindex stopping a staff
474 @cindex starting a staff
475 @cindex staff, starting
476 @cindex staff, stopping
478 @funindex \startStaff
483 Modifications to staff properties in the middle of a score can be
484 placed between @code{\stopStaff} and @code{\startStaff}:
486 @lilypond[verbatim,quote,relative=2]
489 \override Staff.StaffSymbol #'line-count = #2
493 \revert Staff.StaffSymbol #'line-count
499 In general, @code{\startStaff} and @code{\stopStaff} can be used
500 to stop or start a staff in the middle of a score.
502 @lilypond[verbatim,quote,relative=2]
519 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
520 {making-some-staff-lines-thicker-than-the-others.ly}
533 @rlsr{Staff notation}.
536 @rinternals{StaffSymbol},
537 @rinternals{staff-symbol-interface}.
541 @unnumberedsubsubsec Ossia staves
543 @cindex staff, Frenched
545 @cindex Frenched staves
546 @cindex staff, resizing of
547 @cindex resizing of staves
549 @funindex \startStaff
554 @notation{Ossia} staves can be set by creating a new simultaneous
555 staff in the appropriate location:
557 @lilypond[verbatim,quote]
558 \new Staff \relative c'' {
562 \new Staff { e4 d f e }
569 However, the above example is not what is usually desired. To
570 create ossia staves that are above the original staff, have no
571 time signature or clef, and have a smaller font size, tweaks must
572 be used. The Learning Manual describes a specific technique to
573 achieve this goal, beginning with
574 @rlearning{Nesting music expressions}.
576 The following example uses the @code{alignAboveContext} property
577 to align the ossia staff. This method is most appropriate when
578 only a few ossia staves are needed.
580 @lilypond[verbatim,quote]
581 \new Staff = main \relative c'' {
587 \remove "Time_signature_engraver"
588 alignAboveContext = #"main"
590 \override StaffSymbol #'staff-space = #(magstep -3)
591 \override StaffSymbol #'thickness = #(magstep -3)
600 If many isolated ossia staves are needed, creating an empty
601 @code{Staff} context with a specific @emph{context id} may be more
602 appropriate; the ossia staves may then be created by
603 @emph{calling} this context and using @code{\startStaff} and
604 @code{\stopStaff} at the desired locations. The benefits of this
605 method are more apparent if the piece is longer than the following
608 @lilypond[verbatim,quote,ragged-right]
610 \new Staff = ossia \with {
611 \remove "Time_signature_engraver"
612 \override Clef #'transparent = ##t
614 \override StaffSymbol #'staff-space = #(magstep -3)
615 \override StaffSymbol #'thickness = #(magstep -3)
619 \new Staff \relative c' {
623 \context Staff = ossia {
624 \startStaff e4 g8 f e2 \stopStaff
631 \context Staff = ossia {
632 \startStaff g4 e8 f g2 \stopStaff
641 Using the @code{\Staff \RemoveEmptyStaves} command to create ossia
642 staves may be used as an alternative. This method is most
643 convenient when ossia staves occur immediately following a line
644 break. For more information about
645 @code{\Staff \RemoveEmptyStaves}, see @ref{Hiding staves}.
647 @lilypond[verbatim,quote,ragged-right]
649 \new Staff = ossia \with {
650 \remove "Time_signature_engraver"
651 \override Clef #'transparent = ##t
653 \override StaffSymbol #'staff-space = #(magstep -3)
654 \override StaffSymbol #'thickness = #(magstep -3)
659 \new Staff \relative c' {
671 \Staff \RemoveEmptyStaves
672 \override VerticalAxisGroup #'remove-first = ##t
680 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
681 {vertically-aligning-ossias-and-lyrics.ly}
688 @rglos{Frenched staff}.
691 @rlearning{Nesting music expressions},
692 @rlearning{Size of objects},
693 @rlearning{Length and thickness of objects}.
699 @rlsr{Staff notation}.
702 @rinternals{StaffSymbol}.
706 @unnumberedsubsubsec Hiding staves
708 @cindex Frenched score
709 @cindex Frenched staff
710 @cindex staff, hiding
712 @cindex hiding of staves
715 @funindex \RemoveEmptyStaves
716 @funindex RemoveEmptyStaffContext
717 @funindex Staff_symbol_engraver
722 Staff lines can be hidden by removing the
723 @code{Staff_symbol_engraver} from the @code{Staff} context. As an
724 alternative, @code{\stopStaff} may be used.
726 @lilypond[verbatim,quote]
728 \remove "Staff_symbol_engraver"
730 \relative c''' { a8 f e16 d c b a2 }
734 Empty staves can be hidden by setting the
735 @code{\Staff \RemoveEmptyStaves} command in the @code{\layout}
736 block. In orchestral scores, this style is known as @q{Frenched
737 Score}. By default, this command hides and removes all empty
738 staves in a score except for those in the first system.
740 @warning{A staff is considered empty when it contains only
741 multi-measure rests, rests, skips, spacer rests, or a combination of these
744 @lilypond[verbatim,quote,ragged-right]
747 \Staff \RemoveEmptyStaves
768 @code{\Staff \RemoveEmptyStaves} can also be used to create ossia
769 sections for a staff. For details, see @ref{Ossia staves}.
771 @cindex hiding ancient staves
772 @cindex hiding rhythmic staves
774 @funindex \RemoveEmptyStaves
776 The @code{\VaticanaStaff \RemoveEmptyStaves} command may be used to
777 hide empty staves in ancient music contexts. Similarly,
778 @code{\RhythmicStaff \RemoveEmptyStaves} may be used to hide empty
779 @code{RhythmicStaff} contexts.
783 @code{\Staff \RemoveEmptyStaves},
784 @code{\VaticanaStaff \RemoveEmptyStaves},
785 @code{\RhythmicStaff \RemoveEmptyStaves}.
791 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
792 {removing-the-first-empty-line.ly}
797 @rglos{Frenched staff}.
800 @rlearning{Visibility and color of objects}.
803 @ref{Changing context default settings},
807 @ref{Invisible rests},
808 @ref{Visibility of objects}.
811 @rlsr{Staff notation}.
814 @rinternals{ChordNames},
815 @rinternals{FiguredBass},
818 @rinternals{VerticalAxisGroup},
819 @rinternals{Staff_symbol_engraver}.
824 Removing @code{Staff_symbol_engraver} also hides bar lines. If
825 bar line visibility is forced, formatting errors may occur. In
826 this case, use the following overrides instead of removing the
830 \override StaffSymbol #'stencil = ##f
831 \override NoteHead #'no-ledgers = ##t
834 For the Known issues and warnings associated with
835 @code{\Staff \RemoveEmptyStaves} see @ref{Changing context default
839 @subsection Writing parts
841 This section explains how to insert tempo indications and
842 instrument names into a score. Methods to quote other voices and
843 format cue notes are also described.
847 * Quoting other voices::
848 * Formatting cue notes::
851 @node Instrument names
852 @unnumberedsubsubsec Instrument names
854 @cindex instrument names
855 @cindex instrument names, short
857 Instrument names can be printed on the left side of staves in the
858 @code{Staff} and @code{PianoStaff} contexts. The value of
859 @code{instrumentName} is used for the first staff, and the value
860 of @code{shortInstrumentName} is used for all succeeding staves.
862 @lilypond[verbatim,quote,ragged-right,relative=1]
863 \set Staff.instrumentName = #"Violin "
864 \set Staff.shortInstrumentName = #"Vln "
870 Markup mode can be used to create more complicated instrument
873 @lilypond[verbatim,quote,relative=2]
874 \set Staff.instrumentName = \markup {
875 \column { "Clarinetti"
876 \line { "in B" \smaller \flat } } }
880 @cindex instrument names, centering
882 When two or more staff contexts are grouped together, the
883 instrument names and short instrument names are centered by
884 default. To center multi-line instrument names,
885 @code{\center-column} must be used:
887 @lilypond[verbatim,quote,indent=1.5\cm,relative=2]
890 \set Staff.instrumentName = #"Flute"
894 \set Staff.instrumentName = \markup \center-column {
896 \line { "in B" \smaller \flat }
904 @funindex short-indent
906 However, if the instrument names are longer, the instrument names
907 in a staff group may not be centered unless the @code{indent} and
908 @code{short-indent} settings are increased. For details about
909 these settings, see @ref{Horizontal dimensions}.
911 @lilypond[verbatim,quote,ragged-right]
914 short-indent = 1.5\cm
919 \set Staff.instrumentName = #"Alto Flute in G"
920 \set Staff.shortInstrumentName = #"Fl."
925 \set Staff.instrumentName = #"Clarinet"
926 \set Staff.shortInstrumentName = #"Clar."
933 @cindex instrument names, adding to other contexts
935 To add instrument names to other contexts (such as
936 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}),
937 @code{Instrument_name_engraver} must be added to that context.
938 For details, see @ref{Modifying context plug-ins}.
940 @cindex instrument names, changing
941 @cindex changing instrument names
943 Instrument names may be changed in the middle of a piece.
944 However, remember that @code{instrumentName} will not be
945 displayed in the middle of the piece, as it only appears
948 @lilypond[verbatim,quote,ragged-right,relative=1]
949 \set Staff.instrumentName = #"First"
950 \set Staff.shortInstrumentName = #"one"
953 \set Staff.instrumentName = #"Second"
954 \set Staff.shortInstrumentName = #"two"
959 @cindex instrument switch
960 @cindex switching instruments
962 @funindex \addInstrumentDefinition
963 @funindex addInstrumentDefinition
964 @funindex \instrumentSwitch
965 @funindex instrumentSwitch
967 If an instrument @emph{switch} is needed,
968 @code{\addInstrumentDefinition} may be used in combination with
969 @code{\instrumentSwitch} to create a detailed list of the
970 necessary changes for the switch. The
971 @code{\addInstrumentDefinition} command has two arguments: an
972 identifying string, and an association list of context properties
973 and values to be used for the instrument. It must be placed in
974 the toplevel scope. @code{\instrumentSwitch} is used in the music
975 expression to declare the instrument switch:
977 @lilypond[verbatim,quote,ragged-right]
978 \addInstrumentDefinition #"contrabassoon"
979 #`((instrumentTransposition . ,(ly:make-pitch -1 0 0))
980 (shortInstrumentName . "Cbsn.")
981 (clefGlyph . "clefs.F")
982 (middleCPosition . 6)
984 (instrumentCueName . ,(make-bold-markup "cbsn."))
985 (midiInstrument . "bassoon"))
988 instrumentName = #"Bassoon"
992 \compressFullBarRests
995 \instrumentSwitch "contrabassoon"
1004 @ref{Horizontal dimensions},
1005 @ref{Modifying context plug-ins}.
1008 @rlsr{Staff notation}.
1010 Internals Reference:
1011 @rinternals{InstrumentName},
1012 @rinternals{PianoStaff},
1016 @node Quoting other voices
1017 @unnumberedsubsubsec Quoting other voices
1020 @cindex quoting other voices
1026 @funindex \quoteDuring
1027 @funindex quoteDuring
1028 @funindex \transposition
1029 @funindex transposition
1031 It is very common for one voice to double some of the music from
1032 another voice. For example, the first and second violins may play the
1033 same notes during a passage of music. In LilyPond this is accomplished
1034 by letting one voice @emph{quote} the other voice without having to
1037 Before a part can be quoted, the @code{\addQuote} command must be used
1038 to initialize the quoted fragment. This command must be used in the
1039 toplevel scope. The first argument is an identifying string, and the
1040 second is a music expression:
1043 flute = \relative c'' @{
1046 \addQuote "flute" @{ \flute @}
1049 The @code{\quoteDuring} command is used to indicate the point where the
1050 quotation begins. It is followed by two arguments: the name of the
1051 quoted voice, as defined with @code{\addQuote}, and a music expression
1052 that indicates the duration of the quote, usually spacer rests or
1053 multi-measure rests. The corresponding music (including all articulations,
1054 dynamics, markup, etc.) from the quoted voice is inserted into the music
1057 @lilypond[verbatim,quote]
1058 flute = \relative c'' {
1059 a4 gis g->\f gis^\markup{quoted}
1061 \addQuote "flute" { \flute }
1064 c4 cis \quoteDuring #"flute" { s2 }
1068 If the music expression used for @code{\quoteDuring} contains
1069 anything but a spacer rest or multi-measure rest, a polyphonic
1070 situation is created, which is often not desirable:
1072 @lilypond[verbatim,quote]
1073 flute = \relative c'' {
1076 \addQuote "flute" { \flute }
1079 c4 cis \quoteDuring #"flute" { c4 b }
1083 Quotations recognize instrument transposition settings for both
1084 the source and target instruments if the @code{\transposition}
1085 command is used. For details about @code{\transposition}, see
1086 @ref{Instrument transpositions}.
1088 @lilypond[verbatim,quote]
1089 clarinet = \relative c'' {
1093 \addQuote "clarinet" { \clarinet }
1096 c4 cis \quoteDuring #"clarinet" { s2 }
1100 It is possible to tag quotations with unique names in order to
1101 process them in different ways. For details about this procedure,
1102 see @ref{Using tags}.
1104 It is also possible to adjust which objects from the original voice are quoted
1105 by changing the @code{quotedEventTypes} property. By default, its value is
1106 @code{#'(StreamEvent)}, which means that everything is quoted. Setting it
1107 to e.g. @code{#'(note-event rest-event tie-event)} causes lilypond to quote
1108 only notes, rests and ties, but no articulations, markup or dynamics.
1110 @lilypond[verbatim,quote]
1111 clarinet = \relative c'' {
1112 a4 gis g->\f gis^\markup{quoted}
1114 \addQuote "clarinet" { \clarinet }
1117 \set Score.quotedEventTypes = #'(note-event rest-event tie-event)
1118 c4 cis \quoteDuring #"clarinet" { s2 }
1124 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1125 {quoting-another-voice-with-transposition.ly}
1128 @cindex articulation-event
1129 @cindex dynamic-event
1132 @funindex quotedEventTypes
1133 @funindex quotedCueEventTypes
1135 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1136 {quoting-another-voice.ly}
1141 @ref{Instrument transpositions},
1145 @rlsr{Staff notation}.
1147 Internals Reference:
1148 @rinternals{QuoteMusic},
1154 Only the contents of the first @code{Voice} occurring in an
1155 @code{\addQuote} command will be considered for quotation, so
1156 @code{@var{music}} cannot contain @code{\new} and
1157 @code{\context Voice} statements that would switch to a different
1160 Quoting grace notes is broken and can even cause LilyPond to
1163 Quoting nested triplets may result in poor notation.
1165 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
1166 written entirely in lower-case letters: @code{\addquote}.
1169 @node Formatting cue notes
1170 @unnumberedsubsubsec Formatting cue notes
1174 @cindex cue notes, formatting
1176 @cindex quoting other voices
1177 @cindex cues, formatting
1179 @funindex \cueDuring
1181 @funindex \quoteDuring
1182 @funindex quoteDuring
1184 The previous section explains how to create quotations. The
1185 @code{\cueDuring} command is a more specialized form of
1186 @code{\quoteDuring}, being particularly useful for inserting cue
1187 notes into a part. The syntax is as follows:
1190 \cueDuring #@var{partname} #@var{voice} @var{music}
1193 This command copies only the notes and rests from the
1194 corresponding measures from @code{@var{partname}} into a
1195 @code{CueVoice} context. The @code{CueVoice} is created
1196 implicitly, and occurs simultaneously with @code{@var{music}},
1197 which creates a polyphonic situation. The @code{@var{voice}}
1198 argument determines whether the cue notes should be notated as a
1199 first or second voice; @code{UP} corresponds to the first voice,
1200 and @code{DOWN} corresponds to the second.
1202 @lilypond[verbatim,quote]
1203 oboe = \relative c'' {
1204 r2 r8 d16(\f f e g f a)
1207 \addQuote "oboe" { \oboe }
1209 \new Voice \relative c'' {
1210 \cueDuring #"oboe" #UP { R1 }
1216 In the above example, the @code{Voice} context had to be
1217 explicitly declared, or else the entire music expression would
1218 belong to the @code{CueVoice} context.
1220 It is possible to adjust which aspects of the music are quoted with
1221 @code{\cueDuring} by setting the @code{quotedCueEventTypes} property. Its
1222 default value is @code{#'(note-event rest-event tie-event beam-event
1223 tuplet-span-event)}, which means that only notes, rest, ties, beams and
1224 tuplets are quoted, but not articulations, dynamic marks, markup etc.
1226 @lilypond[verbatim,quote]
1227 oboe = \relative c'' {
1228 r2 r8 d16(\f f e g f a)
1231 \addQuote "oboe" { \oboe }
1233 \new Voice \relative c'' {
1234 \set Score.quotedCueEventTypes = #'(note-event rest-event tie-event
1235 beam-event tuplet-span-event
1236 dynamic-event slur-event)
1237 \cueDuring #"oboe" #UP { R1 }
1244 The name of the cued instrument can be printed by setting the
1245 @code{instrumentCueName} property in the @code{CueVoice} context.
1247 @lilypond[verbatim,quote]
1248 oboe = \relative c''' {
1251 \addQuote "oboe" { \oboe }
1253 \new Staff \relative c'' <<
1254 \new CueVoice \with {
1255 instrumentCueName = "ob."
1258 \cueDuring #"oboe" #UP { R1 }
1264 @cindex removing cues
1265 @cindex removing cue notes
1266 @cindex cue notes, removing
1270 @funindex \transposedCueDuring
1271 @funindex transposedCueDuring
1273 In addition to printing the name of the cued instrument, when cue
1274 notes end, the name of the original instrument should be printed,
1275 and any other changes introduced by the cued part should be
1276 undone. This can be accomplished by using
1277 @code{\addInstrumentDefinition} and @code{\instrumentSwitch}. For
1278 an example and explanation, see @ref{Instrument names}.
1280 The @code{\killCues} command removes cue notes from a music
1281 expression. This can be useful if cue notes need to be removed
1282 from a part but may be restored at a later time.
1284 @lilypond[verbatim,quote]
1285 flute = \relative c''' {
1288 \addQuote "flute" { \flute }
1290 \new Voice \relative c'' {
1292 \cueDuring #"flute" #UP { R1 }
1298 The @code{\transposedCueDuring} command is useful for adding
1299 instrumental cues from a completely different register. The
1300 syntax is similar to @code{\cueDuring}, but it requires one extra
1301 argument to specify the transposition of the cued instrument. For
1302 more information about transposition, see
1303 @ref{Instrument transpositions}.
1305 @lilypond[verbatim,quote]
1306 piccolo = \relative c''' {
1312 \addQuote "piccolo" { \piccolo }
1314 cbassoon = \relative c, {
1317 \transposedCueDuring #"piccolo" #UP c,, { R1 }
1322 \new Staff = "piccolo" \piccolo
1323 \new Staff = "cbassoon" \cbassoon
1327 It is possible to tag cued parts with unique names in order to
1328 process them in different ways. For details about this procedure,
1329 see @ref{Using tags}.
1331 @cindex notes, smaller
1332 @cindex smaller notes
1334 A @code{CueVoice} context may be created explicitly if notes of a
1335 smaller size are required, for example to set an alternative
1336 sequence of notes more suitable for a higher or lower voice.
1338 @lilypond[verbatim,relative=2]
1355 @ref{Instrument transpositions},
1356 @ref{Instrument names},
1360 @rlsr{Staff notation}.
1362 Internals Reference:
1363 @rinternals{CueVoice},
1369 Collisions can occur with rests, when using @code{\cueDuring},
1370 between @code{Voice} and @code{CueVoice} contexts.