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
63 @funindex RhythmicStaff
65 @funindex MensuralStaff
66 @funindex VaticanaStaff
67 @funindex GregorianTranscriptionStaff
69 @notation{Staves} (singular: @notation{staff}) are created with
70 the @code{\new} or @code{\context} commands. For details, see
71 @ref{Creating and referencing contexts}.
73 The basic staff context is @code{Staff}:
75 @lilypond[verbatim,quote]
76 \new Staff \relative { c''4 d e f }
79 The @code{DrumStaff} context creates a five-line staff set up for
80 a typical drum set. Each instrument is shown with a different
81 symbol. The instruments are entered in drum mode following a
82 @code{\drummode} command, with each instrument specified by name.
83 For details, see @ref{Percussion staves}.
85 @lilypond[verbatim,quote]
87 \drummode { cymc hh ss tomh }
91 @code{RhythmicStaff} creates a single-line staff that only
92 displays the rhythmic values of the input. Real durations are
93 preserved. For details, see @ref{Showing melody rhythms}.
95 @lilypond[verbatim,quote]
96 \new RhythmicStaff { c4 d e f }
99 @code{TabStaff} creates a tablature with six strings in standard
100 guitar tuning. For details, see @ref{Default tablatures}.
102 @lilypond[verbatim,quote]
103 \new TabStaff \relative { c''4 d e f }
106 There are two staff contexts specific for the notation of ancient
107 music: @code{MensuralStaff} and @code{VaticanaStaff}. They are
108 described in @ref{Pre-defined contexts}.
110 The @code{GregorianTranscriptionStaff} context creates a staff to
111 notate modern Gregorian chant. It does not show bar lines.
113 @lilypond[verbatim,quote]
114 \new GregorianTranscriptionStaff \relative { c''4 d e f e d }
117 New single staff contexts may be defined. For details, see
118 @ref{Defining new contexts}.
126 @ref{Creating and referencing 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]
178 \new Staff \relative { c''1 c }
179 \new Staff \relative { c''1 c }
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]
188 \new Staff \relative { c''1 c }
189 \new Staff \relative { c''1 c }
193 In a @code{ChoirStaff}, the group starts with a bracket, but bar
194 lines are not connected.
196 @lilypond[verbatim,quote]
198 \new Staff \relative { c''1 c }
199 \new Staff \relative { c''1 c }
203 In a @code{GrandStaff}, the group begins with a brace, and bar
204 lines are connected between the staves.
206 @lilypond[verbatim,quote]
208 \new Staff \relative { c''1 c }
209 \new Staff \relative { c''1 c }
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]
219 \set PianoStaff.instrumentName = #"Piano"
220 \new Staff \relative { c''1 c }
221 \new Staff \relative { \clef bass c1 c }
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,quote,texidoc,doctitle]
239 {use-square-bracket-at-the-start-of-a-staff-group.ly}
241 @lilypondfile[verbatim,quote,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,quote,texidoc,doctitle]
250 {mensurstriche-layout-bar-lines-between-the-staves.ly}
259 @ref{Instrument names},
260 @ref{Defining new contexts}.
263 @rlsr{Staff notation}.
267 @rinternals{StaffGroup},
268 @rinternals{ChoirStaff},
269 @rinternals{GrandStaff},
270 @rinternals{PianoStaff},
271 @rinternals{SystemStartBar},
272 @rinternals{SystemStartBrace},
273 @rinternals{SystemStartBracket},
274 @rinternals{SystemStartSquare}.
277 @node Nested staff groups
278 @unnumberedsubsubsec Nested staff groups
280 @cindex staff, nested
281 @cindex staves, nested
282 @cindex nesting of staves
283 @cindex system start delimiters, nested
284 @cindex nested staff brackets
285 @cindex brackets, nesting of
286 @cindex braces, nesting of
288 Staff-group contexts can be nested to arbitrary depths. In this
289 case, each child context creates a new bracket adjacent to the
290 bracket of its parent group.
292 @lilypond[verbatim,quote]
294 \new Staff \relative { c''2 c | c2 c }
296 \new Staff \relative { g'2 g | g2 g }
297 \new StaffGroup \with {
298 systemStartDelimiter = #'SystemStartSquare
301 \new Staff \relative { e'2 e | e2 e }
302 \new Staff \relative { c'2 c | c2 c }
308 New nested staff group contexts can be defined. For details, see
309 @ref{Defining new contexts}.
314 @lilypondfile[verbatim,quote,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 Separating systems
336 @unnumberedsubsubsec Separating systems
338 @cindex system separator mark
340 If the number of systems per page changes from page to page it is
341 customary to separate the systems by placing a system separator mark
342 between them. By default the system separator is blank, but can be
343 turned on with a @code{\paper} option.
345 @c \book is required here to display the system separator
346 @c ragged-right is required as there are two systems
347 @lilypond[verbatim,quote,ragged-right]
368 system-separator-markup = \slashSeparator
369 % following commands are needed only to format this documentation
371 paper-height = 100\mm
382 @rlsr{Staff notation}.
385 @node Modifying single staves
386 @subsection Modifying single staves
388 This section explains how to change specific attributes of one
389 staff: for example, modifying the number of staff lines or the
390 staff size. Methods to start and stop staves and set ossia
391 sections are also described.
401 @unnumberedsubsubsec Staff symbol
404 @cindex staff lines, stopping and starting
405 @cindex staff lines, modifying
407 @cindex ledger lines, internal
408 @cindex ledger lines, modifying
410 @funindex \startStaff
413 The @code{\stopStaff} and @code{\startStaff} commands can be used to
414 stop or (re)start the staff lines respectively, from being printed at
415 any point witin a score.
417 @lilypond[verbatim,quote]
419 \stopStaff f''4 d \startStaff g, e
420 f'4 d \stopStaff g, e
421 f'4 d \startStaff g, e
430 The lines of a staff belong to the @code{StaffSymbol} grob (including
431 ledger lines) and can be modified using @code{StaffSymbol} properties, but
432 these modifications must be made before the staff is (re)started.
434 The number of staff lines can be altered:
436 @lilypond[verbatim,quote]
439 \override Staff.StaffSymbol.line-count = #2
443 \revert Staff.StaffSymbol.line-count
448 The position of each staff line can also be altered. A list of
449 numbers sets each line's position. @code{0}@tie{}corresponds to the normal
450 center line, and the normal line positions are
451 @code{(-4@tie{}-2@tie{}0@tie{}2@tie{}4)}. A single staff line is
452 printed for every value entered so that the number of staff lines, as
453 well as their position, can be changed with a single override.
455 @lilypond[verbatim,quote]
458 \override Staff.StaffSymbol.line-positions = #'(1 3 5 -1 -3)
461 \override Staff.StaffSymbol.line-positions = #'(8 6.5 -6 -8 -0.5)
466 To preserve typical stem directions (in the bottom half of the staff
467 stems point up, in the top half they point down), align the center
468 line (or space) of the customized staff with the position of the
469 normal center line (0). The clef position and the position of
470 middle@tie{}C may need to be adjusted accordingly to fit the new
471 lines. See @ref{Clef}.
473 Staff line thickness can be altered. Ledger lines and note stems, by
474 default, are also affected.
476 @lilypond[verbatim,quote]
478 \override StaffSymbol.thickness = #3
484 It is also possible to set ledger line thickness independently of staff
487 @lilypond[verbatim,quote]
489 \override StaffSymbol.thickness = #2
490 \override StaffSymbol.ledger-line-thickness = #'(0.5 . 0.4)
497 The first value is multiplied by the staff line thickness, the second by
498 the staff space and then the two values are added together to give the
499 new thickness of the ledger line.
501 The vertical positions of ledger lines can be altered,
503 @lilypond[verbatim,quote]
505 \override StaffSymbol.ledger-positions = #'(-3 -2 -1 2 5 6)
511 Additional ledger lines can be made to appear above or below note heads
512 depending on the current position relative to other note heads that
513 also have their own ledger lines.
515 @lilypond[verbatim,quote]
517 \override StaffSymbol.ledger-extra = #4
523 Ledger lines can also be made to appear inside the staff where custom
524 staff lines are required. The example shows the default position of
525 ledger lines when the explicit @code{ledger-position} is and is not set.
526 The @code{\stopStaff} is needed in the example to revert the
527 @code{\override} for the whole @code{StaffSymbol}.
529 @lilypond[verbatim,quote]
531 \override Staff.StaffSymbol.line-positions = #'(-8 0 2 4)
535 \override Staff.StaffSymbol.ledger-positions = #'(-8 -6 (-4 -2) 0)
540 The distance between staff lines can be altered. This affects ledger
541 line spacing as well.
543 @lilypond[verbatim,quote]
545 \override StaffSymbol.staff-space = #1.5
552 @lilypondfile[verbatim,quote,texidoc,doctitle]
553 {making-some-staff-lines-thicker-than-the-others.ly}
565 @rlsr{Staff notation}.
568 @rinternals{StaffSymbol},
569 @rinternals{staff-symbol-interface}.
573 @unnumberedsubsubsec Ossia staves
575 @cindex staff, Frenched
577 @cindex Frenched staves
578 @cindex staff, resizing of
579 @cindex resizing of staves
581 @funindex \startStaff
584 @notation{Ossia} staves can be set by creating a new simultaneous
585 staff in the appropriate location:
587 @lilypond[verbatim,quote]
588 \new Staff \relative {
592 \new Staff { e4 d f e }
599 However, the above example is not what is usually desired. To
600 create ossia staves that are above the original staff, have no
601 time signature or clef, and have a smaller font size, tweaks must
602 be used. The Learning Manual describes a specific technique to
603 achieve this goal, beginning with
604 @rlearning{Nesting music expressions}.
606 The following example uses the @code{alignAboveContext} property
607 to align the ossia staff. This method is most appropriate when
608 only a few ossia staves are needed.
610 @lilypond[verbatim,quote]
611 \new Staff = "main" \relative {
617 \remove "Time_signature_engraver"
618 alignAboveContext = #"main"
628 If many isolated ossia staves are needed, creating an empty
629 @code{Staff} context with a specific @emph{context id} may be more
630 appropriate; the ossia staves may then be created by
631 @emph{calling} this context and using @code{\startStaff} and
632 @code{\stopStaff} at the desired locations. The benefits of this
633 method are more apparent if the piece is longer than the following
636 @lilypond[verbatim,quote,ragged-right]
638 \new Staff = "ossia" \with {
639 \remove "Time_signature_engraver"
645 \new Staff \relative {
649 \context Staff = "ossia" {
650 \startStaff e4 g8 f e2 \stopStaff
657 \context Staff = "ossia" {
658 \startStaff g4 e8 f g2 \stopStaff
667 Using the @code{\RemoveAllEmptyStaves} command to create ossia
668 staves may be used as an alternative. This method is most
669 convenient when ossia staves occur immediately following a line
670 break. For more information about
671 @code{\RemoveAllEmptyStaves}, see @ref{Hiding staves}.
673 @lilypond[verbatim,quote,ragged-right]
675 \new Staff = "ossia" \with {
676 \remove "Time_signature_engraver"
679 \RemoveAllEmptyStaves
684 \new Staff \relative {
698 @lilypondfile[verbatim,quote,texidoc,doctitle]
699 {vertically-aligning-ossias-and-lyrics.ly}
705 @rglos{Frenched staff}.
708 @rlearning{Nesting music expressions},
709 @rlearning{Size of objects},
710 @rlearning{Length and thickness of objects}.
716 @rlsr{Staff notation}.
719 @rinternals{StaffSymbol}.
723 @unnumberedsubsubsec Hiding staves
725 @cindex Frenched score
726 @cindex Frenched staff
727 @cindex staff, hiding
729 @cindex hiding staves
730 @cindex hiding ancient staves
731 @cindex hiding rhythmic staves
732 @cindex hiding vaticana staves
735 @funindex \RemoveEmptyStaves
736 @funindex \RemoveAllEmptyStaves
737 @funindex Staff_symbol_engraver
741 Staff lines can be hidden by removing the
742 @code{Staff_symbol_engraver} from the @code{Staff} context. As an
743 alternative, @code{\stopStaff} may be used.
745 @lilypond[verbatim,quote]
747 \remove "Staff_symbol_engraver"
749 \relative { a''8 f e16 d c b a2 }
753 Empty staves can be hidden (for a so-called @q{Frenched Score})
754 by applying the @code{\RemoveEmptyStaves} command on a context, which
755 can be done globally (in a @code{\layout} block) as well as for
756 specific staves only (in a @code{\with} block). This command removes
757 all empty staves in a score except for those in the first system. If
758 you want those in the first system to be hidden also, use
759 @code{\RemoveAllEmptyStaves}. Supported contexts are @code{Staff},
760 @code{RhythmicStaff} and @code{VaticanaStaff}.
762 @warning{A staff is considered empty when it contains only
763 multi-measure rests, rests, skips, spacer rests, or a combination of these
766 @lilypond[verbatim,quote,ragged-right]
791 @code{\RemoveAllEmptyStaves} can also be used to create ossia
792 sections for a staff. For details, see @ref{Ossia staves}.
796 @code{\RemoveEmptyStaves},
797 @code{\RemoveAllEmptyStaves}.
802 @rglos{Frenched staff}.
805 @rlearning{Visibility and color of objects}.
808 @ref{Changing context default settings},
812 @ref{Invisible rests},
813 @ref{Visibility of objects}.
816 @rlsr{Staff notation}.
819 @rinternals{ChordNames},
820 @rinternals{FiguredBass},
823 @rinternals{VerticalAxisGroup},
824 @rinternals{Staff_symbol_engraver}.
827 Removing @code{Staff_symbol_engraver} also hides bar lines. If
828 bar line visibility is forced, formatting errors may occur. In
829 this case, use the following overrides instead of removing the
834 \override NoteHead.no-ledgers = ##t
837 For the Known issues and warnings associated with
838 @code{\Staff \RemoveEmptyStaves} see
839 @ref{Changing context default settings}.
843 @subsection Writing parts
845 This section explains how to insert tempo indications and
846 instrument names into a score. Methods to quote other voices and
847 format cue notes are also described.
851 * Quoting other voices::
852 * Formatting cue notes::
855 @node Instrument names
856 @unnumberedsubsubsec Instrument names
858 @cindex instrument names
859 @cindex instrument names, short
861 Instrument names can be printed on the left side of staves in the
862 @code{Staff}, @code{PianoStaff}, @code{StaffGroup}, @code{GrandStaff}
863 and @code{ChoirStaff} contexts. The value of
864 @code{instrumentName} is used for the first staff, and the value
865 of @code{shortInstrumentName} is used for all succeeding staves.
867 @lilypond[verbatim,quote,ragged-right]
869 instrumentName = #"Violin "
870 shortInstrumentName = #"Vln. "
872 c'4.. g'16 c4.. g'16 \break | c1 |
876 @cindex instrument names, complex
878 @code{\markup} can be used to create more complex instrument names:
880 @lilypond[verbatim,quote]
882 instrumentName = \markup {
883 \column { "Clarinetti"
884 \line { "in B" \smaller \flat }
892 @cindex instrument names, centering
894 When two or more staff contexts are grouped together, the instrument
895 names and short instrument names are centered by default. To center
896 multi-line instrument names, @code{\center-column} must be used:
898 @lilypond[verbatim,quote,indent=1.5\cm]
901 instrumentName = #"Flute"
906 instrumentName = \markup {
907 \center-column { "Clarinet"
908 \line { "in B" \smaller \flat }
911 } \relative { c''4 b c2 }
916 @funindex short-indent
918 However, if the instrument names are longer, the instrument names in a
919 staff group may not be centered unless the @code{indent} and
920 @code{short-indent} settings are increased. For details about these
921 settings, see @ref{paper variables for shifts and indents,,@code{@bs{}paper} variables for shifts and indents}.
923 @lilypond[verbatim,quote,ragged-right]
926 instrumentName = #"Alto Flute in G"
927 shortInstrumentName = #"Flt."
933 instrumentName = #"Clarinet"
934 shortInstrumentName = #"Clar."
943 short-indent = 1.5\cm
947 @cindex instrument names, adding to other contexts
949 To add instrument names to other contexts (such as @code{ChordNames} or
950 @code{FiguredBass}), @code{Instrument_name_engraver} must be added to
951 that context. For details, see @ref{Modifying context plug-ins}.
953 @cindex instrument names, changing
954 @cindex changing instrument names
956 The @code{shortInstrumentName} may be changed in the middle of a piece,
957 along with other settings as needed for the new instrument.
958 However, only the first instance of @code{instrumentName} will be
959 printed and subsequent changes will be ignored:
961 @lilypond[verbatim,quote,ragged-right]
962 prepPiccolo = <>^\markup \italic { muta in Piccolo }
965 \set Staff.instrumentName = #"Piccolo"
966 \set Staff.shortInstrumentName = #"Picc."
967 \set Staff.midiInstrument = #"piccolo"
968 <>^\markup \bold { Piccolo }
972 prepFlute = <>^\markup \italic { muta in Flauto }
975 \set Staff.instrumentName = #"Flute"
976 \set Staff.shortInstrumentName = #"Flt."
977 \set Staff.midiInstrument = #"flute"
978 <>^\markup \bold { Flute }
983 instrumentName = #"Flute"
984 shortInstrumentName = #"Flt."
985 midiInstrument = #"flute"
989 g1 g \prepPiccolo R R \break
992 g1 g \prepFlute R R \break
1001 @ref{paper variables for shifts and indents,,@code{@bs{}paper} variables for shifts and indents},
1002 @ref{Modifying context plug-ins}.
1005 @rlsr{Staff notation}.
1007 Internals Reference:
1008 @rinternals{InstrumentName},
1009 @rinternals{PianoStaff},
1013 @node Quoting other voices
1014 @unnumberedsubsubsec Quoting other voices
1016 @cindex quote, voices
1017 @cindex voices, quoting
1018 @cindex fragments, quoting
1022 @funindex \quoteDuring
1023 @funindex \transposition
1025 It is very common for one voice to use the same notes as those from
1026 another voice. For example, first and second violins playing the same
1027 phrase during a particular passage of the music. This is done by
1028 letting one voice @emph{quote} the other, without having to re-enter the
1029 music all over again for the second voice.
1031 The @code{\addQuote} command, used in the top level scope, defines a
1032 stream of music from which fragments can be quoted.
1034 The @code{\quoteDuring} command is used to indicate the point where the
1035 quotation begins. It is followed by two arguments: the name of the
1036 quoted voice, as defined with @code{\addQuote}, and a music expression
1037 for the duration of the quote.
1039 @lilypond[verbatim,quote]
1040 fluteNotes = \relative {
1041 a'4 gis g gis | b4^"quoted" r8 ais\p a4( f)
1044 oboeNotes = \relative {
1045 c''4 cis c b \quoteDuring #"flute" { s1 }
1048 \addQuote "flute" { \fluteNotes }
1052 \new Staff \with { instrumentName = "Flute" } \fluteNotes
1053 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1058 If the music expression used in @code{\quoteDuring} contains notes
1059 instead of spacer or multimeasure rests then the quote will appear as
1060 polyphony and may produce unexpected results.
1062 @lilypond[verbatim,quote]
1063 fluteNotes = \relative {
1064 a'4 gis g gis | b4^"quoted" r8 ais\p a4( f)
1067 oboeNotes = \relative {
1068 c''4 cis c b \quoteDuring #"flute" { e4 r8 ais b4 a }
1071 \addQuote "flute" { \fluteNotes }
1075 \new Staff \with { instrumentName = "Flute" } \fluteNotes
1076 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1081 If an @code{\unfoldRepeat} command in a music expression is required to
1082 be printed when using @code{\quoteDuring}, then it too must also contain
1083 its own @code{\unfoldRepeat} command;
1085 @lilypond[verbatim,quote]
1086 fluteNotes = \relative {
1087 \repeat volta 2 { a'4 gis g gis }
1090 oboeNotesDW = \relative {
1091 \repeat volta 2 \quoteDuring #"incorrect" { s1 }
1094 oboeNotesW = \relative {
1095 \repeat volta 2 \quoteDuring #"correct" { s1 }
1099 \addQuote "incorrect" { \fluteNotes }
1101 \addQuote "correct" { \unfoldRepeats \fluteNotes }
1106 \new Staff \with { instrumentName = "Flute" }
1108 \new Staff \with { instrumentName = "Oboe (incorrect)" }
1110 \new Staff \with { instrumentName = "Oboe (correct)" }
1116 The @code{\quoteDuring} command uses the @code{\transposition} settings
1117 of both quoted and quoting parts to produce notes for the quoting part
1118 that have the same sounding pitch as those in the quoted part.
1120 @lilypond[verbatim,quote]
1121 clarinetNotes = \relative c'' {
1124 b4 ais a ais | cis4^"quoted" r8 bis\p b4( f)
1127 oboeNotes = \relative {
1128 c''4 cis c b \quoteDuring #"clarinet" { s1 }
1131 \addQuote "clarinet" { \clarinetNotes }
1136 \new Staff \with { instrumentName = "Clarinet" } \clarinetNotes
1137 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1143 @cindex articulation-event
1144 @cindex dynamic-event
1147 @cindex crescendo-event
1149 @funindex quotedEventTypes
1150 @funindex quotedCueEventTypes
1152 By default quoted music will include all articulations, dynamics,
1153 markups, etc., in the quoted expression. It is possible to choose which
1154 of these objects from the quoted music are displayed by using the
1155 @code{quotedEventTypes} context property.
1157 @lilypond[verbatim,quote]
1158 fluteNotes = \relative {
1160 b4\<^"quoted" r8 ais a4\f( c->)
1163 oboeNotes = \relative {
1165 \quoteDuring #"flute" { s1 }
1168 \addQuote "flute" { \fluteNotes }
1172 \set Score.quotedEventTypes = #'(note-event articulation-event
1173 crescendo-event rest-event
1174 slur-event dynamic-event)
1175 \new Staff \with { instrumentName = "Flute" } \fluteNotes
1176 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1181 Quotes can also be tagged, see @ref{Using tags}.
1185 @ref{Instrument transpositions},
1189 @file{scm/define-event-classes.scm}.
1192 @rlsr{Staff notation}.
1194 Internals Reference:
1195 @rinternals{Music classes},
1196 @rinternals{QuoteMusic},
1200 Only the contents of the first @code{Voice} occurring in an
1201 @code{\addQuote} command will be considered for quotation, so if the music
1202 expression contains @code{\new} or @code{\context Voice}
1203 statements, their contents will not be quoted. Quoting grace notes
1204 is unsupported and may cause LilyPond to crash whereas quoting nested
1205 triplets may result in poor notation.
1208 @node Formatting cue notes
1209 @unnumberedsubsubsec Formatting cue notes
1213 @cindex cue notes, formatting
1214 @cindex formatting, cue notes
1215 @cindex voices, quoting
1218 @funindex \cueDuring
1220 @funindex \cueDuringWithClef
1221 @funindex \quoteDuring
1223 @cindex notes, smaller
1224 @cindex smaller notes
1227 The simplest way to format cue notes is to explicitly create a
1228 @code{CueVoice} context within the part.
1236 \stemUp d'8^"flute" c d e fis2
1243 The @code{\cueClef} command can also be used with an explict
1244 @code{CueVoice} context if a change of clef is required and will print
1245 an appropriately sized clef for the cue notes. The @code{\cueClefUnset}
1246 command can then be used to switch back to the original clef, again with
1247 an appropriately sized clef.
1249 @lilypond[verbatim,noragged-right]
1254 { e'2\rest r4. \cueClefUnset e,8 }
1256 \cueClef "treble" \stemUp d''8^"flute" c d e fis2
1263 The @code{\cueClef} and @code{\cueClefUnset} command can also be used
1264 without a @code{CueVoice} if required.
1266 @lilypond[verbatim,noragged-right]
1271 d''8^"flute" c d e fis2
1277 For more complex cue note placement, e.g including transposition, or
1278 inserting cue notes from multiple music sources the @code{\cueDuring} or
1279 @code{\cueDuringWithClef} commands can be used. These are more
1280 specialized form of @code{\quoteDuring}, see @ref{Quoting other voices}
1281 in the previous section.
1286 \cueDuring #@var{quotename} #@var{direction} #@var{music}
1292 \cueDuringWithClef #@var{quotename} #@var{direction} #@var{clef} #@var{music}
1295 The music from the corresponding measures of the @code{@var{quote name}}
1296 is added as a @code{CueVoice} context and occurs simultaneously with the
1297 @code{@var{music}}, which then creates a polyphonic situation. The
1298 @code{@var{direction}} takes the argument @code{UP} or @code{DOWN}, and
1299 corresponds to the first and second voices respectively, determining how
1300 the cue notes are printed in relation to the other voice.
1302 @lilypond[verbatim,quote]
1303 fluteNotes = \relative {
1304 r2. c''4 | d8 c d e fis2 | g2 d |
1307 oboeNotes = \relative c'' {
1309 <>^\markup \tiny { flute }
1310 \cueDuring #"flute" #UP { R1 }
1314 \addQuote "flute" { \fluteNotes }
1324 It is possible to adjust which aspects of the music are quoted with
1325 @code{\cueDuring} by setting the @code{quotedCueEventTypes}
1326 property. Its default value is @code{'(note-event rest-event
1327 tie-event beam-event tuplet-span-event)}, which means that only
1328 notes, rests, ties, beams and tuplets are quoted, but not
1329 articulations, dynamic marks, markup etc.
1331 @warning{When a @code{Voice} starts with @code{\cueDuring}, as in the
1332 following example, the @code{Voice} context must be explicitly declared,
1333 or else the entire music expression would belong to the @code{CueVoice}
1336 @lilypond[verbatim,quote]
1337 oboeNotes = \relative {
1338 r2 r8 d''16(\f f e g f a)
1341 \addQuote "oboe" { \oboeNotes }
1343 \new Voice \relative c'' {
1344 \set Score.quotedCueEventTypes = #'(note-event rest-event tie-event
1345 beam-event tuplet-span-event
1346 dynamic-event slur-event)
1347 \cueDuring #"oboe" #UP { R1 }
1352 Markup can be used to show the name of the quoted instrument.
1353 If the cue notes require a change in clef,
1354 this can be done manually but the original clef should also be
1355 restored manually at the end of the cue notes.
1357 @lilypond[verbatim,quote]
1358 fluteNotes = \relative {
1359 r2. c''4 d8 c d e fis2 g2 d2
1362 bassoonNotes = \relative c {
1366 <>^\markup \tiny { flute }
1367 \cueDuring #"flute" #UP { R1 }
1372 \addQuote "flute" { \fluteNotes }
1379 Alternatively, the @code{\cueDuringWithClef} function can be used
1380 instead. This command takes an extra argument to specify the change of
1381 clef that needs to be printed for the cue notes but will automatically
1382 print the original clef once the cue notes have finished.
1384 @lilypond[verbatim,quote]
1385 fluteNotes = \relative {
1386 r2. c''4 d8 c d e fis2 g2 d2
1389 bassoonNotes = \relative c {
1392 <>^\markup { \tiny "flute" }
1393 \cueDuringWithClef #"flute" #UP #"treble" { R1 }
1397 \addQuote "flute" { \fluteNotes }
1404 @funindex \transposedCueDuring
1406 Like @code{\quoteDuring}, @code{\cueDuring} takes instrument
1407 transpositions into account. Cue notes are produced at the
1408 pitches that would be written for the instrument receiving the cue
1409 to produce the sounding pitches of the source instrument.
1411 To transpose cue notes differently, use
1412 @code{\transposedCueDuring}. This command takes an extra argument
1413 to specify (in absolute mode) the printed pitch that you want to
1414 represent the sound of a concert middle C. This is useful for
1415 taking cues from an instrument in a completely different register.
1417 @lilypond[verbatim,quote]
1418 piccoloNotes = \relative {
1425 bassClarinetNotes = \relative c' {
1429 \transposedCueDuring #"piccolo" #UP d { R1 }
1433 \addQuote "piccolo" { \piccoloNotes }
1436 \new Staff \piccoloNotes
1437 \new Staff \bassClarinetNotes
1441 @cindex removing cue notes
1442 @cindex cue notes, removing
1446 The @code{\killCues} command removes cue notes from a music
1447 expression, so the same music expression can be used to produce
1448 the instrument part with cues and the score. The @code{\killCues}
1449 command removes only the notes and events that were quoted by
1450 @code{\cueDuring}. Other markup associated with cues, such as clef
1451 changes and a label identifying the source instrument, can be
1452 tagged for selective inclusion in the score; see @ref{Using tags}.
1454 @lilypond[verbatim,quote]
1455 fluteNotes = \relative {
1456 r2. c''4 d8 c d e fis2 g2 d2
1459 bassoonNotes = \relative c {
1464 <>^\markup \tiny { flute }
1466 \cueDuring #"flute" #UP { R1 }
1467 \tag #'part \clef bass
1471 \addQuote "flute" { \fluteNotes }
1482 \removeWithTag #'part { \killCues { \bassoonNotes } }
1487 Alternatively, Clef changes and instrument labels can be
1488 collected into an instrument definition for repeated use, using
1489 @code{\addInstrumentDefinition} described in @ref{Instrument names}.
1493 @ref{Quoting other voices},
1494 @ref{Instrument transpositions},
1495 @ref{Instrument names},
1501 @rlsr{Staff notation}.
1503 Internals Reference:
1504 @rinternals{CueVoice},
1508 Collisions can occur with rests, when using @code{\cueDuring},
1509 between @code{Voice} and @code{CueVoice} contexts. When using
1510 @code{\cueDuringWithClef} or @code{\transposedCueDuring} the extra
1511 argument required for each case must come after the quote and the