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}.
125 @ref{Creating contexts},
126 @ref{Percussion staves},
127 @ref{Showing melody rhythms},
128 @ref{Default tablatures},
129 @ref{Pre-defined contexts},
131 @ref{Gregorian chant contexts},
132 @ref{Mensural contexts},
133 @ref{Defining new contexts}.
136 @rlsr{Staff notation}.
140 @rinternals{DrumStaff},
141 @rinternals{GregorianTranscriptionStaff},
142 @rinternals{RhythmicStaff},
143 @rinternals{TabStaff},
144 @rinternals{MensuralStaff},
145 @rinternals{VaticanaStaff},
146 @rinternals{StaffSymbol}.
149 @node Grouping staves
150 @unnumberedsubsubsec Grouping staves
152 @cindex start of system
153 @cindex staff, multiple
154 @cindex staves, multiple
155 @cindex system start delimiters
156 @cindex bracket, vertical
157 @cindex brace, vertical
167 Various contexts exist to group single staves together in order to
168 form multi-stave systems. Each grouping context sets the style of
169 the system start delimiter and the behavior of bar lines.
171 If no context is specified, the default properties will be used:
172 the group is started with a vertical line, and the bar lines are
175 @lilypond[verbatim,quote,relative=2]
182 In the @code{StaffGroup} context, the group is started with a
183 bracket and bar lines are drawn through all the staves.
185 @lilypond[verbatim,quote,relative=2]
192 In a @code{ChoirStaff}, the group starts with a bracket, but bar
193 lines are not connected.
195 @lilypond[verbatim,quote,relative=2]
202 In a @code{GrandStaff}, the group begins with a brace, and bar
203 lines are connected between the staves.
205 @lilypond[verbatim,quote,relative=2]
212 The @code{PianoStaff} is identical to a @code{GrandStaff}, except
213 that it supports printing the instrument name directly. For
214 details, see @ref{Instrument names}.
216 @lilypond[verbatim,quote,relative=2]
218 \set PianoStaff.instrumentName = #"Piano"
224 Each staff group context sets the property
225 @code{systemStartDelimiter} to one of the following values:
226 @code{SystemStartBar}, @code{SystemStartBrace}, or
227 @code{SystemStartBracket}. A fourth delimiter,
228 @code{SystemStartSquare}, is also available, but it must be
229 explicitly specified.
231 New staff group contexts may be defined. For details, see
232 @ref{Defining new contexts}.
237 @lilypondfile[verbatim,quote,texidoc,doctitle]
238 {use-square-bracket-at-the-start-of-a-staff-group.ly}
240 @lilypondfile[verbatim,quote,texidoc,doctitle]
241 {display-bracket-with-only-one-staff-in-a-system.ly}
243 @cindex mensurstriche layout
244 @cindex renaissance music
245 @cindex transcription of mensural music
246 @cindex mensural music, transcription of
248 @lilypondfile[verbatim,quote,texidoc,doctitle]
249 {mensurstriche-layout-bar-lines-between-the-staves.ly}
258 @ref{Instrument names},
259 @ref{Defining new contexts}.
262 @rlsr{Staff notation}.
266 @rinternals{StaffGroup},
267 @rinternals{ChoirStaff},
268 @rinternals{GrandStaff},
269 @rinternals{PianoStaff},
270 @rinternals{SystemStartBar},
271 @rinternals{SystemStartBrace},
272 @rinternals{SystemStartBracket},
273 @rinternals{SystemStartSquare}.
276 @code{PianoStaff} does not, by default, accept @code{ChordNames}.
279 @node Nested staff groups
280 @unnumberedsubsubsec Nested staff groups
282 @cindex staff, nested
283 @cindex staves, nested
284 @cindex nesting of staves
285 @cindex system start delimiters, nested
286 @cindex nested staff brackets
287 @cindex brackets, nesting of
288 @cindex braces, nesting of
290 Staff-group contexts can be nested to arbitrary depths. In this
291 case, each child context creates a new bracket adjacent to the
292 bracket of its parent group.
294 @lilypond[verbatim,quote,relative=2]
296 \new Staff { c2 c | c2 c }
298 \new Staff { g2 g | g2 g }
299 \new StaffGroup \with {
300 systemStartDelimiter = #'SystemStartSquare
303 \new Staff { e2 e | e2 e }
304 \new Staff { c2 c | c2 c }
310 New nested staff group contexts can be defined. For details, see
311 @ref{Defining new contexts}.
316 @lilypondfile[verbatim,quote,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}.
337 @node Separating systems
338 @unnumberedsubsubsec Separating systems
340 @cindex system separator mark
342 If the number of systems per page changes from page to page it is
343 customary to separate the systems by placing a system separator mark
344 between them. By default the system separator is blank, but can be
345 turned on with a @code{\paper} option.
347 @c \book is required here to display the system separator
348 @c ragged-right is required as there are two systems
349 @lilypond[verbatim,quote,ragged-right]
370 system-separator-markup = \slashSeparator
371 % following commands are needed only to format this documentation
373 paper-height = 100\mm
384 @rlsr{Staff notation}.
387 @node Modifying single staves
388 @subsection Modifying single staves
390 This section explains how to change specific attributes of one
391 staff: for example, modifying the number of staff lines or the
392 staff size. Methods to start and stop staves and set ossia
393 sections are also described.
403 @unnumberedsubsubsec Staff symbol
406 @cindex staff lines, stopping and starting
407 @cindex staff lines, modifying
409 @cindex ledger lines, internal
410 @cindex ledger lines, modifying
412 @funindex \startStaff
417 The @code{\stopStaff} and @code{\startStaff} commands can be used to
418 stop or (re)start the staff lines respectively, from being printed at
419 any point witin a score.
421 @lilypond[verbatim,quote,relative=2]
422 \stopStaff f4 d \startStaff g, e
423 f'4 d \stopStaff g, e
424 f'4 d \startStaff g, e
432 The lines of a staff belong to the @code{StaffSymbol} grob (including
433 ledger lines) can be modified using @code{StaffSymbol} properties, but
434 these modifications must be made before the staff is (re)started.
436 The number of staff lines can be altered,
438 @lilypond[verbatim,quote,relative=2]
440 \override Staff.StaffSymbol #'line-count = #2
444 \revert Staff.StaffSymbol #'line-count
448 The position of each the staff lines can also be altered. The values
449 used are @emph{half} staff line spaces and the new position is relative
450 to the normal center line. A single staff line is printed for every
451 value entered so that the number of staff lines, as well as their
452 position in the staff, can be changed with a single override.
454 @lilypond[verbatim,quote,relative=2]
456 \override Staff.StaffSymbol #'line-positions = #'(1 3 5 -1 -3)
459 \override Staff.StaffSymbol #'line-positions = #'(8 6.5 -6 -8 -0.5)
463 The clef position and the position of middle C may need to be adjusted
464 accordingly to fit the new lines. See @ref{Clef}.
466 Staff line thickness can be altered. Ledger lines and note stems, by
467 default, are also affected.
469 @lilypond[verbatim,quote,relative=2]
471 \override StaffSymbol #'thickness = #3
476 However, it is possible to set ledger line thickness independently of
477 staff lines. The two values required multiply the staff line thickness
478 with the staff line spacing and are then added together to give the
479 ledger line thickness.
481 @lilypond[verbatim,quote,relative=2]
483 \override StaffSymbol #'thickness = #2
484 \override StaffSymbol #'ledger-line-thickness = #'(0.5 . 0.4)
489 The vertical positions of ledger lines can be altered,
491 @lilypond[verbatim,quote,relative=2]
493 \override StaffSymbol #'ledger-positions = #'(-3 -2 -1 2 5 6)
498 Additional ledger lines can be made to appear above or below note heads
499 depending on the current position relative to other note heads that
500 also have their own ledger lines.
502 @lilypond[verbatim,quote,relative=2]
504 \override StaffSymbol #'ledger-extra = #4
509 Legder lines can also be made to appear inside the staff where custom
510 staff lines are required. The example shows the default position of
511 ledger lines when the explicit @code{legder-position} is and is not set.
512 The @code{stopStaff} is needed in the example to revert the
513 @code{\override} for the whole @code{StaffSymbol}.
515 @lilypond[fragment,quote,relative=1]
516 \override Staff.StaffSymbol #'line-positions = #'(-8 0 2 4)
520 \override Staff.StaffSymbol #'ledger-positions = #'(-8 -6 (-4 -2) 0)
524 The distance between staff lines can be altered. This affects ledger
525 line spacing as well.
527 @lilypond[verbatim,quote,relative=2]
529 \override StaffSymbol #'staff-space = #1.5
535 @lilypondfile[verbatim,quote,texidoc,doctitle]
536 {making-some-staff-lines-thicker-than-the-others.ly}
548 @rlsr{Staff notation}.
551 @rinternals{StaffSymbol},
552 @rinternals{staff-symbol-interface}.
556 @unnumberedsubsubsec Ossia staves
558 @cindex staff, Frenched
560 @cindex Frenched staves
561 @cindex staff, resizing of
562 @cindex resizing of staves
564 @funindex \startStaff
569 @notation{Ossia} staves can be set by creating a new simultaneous
570 staff in the appropriate location:
572 @lilypond[verbatim,quote]
573 \new Staff \relative c'' {
577 \new Staff { e4 d f e }
584 However, the above example is not what is usually desired. To
585 create ossia staves that are above the original staff, have no
586 time signature or clef, and have a smaller font size, tweaks must
587 be used. The Learning Manual describes a specific technique to
588 achieve this goal, beginning with
589 @rlearning{Nesting music expressions}.
591 The following example uses the @code{alignAboveContext} property
592 to align the ossia staff. This method is most appropriate when
593 only a few ossia staves are needed.
595 @lilypond[verbatim,quote]
596 \new Staff = main \relative c'' {
602 \remove "Time_signature_engraver"
603 alignAboveContext = #"main"
605 \override StaffSymbol #'staff-space = #(magstep -3)
606 \override StaffSymbol #'thickness = #(magstep -3)
615 If many isolated ossia staves are needed, creating an empty
616 @code{Staff} context with a specific @emph{context id} may be more
617 appropriate; the ossia staves may then be created by
618 @emph{calling} this context and using @code{\startStaff} and
619 @code{\stopStaff} at the desired locations. The benefits of this
620 method are more apparent if the piece is longer than the following
623 @lilypond[verbatim,quote,ragged-right]
625 \new Staff = ossia \with {
626 \remove "Time_signature_engraver"
627 \override Clef #'transparent = ##t
629 \override StaffSymbol #'staff-space = #(magstep -3)
630 \override StaffSymbol #'thickness = #(magstep -3)
634 \new Staff \relative c' {
638 \context Staff = ossia {
639 \startStaff e4 g8 f e2 \stopStaff
646 \context Staff = ossia {
647 \startStaff g4 e8 f g2 \stopStaff
656 Using the @code{\Staff \RemoveEmptyStaves} command to create ossia
657 staves may be used as an alternative. This method is most
658 convenient when ossia staves occur immediately following a line
659 break. For more information about
660 @code{\Staff \RemoveEmptyStaves}, see @ref{Hiding staves}.
662 @lilypond[verbatim,quote,ragged-right]
664 \new Staff = ossia \with {
665 \remove "Time_signature_engraver"
666 \override Clef #'transparent = ##t
668 \override StaffSymbol #'staff-space = #(magstep -3)
669 \override StaffSymbol #'thickness = #(magstep -3)
674 \new Staff \relative c' {
686 \Staff \RemoveEmptyStaves
687 \override VerticalAxisGroup #'remove-first = ##t
695 @lilypondfile[verbatim,quote,texidoc,doctitle]
696 {vertically-aligning-ossias-and-lyrics.ly}
702 @rglos{Frenched staff}.
705 @rlearning{Nesting music expressions},
706 @rlearning{Size of objects},
707 @rlearning{Length and thickness of objects}.
713 @rlsr{Staff notation}.
716 @rinternals{StaffSymbol}.
720 @unnumberedsubsubsec Hiding staves
722 @cindex Frenched score
723 @cindex Frenched staff
724 @cindex staff, hiding
726 @cindex hiding of staves
729 @funindex \RemoveEmptyStaves
730 @funindex Staff_symbol_engraver
735 Staff lines can be hidden by removing the
736 @code{Staff_symbol_engraver} from the @code{Staff} context. As an
737 alternative, @code{\stopStaff} may be used.
739 @lilypond[verbatim,quote]
741 \remove "Staff_symbol_engraver"
743 \relative c''' { a8 f e16 d c b a2 }
747 Empty staves can be hidden by setting the
748 @code{\Staff \RemoveEmptyStaves} command in the @code{\layout}
749 block. In orchestral scores, this style is known as @q{Frenched
750 Score}. By default, this command hides and removes all empty
751 staves in a score except for those in the first system.
753 @warning{A staff is considered empty when it contains only
754 multi-measure rests, rests, skips, spacer rests, or a combination of these
757 @lilypond[verbatim,quote,ragged-right]
760 \Staff \RemoveEmptyStaves
781 @code{\Staff \RemoveEmptyStaves} can also be used to create ossia
782 sections for a staff. For details, see @ref{Ossia staves}.
784 @cindex hiding ancient staves
785 @cindex hiding rhythmic staves
787 @funindex \RemoveEmptyStaves
789 The @code{\VaticanaStaff \RemoveEmptyStaves} command may be used to
790 hide empty staves in ancient music contexts. Similarly,
791 @code{\RhythmicStaff \RemoveEmptyStaves} may be used to hide empty
792 @code{RhythmicStaff} contexts.
796 @code{\Staff \RemoveEmptyStaves},
797 @code{\VaticanaStaff \RemoveEmptyStaves},
798 @code{\RhythmicStaff \RemoveEmptyStaves}.
804 @lilypondfile[verbatim,quote,texidoc,doctitle]
805 {removing-the-first-empty-line.ly}
809 @rglos{Frenched staff}.
812 @rlearning{Visibility and color of objects}.
815 @ref{Changing context default settings},
819 @ref{Invisible rests},
820 @ref{Visibility of objects}.
823 @rlsr{Staff notation}.
826 @rinternals{ChordNames},
827 @rinternals{FiguredBass},
830 @rinternals{VerticalAxisGroup},
831 @rinternals{Staff_symbol_engraver}.
834 Removing @code{Staff_symbol_engraver} also hides bar lines. If
835 bar line visibility is forced, formatting errors may occur. In
836 this case, use the following overrides instead of removing the
840 \override StaffSymbol #'stencil = ##f
841 \override NoteHead #'no-ledgers = ##t
844 For the Known issues and warnings associated with
845 @code{\Staff \RemoveEmptyStaves} see
846 @ref{Changing context default settings}.
850 @subsection Writing parts
852 This section explains how to insert tempo indications and
853 instrument names into a score. Methods to quote other voices and
854 format cue notes are also described.
858 * Quoting other voices::
859 * Formatting cue notes::
862 @node Instrument names
863 @unnumberedsubsubsec Instrument names
865 @cindex instrument names
866 @cindex instrument names, short
868 Instrument names can be printed on the left side of staves in the
869 @code{Staff}, @code{PianoStaff}, @code{StaffGroup}, @code{GrandStaff}
870 and @code{ChoirStaff} contexts. The value of
871 @code{instrumentName} is used for the first staff, and the value
872 of @code{shortInstrumentName} is used for all succeeding staves.
874 @lilypond[verbatim,quote,ragged-right,relative=1]
876 instrumentName = #"Violin "
877 shortInstrumentName = #"Vln. "
879 { c4.. 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,relative=2]
888 instrumentName = \markup {
889 \column { "Clarinetti"
890 \line { "in B" \smaller \flat }
897 @cindex instrument names, centering
899 When two or more staff contexts are grouped together, the instrument
900 names and short instrument names are centered by default. To center
901 multi-line instrument names, @code{\center-column} must be used:
903 @lilypond[verbatim,quote,indent=1.5\cm,relative=2]
906 instrumentName = #"Flute"
910 instrumentName = \markup {
911 \center-column { "Clarinet" }
912 \line { "in B" \smaller \flat }
920 @funindex short-indent
922 However, if the instrument names are longer, the instrument names in a
923 staff group may not be centered unless the @code{indent} and
924 @code{short-indent} settings are increased. For details about these
925 settings, see @ref{\paper variables for shifts and indents}.
927 @lilypond[verbatim,quote,ragged-right]
931 instrumentName = #"Alto Flute in G"
932 shortInstrumentName = #"Flt."
939 instrumentName = #"Clarinet"
940 shortInstrumentName = #"Clar."
951 short-indent = 1.5\cm
955 @cindex instrument names, adding to other contexts
957 To add instrument names to other contexts (such as @code{ChordNames} or
958 @code{FiguredBass}), @code{Instrument_name_engraver} must be added to
959 that context. For details, see @ref{Modifying context plug-ins}.
961 @cindex instrument names, changing
962 @cindex changing instrument names
964 The @code{shortInstrumentName} may be changed in the middle of a piece.
965 However, only the first instance of @code{instrumentName} will be
966 printed and subsequent changes will be ignored:
968 @lilypond[verbatim,quote,ragged-right,relative=1]
970 instrumentName = #"Flute"
971 shortInstrumentName = #"Flt."
976 \set Staff.instrumentName = #"Clarinet"
977 \set Staff.shortInstrumentName = #"Clt."
983 @cindex instrument switch
984 @cindex switching instruments
986 @funindex \addInstrumentDefinition
987 @funindex addInstrumentDefinition
988 @funindex \instrumentSwitch
989 @funindex instrumentSwitch
991 If an instrument @emph{switch} is needed,
992 @code{\addInstrumentDefinition} may be used in combination with
993 @code{\instrumentSwitch} to create a detailed list of the
994 necessary changes for the switch. The
995 @code{\addInstrumentDefinition} command has two arguments: an
996 identifying string, and an association list of context properties
997 and values to be used for the instrument. It must be placed in
998 the toplevel scope. @code{\instrumentSwitch} is used in the music
999 expression to declare the instrument switch:
1001 @lilypond[verbatim,quote,ragged-right]
1002 \addInstrumentDefinition #"contrabassoon"
1003 #`((instrumentTransposition . ,(ly:make-pitch -1 0 0))
1004 (shortInstrumentName . "Cbsn.")
1005 (clefGlyph . "clefs.F")
1006 (middleCPosition . 6)
1008 (instrumentCueName . ,(make-bold-markup "cbsn."))
1009 (midiInstrument . "bassoon"))
1012 instrumentName = #"Bassoon"
1016 \compressFullBarRests
1019 \instrumentSwitch "contrabassoon"
1027 @ref{\paper variables for shifts and indents},
1028 @ref{Modifying context plug-ins}.
1031 @rlsr{Staff notation}.
1033 Internals Reference:
1034 @rinternals{InstrumentName},
1035 @rinternals{PianoStaff},
1039 @node Quoting other voices
1040 @unnumberedsubsubsec Quoting other voices
1042 @cindex quote, voices
1043 @cindex voices, quoting
1044 @cindex fragments, quoting
1049 @funindex \quoteDuring
1050 @funindex quoteDuring
1051 @funindex \transposition
1052 @funindex transposition
1054 It is very common for one voice to use the same notes as those from
1055 another voice. For example, first and second violins playing the same
1056 phrase during a particular passage of the music. This is done by
1057 letting one voice @emph{quote} the other, without having to re-enter the
1058 music all over again for the second voice.
1060 The @code{\addQuote} command, used in the top level scope, defines a
1061 stream of music from which fragments can be quoted.
1063 The @code{\quoteDuring} command is used to indicate the point where the
1064 quotation begins. It is followed by two arguments: the name of the
1065 quoted voice, as defined with @code{\addQuote}, and a music expression
1066 for the duration of the quote.
1068 @lilypond[verbatim,quote]
1069 fluteNotes = \relative c'' {
1070 a4 gis g gis | b4^"quoted" r8 ais\p a4( f)
1073 oboeNotes = \relative c'' {
1074 c4 cis c b \quoteDuring #"flute" { s1 }
1077 \addQuote "flute" { \fluteNotes }
1081 \new Staff \with { instrumentName = "Flute" } \fluteNotes
1082 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1087 If the music expression used in @code{\quoteDuring} contains notes
1088 instead of spacer or multimeasure rests then the quote will appear as
1089 polyphony and may produce unexpected results.
1091 @lilypond[verbatim,quote]
1092 fluteNotes = \relative c'' {
1093 a4 gis g gis | b4^"quoted" r8 ais\p a4( f)
1096 oboeNotes = \relative c'' {
1097 c4 cis c b \quoteDuring #"flute" { e4 r8 ais b4 a }
1100 \addQuote "flute" { \fluteNotes }
1104 \new Staff \with { instrumentName = "Flute" } \fluteNotes
1105 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1110 The @code{\quoteDuring} command uses the @code{\transposition} settings
1111 of both quoted and quoting parts to produce notes for the quoting part
1112 that have the same sounding pitch as those in the quoted part.
1114 @lilypond[verbatim,quote]
1115 clarinetNotes = \relative c'' {
1118 b4 ais a ais | cis4^"quoted" r8 bis\p b4( f)
1121 oboeNotes = \relative c'' {
1122 c4 cis c b \quoteDuring #"clarinet" { s1 }
1125 \addQuote "clarinet" { \clarinetNotes }
1130 \new Staff \with { instrumentName = "Clarinet" } \clarinetNotes
1131 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1137 @cindex articulation-event
1138 @cindex dynamic-event
1141 @cindex crescendo-event
1143 @funindex quotedEventTypes
1144 @funindex quotedCueEventTypes
1146 By default quoted music will include all articulations, dynamics,
1147 markups, etc., in the quoted expression. It is possible to choose which
1148 of these objects from the quoted music are displayed by using the
1149 @code{quotedEventTypes} context property.
1151 @lilypond[verbatim,quote]
1152 fluteNotes = \relative c'' {
1154 b4\<^"quoted" r8 ais a4\f( c->)
1157 oboeNotes = \relative c'' {
1159 \quoteDuring #"flute" { s1 }
1162 \addQuote "flute" { \fluteNotes }
1166 \set Score.quotedEventTypes = #'(note-event articulation-event
1167 crescendo-event rest-event
1168 slur-event dynamic-event)
1169 \new Staff \with { instrumentName = "Flute" } \fluteNotes
1170 \new Staff \with { instrumentName = "Oboe" } \oboeNotes
1175 Quotes can also be tagged, see @ref{Using tags}.
1179 @ref{Instrument transpositions},
1183 @file{scm/define-event-classes.scm}.
1186 @rlsr{Staff notation}.
1188 Internals Reference:
1189 @rinternals{Music classes},
1190 @rinternals{QuoteMusic},
1194 Only the contents of the first @code{Voice} occurring in an
1195 @code{\addQuote} command will be considered for quotation, so if the music
1196 expression contains @code{\new} or @code{\context Voice}
1197 statements, their contents will not be quoted. Quoting grace notes
1198 is unsupported and may cause LilyPond to crash whereas quoting nested
1199 triplets may result in poor notation.
1202 @node Formatting cue notes
1203 @unnumberedsubsubsec Formatting cue notes
1207 @cindex cue notes, formatting
1208 @cindex formatting, cue notes
1209 @cindex voices, quoting
1212 @funindex \cueDuring
1216 @funindex \cueDuringWithClef
1217 @funindex cueDuringWithClef
1218 @funindex \quoteDuring
1219 @funindex quoteDuring
1221 @cindex notes, smaller
1222 @cindex smaller notes
1225 The simplest way to format cue notes is to explicitly create a
1226 @code{CueVoice} context within the part.
1228 @lilypond[verbatim,relative=1]
1233 \stemUp d'8^"flute" c d e fis2
1239 The @code{\cueClef} command can also be used with an explict
1240 @code{CueVoice} context if a change of clef is required and will print
1241 an appropriately sized clef for the cue notes. The @code{\cueClefUnset}
1242 command can then be used to switch back to the original clef, again with
1243 an appropriately sized clef.
1245 @lilypond[verbatim,noragged-right,relative=1]
1249 { e2\rest r4. \cueClefUnset e,8 }
1251 \cueClef "treble" \stemUp d''8^"flute" c d e fis2
1257 The @code{\cueClef} and @code{\cueClefUnset} command can also be used
1258 without a @code{CueVoice} if required.
1260 @lilypond[verbatim,noragged-right,relative=1]
1264 d'8^"flute" c d e fis2
1269 For more complex cue note placement, e.g including transposition, or
1270 inserting cue notes from multiple music sources the @code{\cueDuring} or
1271 @code{\cueDuringWithClef} commands can be used. These are more
1272 specialized form of @code{\quoteDuring}, see @ref{Quoting other voices}
1273 in the previous section.
1278 \cueDuring #@var{quotename} #@var{direction} #@var{music}
1284 \cueDuringWithClef #@var{quotename} #@var{direction} #@var{clef} #@var{music}
1287 The music from the corresponding measures of the @code{@var{quote name}}
1288 is added as a @code{CueVoice} context and occurs simultaneously with the
1289 @code{@var{music}}, which then creates a polyphonic situation. The
1290 @code{@var{direction}} takes the argument @code{UP} or @code{DOWN}, and
1291 corresponds to the first and second voices respectively, determining how
1292 the cue notes are printed in relation to the other voice.
1294 @lilypond[verbatim,quote]
1295 fluteNotes = \relative c'' {
1296 r2. c4 | d8 c d e fis2 | g2 d |
1299 oboeNotes = \relative c'' {
1301 s1*0^\markup { \tiny "flute" }
1302 \cueDuring #"flute" #UP { R1 }
1306 \addQuote "flute" { \fluteNotes }
1316 It is possible to adjust which aspects of the music are quoted with
1317 @code{\cueDuring} by setting the @code{quotedCueEventTypes}
1318 property. Its default value is @code{'(note-event rest-event
1319 tie-event beam-event tuplet-span-event)}, which means that only
1320 notes, rests, ties, beams and tuplets are quoted, but not
1321 articulations, dynamic marks, markup etc.
1323 @warning{When a @code{Voice} starts with @code{\cueDuring}, as in the
1324 following example, the @code{Voice} context must be explicitly declared,
1325 or else the entire music expression would belong to the @code{CueVoice}
1328 @lilypond[verbatim,quote]
1329 oboeNotes = \relative c'' {
1330 r2 r8 d16(\f f e g f a)
1333 \addQuote "oboe" { \oboeNotes }
1335 \new Voice \relative c'' {
1336 \set Score.quotedCueEventTypes = #'(note-event rest-event tie-event
1337 beam-event tuplet-span-event
1338 dynamic-event slur-event)
1339 \cueDuring #"oboe" #UP { R1 }
1344 Markup can be used to show the name of the quoted instrument. Also,
1345 if the cue notes require a change in clef, this can be done manually but
1346 the original clef should also be restored manually at the end of the cue
1349 @lilypond[verbatim,quote]
1350 fluteNotes = \relative c'' {
1351 r2. c4 d8 c d e fis2 g2 d2
1354 bassoonNotes = \relative c {
1358 s1*0^\markup { \tiny "flute" }
1359 \cueDuring #"flute" #UP { R1 }
1364 \addQuote "flute" { \fluteNotes }
1371 Alternatively, the @code{\cueDuringWithClef} function can be used
1372 instead. This command takes an extra argument to specify the change of
1373 clef that needs to be printed for the cue notes but will automatically
1374 print the original clef once the cue notes have finished.
1376 @lilypond[verbatim,quote]
1377 fluteNotes = \relative c'' {
1378 r2. c4 d8 c d e fis2 g2 d2
1381 bassoonNotes = \relative c {
1384 s1*0^\markup { \tiny "flute" }
1385 \cueDuringWithClef #"flute" #UP #"treble" { R1 }
1389 \addQuote "flute" { \fluteNotes }
1396 @funindex \transposedCueDuring
1397 @funindex transposedCueDuring
1399 Like @code{\quoteDuring}, @code{\cueDuring} takes instrument
1400 transpositions into account. Cue notes are produced at the
1401 pitches that would be written for the instrument receiving the cue
1402 to produce the sounding pitches of the source instrument.
1404 To transpose cue notes differently, use
1405 @code{\transposedCueDuring}. This command takes an extra argument
1406 to specify (in absolute mode) the printed pitch that you want to
1407 represent the sound of a concert middle C. This is useful for
1408 taking cues from an instrument in a completely different register.
1410 @lilypond[verbatim,quote]
1411 piccoloNotes = \relative c''' {
1418 bassClarinetNotes = \relative c' {
1422 \transposedCueDuring #"piccolo" #UP d { R1 }
1426 \addQuote "piccolo" { \piccoloNotes }
1429 \new Staff \piccoloNotes
1430 \new Staff \bassClarinetNotes
1434 @cindex removing cue notes
1435 @cindex cue notes, removing
1439 @funindex \addInstrumentDefinition
1440 @funindex addInstrumentDefinition
1442 The @code{\killCues} command removes cue notes from a music
1443 expression, so the same music expression can be used to produce
1444 the instrument part with cues and the score. The @code{\killCues}
1445 command removes only the notes and events that were quoted by
1446 @code{\cueDuring}. Other markup associated with cues, such as clef
1447 changes and a label identifying the source instrument, can be
1448 tagged for selective inclusion in the score; see @ref{Using tags}.
1450 @lilypond[verbatim,quote]
1451 fluteNotes = \relative c'' {
1452 r2. c4 d8 c d e fis2 g2 d2
1455 bassoonNotes = \relative c {
1460 s1*0^\markup { \tiny "flute" }
1462 \cueDuring #"flute" #UP { R1 }
1463 \tag #'part \clef bass
1467 \addQuote "flute" { \fluteNotes }
1478 \removeWithTag #'part { \killCues { \bassoonNotes } }
1483 Alternatively, Clef changes and instrument labels can be
1484 collected into an instrument definition for repeated use, using
1485 @code{\addInstrumentDefinition} described in @ref{Instrument names}.
1489 @ref{Quoting other voices},
1490 @ref{Instrument transpositions},
1491 @ref{Instrument names},
1497 @rlsr{Staff notation}.
1499 Internals Reference:
1500 @rinternals{CueVoice},
1504 Collisions can occur with rests, when using @code{\cueDuring},
1505 between @code{Voice} and @code{CueVoice} contexts. When using
1506 @code{\cueDuringWithClef} or @code{\transposedCueDuring} the extra
1507 argument required for each case must come after the quote and the