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 @c The line width is a bit of a hack to allow space for the
17 @lilypondfile[quote,ragged-right,line-width=14.5\cm,staffsize=16]{staff-headword.ly}
19 This section explains how to influence the appearance of staves,
20 how to print scores with more than one staff, and how to add tempo
21 indications and cue notes to staves.
25 * Modifying single staves::
30 @node Displaying staves
31 @subsection Displaying staves
33 This section describes the different methods of creating and
37 * Instantiating new staves::
39 * Nested staff groups::
40 * Separating systems::
44 @node Instantiating new staves
45 @unnumberedsubsubsec Instantiating new staves
48 @cindex staff initiation
49 @cindex staff instantiation
53 @cindex staff, percussion
55 @cindex percussion staff
56 @cindex Gregorian transcription staff
57 @cindex rhythmic staff
64 @funindex RhythmicStaff
66 @funindex MensuralStaff
67 @funindex VaticanaStaff
68 @funindex GregorianTranscriptionStaff
70 @notation{Staves} (singular: @notation{staff}) are created with
71 the @code{\new} or @code{\context} commands. For details, see
72 @ref{Creating and referencing contexts}.
74 The basic staff context is @code{Staff}:
76 @lilypond[verbatim,quote]
77 \new Staff \relative { c''4 d e f }
80 The @code{DrumStaff} context creates a five-line staff set up for
81 a typical drum set. Each instrument is shown with a different
82 symbol. The instruments are entered in drum mode following a
83 @code{\drummode} command, with each instrument specified by name.
84 For details, see @ref{Percussion staves}.
86 @lilypond[verbatim,quote]
88 \drummode { cymc hh ss tomh }
92 @code{RhythmicStaff} creates a single-line staff that only
93 displays the rhythmic values of the input. Real durations are
94 preserved. For details, see @ref{Showing melody rhythms}.
96 @lilypond[verbatim,quote]
97 \new RhythmicStaff { c4 d e f }
100 @code{TabStaff} creates a tablature with six strings in standard
101 guitar tuning. For details, see @ref{Default tablatures}.
103 @lilypond[verbatim,quote]
104 \new TabStaff \relative { c''4 d e f }
107 There are two staff contexts specific for the notation of ancient
108 music: @code{MensuralStaff} and @code{VaticanaStaff}. They are
109 described in @ref{Pre-defined contexts}.
111 The @code{GregorianTranscriptionStaff} context creates a staff to
112 notate modern Gregorian chant. It does not show bar lines.
114 @lilypond[verbatim,quote]
115 \new GregorianTranscriptionStaff \relative { c''4 d e f e d }
118 New single staff contexts may be defined. For details, see
119 @ref{Defining new contexts}.
127 @ref{Creating and referencing contexts},
128 @ref{Percussion staves},
129 @ref{Showing melody rhythms},
130 @ref{Default tablatures},
131 @ref{Pre-defined contexts},
133 @ref{Gregorian chant contexts},
134 @ref{Mensural contexts},
135 @ref{Defining new contexts}.
138 @rlsr{Staff notation}.
142 @rinternals{DrumStaff},
143 @rinternals{GregorianTranscriptionStaff},
144 @rinternals{RhythmicStaff},
145 @rinternals{TabStaff},
146 @rinternals{MensuralStaff},
147 @rinternals{VaticanaStaff},
148 @rinternals{StaffSymbol}.
151 @node Grouping staves
152 @unnumberedsubsubsec Grouping staves
154 @cindex start of system
155 @cindex staff, multiple
156 @cindex staves, multiple
157 @cindex system start delimiters
158 @cindex bracket, vertical
159 @cindex brace, vertical
169 Various contexts exist to group single staves together in order to
170 form multi-stave systems. Each grouping context sets the style of
171 the system start delimiter and the behavior of bar lines.
173 If no context is specified, the default properties will be used:
174 the group is started with a vertical line, and the bar lines are
177 @lilypond[verbatim,quote]
179 \new Staff \relative { c''1 c }
180 \new Staff \relative { c''1 c }
184 In the @code{StaffGroup} context, the group is started with a
185 bracket and bar lines are drawn through all the staves.
187 @lilypond[verbatim,quote]
189 \new Staff \relative { c''1 c }
190 \new Staff \relative { c''1 c }
194 In a @code{ChoirStaff}, the group starts with a bracket, but bar
195 lines are not connected.
197 @lilypond[verbatim,quote]
199 \new Staff \relative { c''1 c }
200 \new Staff \relative { c''1 c }
204 In a @code{GrandStaff}, the group begins with a brace, and bar
205 lines are connected between the staves.
207 @lilypond[verbatim,quote]
209 \new Staff \relative { c''1 c }
210 \new Staff \relative { c''1 c }
214 The @code{PianoStaff} is identical to a @code{GrandStaff}, except
215 that it supports printing the instrument name directly. For
216 details, see @ref{Instrument names}.
218 @lilypond[verbatim,quote]
220 \set PianoStaff.instrumentName = #"Piano"
221 \new Staff \relative { c''1 c }
222 \new Staff \relative { \clef bass c1 c }
226 Each staff group context sets the property
227 @code{systemStartDelimiter} to one of the following values:
228 @code{SystemStartBar}, @code{SystemStartBrace}, or
229 @code{SystemStartBracket}. A fourth delimiter,
230 @code{SystemStartSquare}, is also available, but it must be
231 explicitly specified.
233 New staff group contexts may be defined. For details, see
234 @ref{Defining new contexts}.
239 @lilypondfile[verbatim,quote,texidoc,doctitle]
240 {use-square-bracket-at-the-start-of-a-staff-group.ly}
242 @lilypondfile[verbatim,quote,texidoc,doctitle]
243 {display-bracket-with-only-one-staff-in-a-system.ly}
245 @cindex mensurstriche layout
246 @cindex renaissance music
247 @cindex transcription of mensural music
248 @cindex mensural music, transcription of
250 @lilypondfile[verbatim,quote,texidoc,doctitle]
251 {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]
295 \new Staff \relative { c''2 c | c2 c }
297 \new Staff \relative { g'2 g | g2 g }
298 \new StaffGroup \with {
299 systemStartDelimiter = #'SystemStartSquare
302 \new Staff \relative { e'2 e | e2 e }
303 \new Staff \relative { c'2 c | c2 c }
309 New nested staff group contexts can be defined. For details, see
310 @ref{Defining new contexts}.
315 @lilypondfile[verbatim,quote,texidoc,doctitle]
320 @ref{Grouping staves},
321 @ref{Instrument names},
322 @ref{Defining new contexts}.
325 @rlsr{Staff notation}.
328 @rinternals{StaffGroup},
329 @rinternals{ChoirStaff},
330 @rinternals{SystemStartBar},
331 @rinternals{SystemStartBrace},
332 @rinternals{SystemStartBracket},
333 @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
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
405 @cindex staff lines, stopping and starting
406 @cindex staff lines, modifying
408 @cindex ledger lines, internal
409 @cindex ledger lines, modifying
411 @funindex \startStaff
416 The @code{\stopStaff} and @code{\startStaff} commands can be used to
417 stop or (re)start the staff lines respectively, from being printed at
418 any point witin a score.
420 @lilypond[verbatim,quote]
422 \stopStaff f''4 d \startStaff g, e
423 f'4 d \stopStaff g, e
424 f'4 d \startStaff g, e
433 The lines of a staff belong to the @code{StaffSymbol} grob (including
434 ledger lines) and can be modified using @code{StaffSymbol} properties, but
435 these modifications must be made before the staff is (re)started.
437 The number of staff lines can be altered:
439 @lilypond[verbatim,quote]
442 \override Staff.StaffSymbol.line-count = #2
446 \revert Staff.StaffSymbol.line-count
451 The position of each staff line can also be altered. A list of
452 numbers sets each line's position. @code{0}@tie{}corresponds to the normal
453 center line, and the normal line positions are
454 @code{(-4@tie{}-2@tie{}0@tie{}2@tie{}4)}. A single staff line is
455 printed for every value entered so that the number of staff lines, as
456 well as their position, can be changed with a single override.
458 @lilypond[verbatim,quote]
461 \override Staff.StaffSymbol.line-positions = #'(1 3 5 -1 -3)
464 \override Staff.StaffSymbol.line-positions = #'(8 6.5 -6 -8 -0.5)
469 To preserve typical stem directions (in the bottom half of the staff
470 stems point up, in the top half they point down), align the center
471 line (or space) of the customized staff with the position of the
472 normal center line (0). The clef position and the position of
473 middle@tie{}C may need to be adjusted accordingly to fit the new
474 lines. See @ref{Clef}.
476 Staff line thickness can be altered. Ledger lines and note stems, by
477 default, are also affected.
479 @lilypond[verbatim,quote]
481 \override StaffSymbol.thickness = #3
487 It is also possible to set ledger line thickness independently of staff
490 @lilypond[verbatim,quote]
492 \override StaffSymbol.thickness = #2
493 \override StaffSymbol.ledger-line-thickness = #'(0.5 . 0.4)
500 The first value is multiplied by the staff line thickness, the second by
501 the staff space and then the two values are added together to give the
502 new thickness of the ledger line.
504 The vertical positions of ledger lines can be altered,
506 @lilypond[verbatim,quote]
508 \override StaffSymbol.ledger-positions = #'(-3 -2 -1 2 5 6)
514 Additional ledger lines can be made to appear above or below note heads
515 depending on the current position relative to other note heads that
516 also have their own ledger lines.
518 @lilypond[verbatim,quote]
520 \override StaffSymbol.ledger-extra = #4
526 Ledger lines can also be made to appear inside the staff where custom
527 staff lines are required. The example shows the default position of
528 ledger lines when the explicit @code{ledger-position} is and is not set.
529 The @code{\stopStaff} is needed in the example to revert the
530 @code{\override} for the whole @code{StaffSymbol}.
532 @lilypond[verbatim,quote]
534 \override Staff.StaffSymbol.line-positions = #'(-8 0 2 4)
538 \override Staff.StaffSymbol.ledger-positions = #'(-8 -6 (-4 -2) 0)
543 The distance between staff lines can be altered. This affects ledger
544 line spacing as well.
546 @lilypond[verbatim,quote]
548 \override StaffSymbol.staff-space = #1.5
555 @lilypondfile[verbatim,quote,texidoc,doctitle]
556 {making-some-staff-lines-thicker-than-the-others.ly}
568 @rlsr{Staff notation}.
571 @rinternals{StaffSymbol},
572 @rinternals{staff-symbol-interface}.
576 @unnumberedsubsubsec Ossia staves
578 @cindex staff, Frenched
580 @cindex Frenched staves
581 @cindex staff, resizing of
582 @cindex resizing of staves
584 @funindex \startStaff
589 @notation{Ossia} staves can be set by creating a new simultaneous
590 staff in the appropriate location:
592 @lilypond[verbatim,quote]
593 \new Staff \relative {
597 \new Staff { e4 d f e }
604 However, the above example is not what is usually desired. To
605 create ossia staves that are above the original staff, have no
606 time signature or clef, and have a smaller font size, tweaks must
607 be used. The Learning Manual describes a specific technique to
608 achieve this goal, beginning with
609 @rlearning{Nesting music expressions}.
611 The following example uses the @code{alignAboveContext} property
612 to align the ossia staff. This method is most appropriate when
613 only a few ossia staves are needed.
615 @lilypond[verbatim,quote]
616 \new Staff = "main" \relative {
622 \remove "Time_signature_engraver"
623 alignAboveContext = #"main"
633 If many isolated ossia staves are needed, creating an empty
634 @code{Staff} context with a specific @emph{context id} may be more
635 appropriate; the ossia staves may then be created by
636 @emph{calling} this context and using @code{\startStaff} and
637 @code{\stopStaff} at the desired locations. The benefits of this
638 method are more apparent if the piece is longer than the following
641 @lilypond[verbatim,quote,ragged-right]
643 \new Staff = "ossia" \with {
644 \remove "Time_signature_engraver"
650 \new Staff \relative {
654 \context Staff = "ossia" {
655 \startStaff e4 g8 f e2 \stopStaff
662 \context Staff = "ossia" {
663 \startStaff g4 e8 f g2 \stopStaff
672 Using the @code{\RemoveAllEmptyStaves} command to create ossia
673 staves may be used as an alternative. This method is most
674 convenient when ossia staves occur immediately following a line
675 break. For more information about
676 @code{\RemoveAllEmptyStaves}, see @ref{Hiding staves}.
678 @lilypond[verbatim,quote,ragged-right]
680 \new Staff = "ossia" \with {
681 \remove "Time_signature_engraver"
684 \RemoveAllEmptyStaves
689 \new Staff \relative {
703 @lilypondfile[verbatim,quote,texidoc,doctitle]
704 {vertically-aligning-ossias-and-lyrics.ly}
710 @rglos{Frenched staff}.
713 @rlearning{Nesting music expressions},
714 @rlearning{Size of objects},
715 @rlearning{Length and thickness of objects}.
721 @rlsr{Staff notation}.
724 @rinternals{StaffSymbol}.
728 @unnumberedsubsubsec Hiding staves
730 @cindex Frenched score
731 @cindex Frenched staff
732 @cindex staff, hiding
734 @cindex hiding staves
735 @cindex hiding ancient staves
736 @cindex hiding rhythmic staves
737 @cindex hiding vaticana staves
740 @funindex \RemoveEmptyStaves
741 @funindex \RemoveAllEmptyStaves
742 @funindex Staff_symbol_engraver
747 Staff lines can be hidden by removing the
748 @code{Staff_symbol_engraver} from the @code{Staff} context. As an
749 alternative, @code{\stopStaff} may be used.
751 @lilypond[verbatim,quote]
753 \remove "Staff_symbol_engraver"
755 \relative { a''8 f e16 d c b a2 }
759 Empty staves can be hidden (for a so-called @q{Frenched Score})
760 by applying the @code{\RemoveEmptyStaves} command on a context, which
761 can be done globally (in a @code{\layout} block) as well as for
762 specific staves only (in a @code{\with} block). This command removes
763 all empty staves in a score except for those in the first system. If
764 you want those in the first system to be hidden also, use
765 @code{\RemoveAllEmptyStaves}. Supported contexts are @code{Staff},
766 @code{RhythmicStaff} and @code{VaticanaStaff}.
768 @warning{A staff is considered empty when it contains only
769 multi-measure rests, rests, skips, spacer rests, or a combination of these
772 @lilypond[verbatim,quote,ragged-right]
797 @code{\RemoveAllEmptyStaves} can also be used to create ossia
798 sections for a staff. For details, see @ref{Ossia staves}.
802 @code{\RemoveEmptyStaves},
803 @code{\RemoveAllEmptyStaves}.
808 @rglos{Frenched staff}.
811 @rlearning{Visibility and color of objects}.
814 @ref{Changing context default settings},
818 @ref{Invisible rests},
819 @ref{Visibility of objects}.
822 @rlsr{Staff notation}.
825 @rinternals{ChordNames},
826 @rinternals{FiguredBass},
829 @rinternals{VerticalAxisGroup},
830 @rinternals{Staff_symbol_engraver}.
833 Removing @code{Staff_symbol_engraver} also hides bar lines. If
834 bar line visibility is forced, formatting errors may occur. In
835 this case, use the following overrides instead of removing the
840 \override NoteHead.no-ledgers = ##t
843 For the Known issues and warnings associated with
844 @code{\Staff \RemoveEmptyStaves} see
845 @ref{Changing context default settings}.
849 @subsection Writing parts
851 This section explains how to insert tempo indications and
852 instrument names into a score. Methods to quote other voices and
853 format cue notes are also described.
857 * Quoting other voices::
858 * Formatting cue notes::
861 @node Instrument names
862 @unnumberedsubsubsec Instrument names
864 @cindex instrument names
865 @cindex instrument names, short
867 Instrument names can be printed on the left side of staves in the
868 @code{Staff}, @code{PianoStaff}, @code{StaffGroup}, @code{GrandStaff}
869 and @code{ChoirStaff} contexts. The value of
870 @code{instrumentName} is used for the first staff, and the value
871 of @code{shortInstrumentName} is used for all succeeding staves.
873 @lilypond[verbatim,quote,ragged-right]
875 instrumentName = #"Violin "
876 shortInstrumentName = #"Vln. "
878 c'4.. g'16 c4.. g'16 \break | c1 |
882 @cindex instrument names, complex
884 @code{\markup} can be used to create more complex instrument names:
886 @lilypond[verbatim,quote]
888 instrumentName = \markup {
889 \column { "Clarinetti"
890 \line { "in B" \smaller \flat }
898 @cindex instrument names, centering
900 When two or more staff contexts are grouped together, the instrument
901 names and short instrument names are centered by default. To center
902 multi-line instrument names, @code{\center-column} must be used:
904 @lilypond[verbatim,quote,indent=1.5\cm]
907 instrumentName = #"Flute"
912 instrumentName = \markup {
913 \center-column { "Clarinet"
914 \line { "in B" \smaller \flat }
917 } \relative { c''4 b c2 }
922 @funindex short-indent
924 However, if the instrument names are longer, the instrument names in a
925 staff group may not be centered unless the @code{indent} and
926 @code{short-indent} settings are increased. For details about these
927 settings, see @ref{paper variables for shifts and indents,,@code{@bs{}paper} variables for shifts and indents}.
929 @lilypond[verbatim,quote,ragged-right]
932 instrumentName = #"Alto Flute in G"
933 shortInstrumentName = #"Flt."
939 instrumentName = #"Clarinet"
940 shortInstrumentName = #"Clar."
949 short-indent = 1.5\cm
953 @cindex instrument names, adding to other contexts
955 To add instrument names to other contexts (such as @code{ChordNames} or
956 @code{FiguredBass}), @code{Instrument_name_engraver} must be added to
957 that context. For details, see @ref{Modifying context plug-ins}.
959 @cindex instrument names, changing
960 @cindex changing instrument names
962 The @code{shortInstrumentName} may be changed in the middle of a piece,
963 along with other settings as needed for the new instrument.
964 However, only the first instance of @code{instrumentName} will be
965 printed and subsequent changes will be ignored:
967 @lilypond[verbatim,quote,ragged-right]
968 prepPiccolo = <>^\markup \italic { muta in Piccolo }
971 \set Staff.instrumentName = #"Piccolo"
972 \set Staff.shortInstrumentName = #"Picc."
973 \set Staff.midiInstrument = #"piccolo"
974 <>^\markup \bold { Piccolo }
978 prepFlute = <>^\markup \italic { muta in Flauto }
981 \set Staff.instrumentName = #"Flute"
982 \set Staff.shortInstrumentName = #"Flt."
983 \set Staff.midiInstrument = #"flute"
984 <>^\markup \bold { Flute }
989 instrumentName = #"Flute"
990 shortInstrumentName = #"Flt."
991 midiInstrument = #"flute"
995 g1 g \prepPiccolo R R \break
998 g1 g \prepFlute R R \break
1007 @ref{paper variables for shifts and indents,,@code{@bs{}paper} variables for shifts and indents},
1008 @ref{Modifying context plug-ins}.
1011 @rlsr{Staff notation}.
1013 Internals Reference:
1014 @rinternals{InstrumentName},
1015 @rinternals{PianoStaff},
1019 @node Quoting other voices
1020 @unnumberedsubsubsec Quoting other voices
1022 @cindex quote, voices
1023 @cindex voices, quoting
1024 @cindex fragments, quoting
1029 @funindex \quoteDuring
1030 @funindex quoteDuring
1031 @funindex \transposition
1032 @funindex transposition
1034 It is very common for one voice to use the same notes as those from
1035 another voice. For example, first and second violins playing the same
1036 phrase during a particular passage of the music. This is done by
1037 letting one voice @emph{quote} the other, without having to re-enter the
1038 music all over again for the second voice.
1040 The @code{\addQuote} command, used in the top level scope, defines a
1041 stream of music from which fragments can be quoted.
1043 The @code{\quoteDuring} command is used to indicate the point where the
1044 quotation begins. It is followed by two arguments: the name of the
1045 quoted voice, as defined with @code{\addQuote}, and a music expression
1046 for the duration of the quote.
1048 @lilypond[verbatim,quote]
1049 fluteNotes = \relative {
1050 a'4 gis g gis | b4^"quoted" r8 ais\p a4( f)
1053 oboeNotes = \relative {
1054 c''4 cis c b \quoteDuring #"flute" { s1 }
1057 \addQuote "flute" { \fluteNotes }
1061 \new Staff \with { instrumentName = "Flute" } \fluteNotes
1062 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1067 If the music expression used in @code{\quoteDuring} contains notes
1068 instead of spacer or multimeasure rests then the quote will appear as
1069 polyphony and may produce unexpected results.
1071 @lilypond[verbatim,quote]
1072 fluteNotes = \relative {
1073 a'4 gis g gis | b4^"quoted" r8 ais\p a4( f)
1076 oboeNotes = \relative {
1077 c''4 cis c b \quoteDuring #"flute" { e4 r8 ais b4 a }
1080 \addQuote "flute" { \fluteNotes }
1084 \new Staff \with { instrumentName = "Flute" } \fluteNotes
1085 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1090 If an @code{\unfoldRepeat} command in a music expression is required to
1091 be printed when using @code{\quoteDuring}, then it too must also contain
1092 its own @code{\unfoldRepeat} command;
1094 @lilypond[verbatim,quote]
1095 fluteNotes = \relative {
1096 \repeat volta 2 { a'4 gis g gis }
1099 oboeNotesDW = \relative {
1100 \repeat volta 2 \quoteDuring #"incorrect" { s1 }
1103 oboeNotesW = \relative {
1104 \repeat volta 2 \quoteDuring #"correct" { s1 }
1108 \addQuote "incorrect" { \fluteNotes }
1110 \addQuote "correct" { \unfoldRepeats \fluteNotes }
1115 \new Staff \with { instrumentName = "Flute" }
1117 \new Staff \with { instrumentName = "Oboe (incorrect)" }
1119 \new Staff \with { instrumentName = "Oboe (correct)" }
1125 The @code{\quoteDuring} command uses the @code{\transposition} settings
1126 of both quoted and quoting parts to produce notes for the quoting part
1127 that have the same sounding pitch as those in the quoted part.
1129 @lilypond[verbatim,quote]
1130 clarinetNotes = \relative c'' {
1133 b4 ais a ais | cis4^"quoted" r8 bis\p b4( f)
1136 oboeNotes = \relative {
1137 c''4 cis c b \quoteDuring #"clarinet" { s1 }
1140 \addQuote "clarinet" { \clarinetNotes }
1145 \new Staff \with { instrumentName = "Clarinet" } \clarinetNotes
1146 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1152 @cindex articulation-event
1153 @cindex dynamic-event
1156 @cindex crescendo-event
1158 @funindex quotedEventTypes
1159 @funindex quotedCueEventTypes
1161 By default quoted music will include all articulations, dynamics,
1162 markups, etc., in the quoted expression. It is possible to choose which
1163 of these objects from the quoted music are displayed by using the
1164 @code{quotedEventTypes} context property.
1166 @lilypond[verbatim,quote]
1167 fluteNotes = \relative {
1169 b4\<^"quoted" r8 ais a4\f( c->)
1172 oboeNotes = \relative {
1174 \quoteDuring #"flute" { s1 }
1177 \addQuote "flute" { \fluteNotes }
1181 \set Score.quotedEventTypes = #'(note-event articulation-event
1182 crescendo-event rest-event
1183 slur-event dynamic-event)
1184 \new Staff \with { instrumentName = "Flute" } \fluteNotes
1185 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1190 Quotes can also be tagged, see @ref{Using tags}.
1194 @ref{Instrument transpositions},
1198 @file{scm/define-event-classes.scm}.
1201 @rlsr{Staff notation}.
1203 Internals Reference:
1204 @rinternals{Music classes},
1205 @rinternals{QuoteMusic},
1209 Only the contents of the first @code{Voice} occurring in an
1210 @code{\addQuote} command will be considered for quotation, so if the music
1211 expression contains @code{\new} or @code{\context Voice}
1212 statements, their contents will not be quoted. Quoting grace notes
1213 is unsupported and may cause LilyPond to crash whereas quoting nested
1214 triplets may result in poor notation.
1217 @node Formatting cue notes
1218 @unnumberedsubsubsec Formatting cue notes
1222 @cindex cue notes, formatting
1223 @cindex formatting, cue notes
1224 @cindex voices, quoting
1227 @funindex \cueDuring
1231 @funindex \cueDuringWithClef
1232 @funindex cueDuringWithClef
1233 @funindex \quoteDuring
1234 @funindex quoteDuring
1236 @cindex notes, smaller
1237 @cindex smaller notes
1240 The simplest way to format cue notes is to explicitly create a
1241 @code{CueVoice} context within the part.
1249 \stemUp d'8^"flute" c d e fis2
1256 The @code{\cueClef} command can also be used with an explict
1257 @code{CueVoice} context if a change of clef is required and will print
1258 an appropriately sized clef for the cue notes. The @code{\cueClefUnset}
1259 command can then be used to switch back to the original clef, again with
1260 an appropriately sized clef.
1262 @lilypond[verbatim,noragged-right]
1267 { e'2\rest r4. \cueClefUnset e,8 }
1269 \cueClef "treble" \stemUp d''8^"flute" c d e fis2
1276 The @code{\cueClef} and @code{\cueClefUnset} command can also be used
1277 without a @code{CueVoice} if required.
1279 @lilypond[verbatim,noragged-right]
1284 d''8^"flute" c d e fis2
1290 For more complex cue note placement, e.g including transposition, or
1291 inserting cue notes from multiple music sources the @code{\cueDuring} or
1292 @code{\cueDuringWithClef} commands can be used. These are more
1293 specialized form of @code{\quoteDuring}, see @ref{Quoting other voices}
1294 in the previous section.
1299 \cueDuring #@var{quotename} #@var{direction} #@var{music}
1305 \cueDuringWithClef #@var{quotename} #@var{direction} #@var{clef} #@var{music}
1308 The music from the corresponding measures of the @code{@var{quote name}}
1309 is added as a @code{CueVoice} context and occurs simultaneously with the
1310 @code{@var{music}}, which then creates a polyphonic situation. The
1311 @code{@var{direction}} takes the argument @code{UP} or @code{DOWN}, and
1312 corresponds to the first and second voices respectively, determining how
1313 the cue notes are printed in relation to the other voice.
1315 @lilypond[verbatim,quote]
1316 fluteNotes = \relative {
1317 r2. c''4 | d8 c d e fis2 | g2 d |
1320 oboeNotes = \relative c'' {
1322 <>^\markup \tiny { flute }
1323 \cueDuring #"flute" #UP { R1 }
1327 \addQuote "flute" { \fluteNotes }
1337 It is possible to adjust which aspects of the music are quoted with
1338 @code{\cueDuring} by setting the @code{quotedCueEventTypes}
1339 property. Its default value is @code{'(note-event rest-event
1340 tie-event beam-event tuplet-span-event)}, which means that only
1341 notes, rests, ties, beams and tuplets are quoted, but not
1342 articulations, dynamic marks, markup etc.
1344 @warning{When a @code{Voice} starts with @code{\cueDuring}, as in the
1345 following example, the @code{Voice} context must be explicitly declared,
1346 or else the entire music expression would belong to the @code{CueVoice}
1349 @lilypond[verbatim,quote]
1350 oboeNotes = \relative {
1351 r2 r8 d''16(\f f e g f a)
1354 \addQuote "oboe" { \oboeNotes }
1356 \new Voice \relative c'' {
1357 \set Score.quotedCueEventTypes = #'(note-event rest-event tie-event
1358 beam-event tuplet-span-event
1359 dynamic-event slur-event)
1360 \cueDuring #"oboe" #UP { R1 }
1365 Markup can be used to show the name of the quoted instrument.
1366 If the cue notes require a change in clef,
1367 this can be done manually but the original clef should also be
1368 restored manually at the end of the cue notes.
1370 @lilypond[verbatim,quote]
1371 fluteNotes = \relative {
1372 r2. c''4 d8 c d e fis2 g2 d2
1375 bassoonNotes = \relative c {
1379 <>^\markup \tiny { flute }
1380 \cueDuring #"flute" #UP { R1 }
1385 \addQuote "flute" { \fluteNotes }
1392 Alternatively, the @code{\cueDuringWithClef} function can be used
1393 instead. This command takes an extra argument to specify the change of
1394 clef that needs to be printed for the cue notes but will automatically
1395 print the original clef once the cue notes have finished.
1397 @lilypond[verbatim,quote]
1398 fluteNotes = \relative {
1399 r2. c''4 d8 c d e fis2 g2 d2
1402 bassoonNotes = \relative c {
1405 <>^\markup { \tiny "flute" }
1406 \cueDuringWithClef #"flute" #UP #"treble" { R1 }
1410 \addQuote "flute" { \fluteNotes }
1417 @funindex \transposedCueDuring
1418 @funindex transposedCueDuring
1420 Like @code{\quoteDuring}, @code{\cueDuring} takes instrument
1421 transpositions into account. Cue notes are produced at the
1422 pitches that would be written for the instrument receiving the cue
1423 to produce the sounding pitches of the source instrument.
1425 To transpose cue notes differently, use
1426 @code{\transposedCueDuring}. This command takes an extra argument
1427 to specify (in absolute mode) the printed pitch that you want to
1428 represent the sound of a concert middle C. This is useful for
1429 taking cues from an instrument in a completely different register.
1431 @lilypond[verbatim,quote]
1432 piccoloNotes = \relative {
1439 bassClarinetNotes = \relative c' {
1443 \transposedCueDuring #"piccolo" #UP d { R1 }
1447 \addQuote "piccolo" { \piccoloNotes }
1450 \new Staff \piccoloNotes
1451 \new Staff \bassClarinetNotes
1455 @cindex removing cue notes
1456 @cindex cue notes, removing
1461 The @code{\killCues} command removes cue notes from a music
1462 expression, so the same music expression can be used to produce
1463 the instrument part with cues and the score. The @code{\killCues}
1464 command removes only the notes and events that were quoted by
1465 @code{\cueDuring}. Other markup associated with cues, such as clef
1466 changes and a label identifying the source instrument, can be
1467 tagged for selective inclusion in the score; see @ref{Using tags}.
1469 @lilypond[verbatim,quote]
1470 fluteNotes = \relative {
1471 r2. c''4 d8 c d e fis2 g2 d2
1474 bassoonNotes = \relative c {
1479 <>^\markup \tiny { flute }
1481 \cueDuring #"flute" #UP { R1 }
1482 \tag #'part \clef bass
1486 \addQuote "flute" { \fluteNotes }
1497 \removeWithTag #'part { \killCues { \bassoonNotes } }
1502 Alternatively, Clef changes and instrument labels can be
1503 collected into an instrument definition for repeated use, using
1504 @code{\addInstrumentDefinition} described in @ref{Instrument names}.
1508 @ref{Quoting other voices},
1509 @ref{Instrument transpositions},
1510 @ref{Instrument names},
1516 @rlsr{Staff notation}.
1518 Internals Reference:
1519 @rinternals{CueVoice},
1523 Collisions can occur with rests, when using @code{\cueDuring},
1524 between @code{Voice} and @code{CueVoice} contexts. When using
1525 @code{\cueDuringWithClef} or @code{\transposedCueDuring} the extra
1526 argument required for each case must come after the quote and the