1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. See TRANSLATION for details.
12 @section Staff notation
14 @lilypondfile[quote]{staff-headword.ly}
17 This section explains how to influence the staff appearance,
18 print scores with more than one staff, and
19 how to apply specific performance marks to single staves.
23 * Modifying single staves::
28 @node Displaying staves
29 @subsection Displaying staves
31 This section shows the different possibilities to create and group
32 staves into groups, which can be marked in the beginning of each
33 line with either a bracket or a brace.
36 * Instantiating new staves::
38 * Deeper nested staff groups::
41 @node Instantiating new staves
42 @subsubsection Instantiating new staves
45 @cindex staff initiation
46 @cindex staff instantiation
50 @cindex percussion staff
51 @cindex Gregorian transcription staff
52 @cindex rhythmic staff
56 Staves (sg. staff) are created with the @code{\new} or
57 @code{\context} commands. For an explanation on these commands,
58 see @ref{Creating contexts}.
60 There are different predefined staff contexts available in LilyPond:
64 The default is @code{Staff}:
66 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
67 \new Staff { c d e f }
71 @code{DrumStaff} creates a five line staff set up for a typical drum set.
72 It uses different names for each instrument. The instrument names have to
73 be set using the @code{drummode}. See @ref{Percussion staves}.
75 @lilypond[verbatim,ragged-right,quote]
77 \drummode { cymc hh ss tomh }
81 @c FIXME: remove when mentioned in NR 2.8
83 @code{GregorianTranscriptionStaff} sets up a staff to notate modern
84 Gregorian chant. It does not show bar lines.
86 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
87 \new GregorianTranscriptionStaff { c d e f }
91 @code{RhythmicStaff} can be used to show the rhythm of some music. The
92 notes are printed on one line regardless of their pitch, but the duration
93 is preserved. See @ref{Showing melody rhythms}.
95 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
96 \new RhythmicStaff { c d e f }
100 @code{TabStaff} creates by default a tablature with six strings in
101 standard guitar tuning. See @ref{Guitar tablatures}.
103 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
104 \new TabStaff { c d e f }
110 Besides these staves there are two staff contexts specific for the notation
111 of ancient music: @code{MensuralStaff} and @code{VaticanaStaff}. They are
112 described in @ref{Pre-defined contexts}.
114 Once a staff is instantiated it can be started or stopped at every point
115 in the score. This is done with the commands @code{\startStaff} and
116 @code{\stopStaff}. How to use it is explained in @ref{Staff symbol}.
121 Music Glossary: @rglos{staff}, @rglos{staves}.
123 Notation Reference: @ref{Percussion staves},
124 @ref{Guitar tablatures}, @ref{Gregorian Chant contexts},
125 @ref{Mensural contexts}.
128 @lsrdir{Staff,Staff-notation}
130 Internals Reference: @internalsref{Staff}, @internalsref{DrumStaff},
131 @internalsref{GregorianTranscriptionStaff}, @internalsref{RhythmicStaff},
132 @internalsref{TabStaff}, @internalsref{MensuralStaff},
133 @internalsref{VaticanaStaff}, @internalsref{StaffSymbol}.
137 @node Grouping staves
138 @subsubsection Grouping staves
140 @cindex start of system
141 @cindex staff, multiple
142 @cindex staves, multiple
143 @cindex system start delimiters
144 @cindex bracket, vertical
145 @cindex brace, vertical
153 LilyPond provides different types of contexts to group single staves
154 together. These contexts influence in the first place the appearance
155 of the system start delimiter, but they have also influence on the
156 behavior of the bar lines.
160 If no context is specified, the default properties for the score
161 will be used: the group is started with a vertical line, and the
162 bar lines are not connected. The name of the beginning bar line
163 grob is @code{SystemStartBar}.
165 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
173 In a @code{StaffGroup}, the bar lines will be drawn through
174 all the staves, and the group is started with a bracket.
176 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
184 In a @code{ChoirStaff}, the group is
185 started with a bracket, but bar lines are not connected.
187 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
195 In a @code{GrandStaff}, the group is started with a brace
196 at the left, and bar lines are connected between the staves.
198 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
206 The @code{PianoStaff} behaves almost as the @code{GrandStaff} but is
207 optimized for setting piano music. In particular it supports the printing
208 of an instrument name directly, see @ref{Instrument names}.
210 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
219 Each staff group context sets the property
220 @code{systemStartDelimiter} to one of the values
221 @code{SystemStartBar}, @code{SystemStartBrace},
222 and @code{SystemStartBracket}. A fourth delimiter,
223 @code{systemStartSquare}, is also available, but must be
224 instantiated manually. The usage of this last delimiter is shown further
225 down in the snippet section.
227 According to classic engraver rules an orchestral score consists of
228 staves connected only with a single line at the beginning of the system.
229 In LilyPond this is produced grouping the @code{Staff} contexts with
232 Each instrument family is grouped inside of a @code{StaffGroup} with a
233 starting bracket. A group of same instruments or an instrument using
234 more than one staff is grouped with braces in a @code{GrandStaff}.
236 As the context names tell, @code{PianoStaff} is used for notating
237 piano music and @code{ChoirStaff} for all kind of vocal ensemble music.
242 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
243 {use-square-bracket-at-the-start-of-a-staff-group.ly}
245 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
246 {display-bracket-with-only-one-staff-in-a-system.ly}
248 @cindex mensurstriche layout
249 @cindex renaissance music
250 @cindex transcription of mensural music
251 @cindex mensural music, transcription of
253 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
254 {mensurstriche-layout-bar-lines-between-the-staves.ly}
255 @c FIXME: move to NR 2.8.x when sectioning is ready
259 Music Glossary: @rglos{brace},
260 @rglos{bracket}, @rglos{grand staff}.
263 @lsrdir{Staff,Staff-notation}
265 Internals Reference: @internalsref{Staff}, @internalsref{ChoirStaff},
266 @internalsref{GrandStaff}, @internalsref{PianoStaff},
267 @internalsref{StaffGroup}, @internalsref{systemStartDelimiter},
268 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace},
269 @internalsref{SystemStartBracket}, @internalsref{systemStartSquare}.
272 @node Deeper nested staff groups
273 @subsubsection Deeper nested staff groups
275 There are also two inner staff contexts named @code{InnerStaffGroup}
276 and @code{InnerChoirStaffGroup} besides the grouping contexts mentioned
277 in @ref{Grouping staves}. They behave in the same way as their simple
278 counterparts, except that they are contained in another staff grouping
279 context, thus producing one more bracket on top of the existing one.
280 Note that @code{GrandStaff} and @code{PianoStaff} do not have any inner
281 grouping contexts. They can both be inside any other staff context,
282 including inner staff groups, though.
284 Here is an example of an orchestral score using groupings and nesting
285 of these groupings. Note that the instrument names are omitted from the
286 source code, for instructions how to set them see @ref{Instrument names}.
288 @cindex staff, nested
289 @cindex staves, nested
290 @cindex nesting of staves
291 @cindex system start delimiters, nested
292 @cindex nested staff brackets
293 @cindex brackets, nesting of
294 @cindex braces, nesting of
295 @cindex inner staff group
296 @cindex inner choir staff group
301 \new StaffGroup %woodwinds
303 \new Staff @{ c'1 d' @} %flute
304 \new InnerStaffGroup <<
305 \new Staff @{ c' d' @} %sax
306 \new Staff @{ c' d' @} %oboe
307 \new Staff @{ c' d' @} %English horn
309 \new Staff @{ \clef bass c d @} %bassoon
311 \new StaffGroup %the brass group
313 \new Staff @{ c' d' @} %trumpet
314 \new Staff @{ \clef bass c d @} %trombone
315 \new GrandStaff %the horns need a GrandStaff (same instrument)
317 \new Staff @{ c' d' @}
318 \new Staff @{ \clef bass c d @}
321 \new ChoirStaff %for setting vocal music
323 \new Staff @{ c' d' @}
324 \new InnerChoirStaff <<
325 \new Staff @{ c' d' @}
326 \new Staff @{ c' d' @}
328 \new Staff @{ c' d' @}
330 \new PianoStaff %for the piano
332 \new Staff @{ c' d' @}
333 \new Staff @{\clef bass c d @}
338 @c no verbatim so instrument names are only in the music
339 @lilypond[ragged-right,quote]
341 \new StaffGroup %woodwinds
343 \new Staff {\set Staff.instrumentName = "fl" c'1 d' } %flute
344 \new InnerStaffGroup <<
345 \new Staff { \set Staff.instrumentName = "sax" c' d' } %sax 1
346 \new Staff { \set Staff.instrumentName = "ob" c' d' } %sax 2
347 \new Staff { \set Staff.instrumentName = "ca" c' d' }
349 \new Staff {\set Staff.instrumentName = "bs" \clef bass c d } %bassoon
351 \new StaffGroup %the brass group
353 \new Staff {\set Staff.instrumentName = "tr" c' d' } %trumpet
354 \new Staff {\set Staff.instrumentName = "tb" \clef bass c d } %trombone
355 \new GrandStaff %the horns need a GrandStaff (same instrument)
357 \new Staff {\set Staff.instrumentName = "cor1" c' d' }
358 \new Staff {\set Staff.instrumentName = "cor2" \clef bass c d }
361 \new ChoirStaff %for setting vocal music
363 \new Staff {\set Staff.instrumentName = "S" c' d' }
364 \new InnerChoirStaff <<
365 \new Staff {\set Staff.instrumentName = "A1" c' d' }
366 \new Staff {\set Staff.instrumentName = "A2" c' d' }
368 \new Staff {\set Staff.instrumentName = "T" c' d' }
370 \new PianoStaff %for the piano
373 \new Staff {\clef bass c d }
381 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
388 @lsrdir{Staff,Staff-notation}
390 Internals Reference: @internalsref{InnerChoirStaffGroup},
391 @internalsref{InnerStaffGroup}, @internalsref{SystemStartBar},
392 @internalsref{SystemStartBrace}, @internalsref{SystemStartBracket},
393 @internalsref{systemStartDelimiterHierarchy}.
397 @node Modifying single staves
398 @subsection Modifying single staves
400 This section explains how to change specific attributes of one
401 staff like the staff lines, starting and stopping of staves, sizing
402 of staves, and setting ossia sections.
411 @subsubsection Staff symbol
413 @cindex adjusting staff symbol
414 @cindex drawing staff symbol
415 @cindex staff symbol, setting of
416 @cindex stop staff lines
417 @cindex start staff lines
418 @cindex staff lines, amount of
419 @cindex staff lines, number of
420 @cindex staff line, thickness of
421 @cindex amount of staff lines
422 @cindex thickness of staff lines
423 @cindex ledger lines, setting
424 @cindex setting of ledger lines
425 @cindex spacing of ledger lines
426 @cindex number of staff lines
428 The layout object which draws the lines of a staff is called
429 @code{staff symbol}. The staff symbol may be tuned in number,
430 thickness and distance of lines, using properties. It may also
431 be started and stopped at every point in the score.
435 Changing the number of staff lines is done by overriding
436 @code{line-count}. You may need to adjust the clef position
437 and the position of the middle C to fit to the new staff. For
438 an explanation, see the snippet section in @ref{Displaying pitches}.
440 @lilypond[verbatim,ragged-right,quote]
442 \override Staff.StaffSymbol #'line-count = #3
448 The placement and amount of the staff lines can also set totally
449 manually by defining their positions explicitly. The middle
450 of the staff has the value of 0, each half staff space up and down
451 adds an integer. The default values are 4 2 0 -2 -4. Bar lines
452 are drawn according to the calculated width of the system, but
453 they are always centered. As the
454 example shows, the positions of the notes are not influenced
455 by the position of the staff lines.
457 @lilypond[verbatim,ragged-right,quote]
459 \override StaffSymbol #' line-positions = #' ( 7 3 0 -4 -6 -7 )
466 The staff line thickness can be set by overriding the @code{thickness}
467 property. Note that it gets applied also to ledger lines and stems,
468 since they depend on the staff line thickness. The argument of
469 @code{thickness} is a factor of @code{line-thickness} which defaults
470 to the normal staff line thickness.
472 @lilypond[verbatim,ragged-right,quote]
474 \override StaffSymbol #'thickness = #3
481 The thickness of the ledger lines can also be set independent of the
482 settings for staff lines. The setting is calculated from a pair of
483 values which will be added for the final thickness. The first value
484 is the staff line thickness multiplied by a factor, the second is
485 the staff space multiplied by a factor. In the example the ledger
486 lines get their thickness from one staff line thickness plus 1/5
487 staff space, so they are heavier than a normal staff line.
489 @lilypond[verbatim,ragged-right,quote]
491 \override StaffSymbol #' ledger-line-thickness = #' ( 1 . 0.2 ) }
498 The distance of the stafflines can be changed with the
499 @code{staff-space} property. Its argument is the amount
500 of staff spaces that should be inserted between the lines.
501 The default value is 1. Setting the distance has
502 influence on the staff lines as well as on ledger lines.
504 @lilypond[verbatim,ragged-right,quote]
506 \override StaffSymbol #' staff-space = #1.5
513 The length of the staff line can also be adjusted
514 manually. The unit is one staff space. Spacing
515 of the objects inside the staff does not get influenced
518 @lilypond[verbatim,ragged-right,quote]
520 \override StaffSymbol #' width = #23
528 These properties can only be set before instantiating the staff symbol.
529 But it is possible to start and stop staves in the middle of a score,
530 so each new setting will be applied to the newly instantiated staff.
532 @lilypond[verbatim,relative=2,fragment]
534 %Set here the overrides for the staff
535 \override Staff.StaffSymbol #'line-count = 2
536 \stopStaff \startStaff
538 %Revert to the default
539 \revert Staff.StaffSymbol #'line-count
540 \stopStaff \startStaff
546 @code{\stopStaff}, @code{\startStaff}
550 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
551 {making-some-staff-lines-thicker-than-the-others.ly}
555 Glossary: @rglos{line}, @rglos{ledger line}, @rglos{staff}.
557 Internals Reference: @internalsref{StaffSymbol}.
561 When setting staff lines manually, bar lines are
562 always drawn centered on the position 0, so the
563 maximum distance of the bar lines in either direction
568 @subsubsection Ossia staves
570 @cindex staff, Frenched
572 @cindex Frenched staves
573 @cindex staff, resizing of
574 @cindex resizing of staves
576 Tweaking the staff object allows to resize the staff:
578 @lilypond[verbatim,ragged-right,quote]
581 \override StaffSymbol #'staff-space = #(magstep -3)
582 \override StaffSymbol #'thickness = # (magstep -3)
591 This involves shrinking the staff spaces, the staff lines and
592 the font size by the factor 3. You find a more precise explanation
593 in @ref{Setting the staff size}.
595 The @emph{ossia} section in the next example are just put parallel
596 to the main staff with @code{<<} and @code{>>} brackets. The @emph{ossia}
597 staff is stopped and started explicitely and white space is inserted
598 with the @code{\skip} command.
600 @lilypond[verbatim,relative=2,quote]
604 %No time signature in the ossia staff
605 \remove "Time_signature_engraver"
607 \override StaffSymbol #'staff-space = #(magstep -3)
608 \override StaffSymbol #'thickness = # (magstep -3)
617 bes8[^"ossia" g bes g]
625 \new Staff \relative c'' {
635 @c lilypondfile{Making-some-staff-lines-thicker-than-the-others.ly}
640 Music Glossary: @rglos{ossia}, @rglos{staff}, @rglos{Frenched staff}.
643 @lsrdir{Staff,Staff-notation}
645 Internals Reference: @internalsref{StaffSymbol}.
649 @subsubsection Hiding staves
651 @cindex Frenched scores
652 @cindex staff, hiding
654 @cindex hiding of staves
656 @cindex Frenched staves
658 In orchestral scores, staff lines that only have rests are usually
659 removed; this saves some space. This style is called @q{French
660 Score}. For the @code{Lyrics}, @code{ChordNames}, and
661 @code{FiguredBass} contexts, this is switched on by default. When
662 the lines of these contexts turn out empty after the line-breaking
663 process, they are removed.
665 For normal staves this behaviour is called
666 with the @code{\RemoveEmptyStaffContext} command. It is set
667 in the @code{\layout} block. As a result staves containing
668 nothing or whole mesure rests are removed after a line break.
670 @lilypond[quote,ragged-right,verbatim]
672 \context { \RemoveEmptyStaffContext }
676 \new Staff { e4 f g a \break c1 }
677 \new Staff { c4 d e f \break R1 }
683 To remove other types of contexts, use
684 @code{\AncientRemoveEmptyStaffContext} or
685 @code{\RemoveEmptyRhythmicStaffContext}.
689 Another application of the @code{\RemoveEmptyStaffContext} is to
690 make ossia sections, i.e., alternative melodies on a separate
691 piece of staff, with help of a Frenched staff. See @ref{Ossia staves}.
693 You can make the staff lines invisible by removing the
694 @code{Staff_symbol_engraver} from the @code{Staff} context.
697 @lilypond[quote,ragged-right,verbatim]
699 \context Staff \relative c'' { c8 c c16 c c c }
703 \remove Staff_symbol_engraver
711 The first empty staff can also be removed from the score with a
712 setting in the @code{VerticalAxisGroup} property. This can be done
713 globally inside the @code{\layout} block, or locally inside the
714 specific staff that should be removed. In the latter case,
715 you have to specify the context (@code{Staff} applies only to the
716 current staff) in front of the property.
718 The lower staff of the second staff group is not removed,
719 because the setting applies only to the specific staff inside
720 of which it is written.
722 @lilypond[quote,ragged-right,verbatim,relative=2]
725 \RemoveEmptyStaffContext
726 %To use the setting globally, uncomment the following line:
727 %\override VerticalAxisGroup #'remove-first = ##t
735 %To use the setting globally, comment this line, uncomment the line above
736 \override Staff.VerticalAxisGroup #'remove-first = ##t
741 \new Staff { e4 f g a \break c1 }
742 \new Staff { R \break R1 }
746 @c FIXME not yet in master
747 @c lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
748 @c {remove-the-first-empy-line.ly}
752 @code{\RemoveEmptyStaffContext},
753 @code{\AncientRemoveEmptyStaffContext},
754 @code{\RemoveEmptyRhythmicStaffContext},
758 Notation Reference: @ref{Staff symbol}.
761 @lsrdir{Staff,Staff-notation}
763 Internals Reference: @internalsref{ChordNames},
764 @internalsref{FiguredBass}, @internalsref{Lyrics},
765 @internalsref{Staff}, @internalsref{VerticalAxisGroup}.
768 @subsection Writing parts
773 * Quoting other voices::
774 * Formatting cue notes::
777 @node Metronome marks
778 @subsubsection Metronome marks
781 @cindex beats per minute
782 @cindex metronome marking
784 Metronome settings can be entered as follows
787 \tempo @var{duration} = @var{per-minute}
790 In the MIDI output, they are interpreted as a tempo change. In
791 the layout output, a metronome marking is printed
795 @lilypond[quote,ragged-right,verbatim,fragment]
802 To change the tempo in the MIDI output without printing anything,
803 make the metronome marking invisible @example \once \override
804 Score.MetronomeMark #'transparent = ##t @end example
806 To print other metronome markings, use these markup commands
807 @lilypond[quote,ragged-right,verbatim,relative,fragment]
810 \smaller \general-align #Y #DOWN \note #"16." #1
812 \smaller \general-align #Y #DOWN \note #"8" #1
817 For more details, see @ref{Formatting text}.
822 Music Glossary: @rglos{metronome}, @rglos{metronomic indication},
823 @rglos{tempo indication}, @rglos{metronome mark}.
825 Notation Reference: @ref{Formatting text}.
828 @lsrdir{Staff,Staff-notation}
830 Internals Reference: @internalsref{MetronomeMark}, @ref{MIDI
836 Collisions are not checked. If you have notes above the top line
837 of the staff (or notes with articulations, slurs, text, etc), then
838 the metronome marking may be printed on top of musical symbols.
839 If this occurs, increase the padding of the metronome mark to
840 place it further away from the staff.
843 \override Score.MetronomeMark #'padding = #2.5
846 @c perhaps also an example of how to move it horizontally?
849 @node Instrument names
850 @subsubsection Instrument names
852 @cindex instrument names
853 @cindex instrument names, short
855 In an orchestral score, instrument names are printed at the left
858 This can be achieved by setting @code{Staff}.@code{instrumentName} and
859 @code{Staff}.@code{shortInstrumentName}, or
860 @code{PianoStaff}.@code{instrumentName} and
861 @code{PianoStaff}.@code{shortInstrumentName}. This will print text
862 before the start of the staff. For the first staff,
863 @code{instrumentName} is used. If set, @code{shortInstrumentName} is
864 used for the following staves.
866 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
867 \set Staff.instrumentName = "Ploink "
868 \set Staff.shortInstrumentName = "Plk "
874 You can also use markup texts to construct more complicated
875 instrument names, for example
877 @lilypond[quote,fragment,verbatim,ragged-right]
878 \set Staff.instrumentName = \markup {
879 \column { "Clarinetti"
880 \line { "in B" \smaller \flat } } }
884 @cindex instrument names, centering
886 As instrument names are centered by default, multi line names
887 are better entered using @code{\center-align}:
889 @lilypond[quote,verbatim,ragged-right]
892 \set Staff.instrumentName = \markup \center-align {
894 \line { "in B" \smaller \flat }
899 \set Staff.instrumentName = "Vibraphone"
906 For longer instrument names, it may be useful to increase the
907 @code{indent} setting in the @code{\layout} block.
909 Short instrument names, printed before the systems following the first
910 one, are also centered by default, in a space which width is given by
911 the @code{short-indent} variable of the @code{\layout} block.
913 To add instrument names to other contexts (such as
914 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}), the
915 engraver must be added to that context.
919 \context @{\GrandStaff \consists "Instrument_name_engraver"@}
924 More information about adding and removing engravers can be found
925 in @ref{Modifying context plug-ins}.
927 @cindex instrument names, changing
929 Instrument names may be changed in the middle of a piece,
931 @lilypond[quote,fragment,verbatim,ragged-right]
932 \set Staff.instrumentName = "First"
933 \set Staff.shortInstrumentName = "one"
936 \set Staff.instrumentName = "Second"
937 \set Staff.shortInstrumentName = "two"
945 Notation Reference: @ref{Modifying context plug-ins}.
948 @lsrdir{Staff,Staff-notation}
950 Internals Reference: @internalsref{InstrumentName},
951 @internalsref{PianoStaff}, @internalsref{Staff}.
954 @node Quoting other voices
955 @subsubsection Quoting other voices
958 @cindex quoting other voices
962 With quotations, fragments of other parts can be inserted into a
963 part directly. Before a part can be quoted, it must be marked
964 especially as quotable. This is done with the @code{\addQuote}
968 \addQuote @var{name} @var{music}
973 Here, @var{name} is an identifying string. The @var{music} is any
974 kind of music. Here is an example of @code{\addQuote}
977 \addQuote clarinet \relative c' @{
982 This command must be entered at toplevel, i.e., outside any music
983 blocks. Typically, one would use an already defined music event
987 clarinet = \relative c' @{
990 \addQuote clarinet @{ \clarinet @}
994 After calling @code{\addQuote}, the quotation may then be done
995 with @code{\quoteDuring} or @code{\cueDuring},
998 \quoteDuring #@var{name} @var{music}
1001 During a part, a piece of music can be quoted with the
1002 @code{\quoteDuring} command.
1005 \quoteDuring #"clarinet" @{ s2. @}
1008 This would cite three quarter notes (the duration of @code{s2.})
1009 of the previously added @code{clarinet} voice.
1011 More precisely, it takes the current time-step of the part being
1012 printed, and extracts the notes at the corresponding point of the
1013 @code{\addQuote}d voice. Therefore, the argument to
1014 @code{\addQuote} should be the entire part of the voice to be
1015 quoted, including any rests at the beginning.
1017 It is possible to use another music expression instead of
1018 @code{s}, thus creating a polyphonic section, but this may not
1019 always give the desired result.
1021 Quotations take into account the transposition of both source and
1022 target instruments, if they are specified using the
1023 @code{\transposition} command.
1025 @lilypond[quote,ragged-right,verbatim]
1026 \addQuote clarinet \relative c' {
1032 e'8 f'8 \quoteDuring #"clarinet" { s2 }
1036 The type of events that are present in the quoted music can be
1037 trimmed with the @code{quotedEventTypes} property. The default
1038 value is @code{(note-event rest-event)}, which means that only
1039 notes and rests of the quoted voice end up in the
1040 @code{\quoteDuring}. Setting
1043 \set Staff.quotedEventTypes =
1044 #'(note-event articulation-event dynamic-event)
1048 will quote notes (but no rests), together with scripts and
1053 Only the contents of the first @code{Voice} occurring in an
1054 @code{\addQuote} command will be considered for quotation, so
1055 @var{music} can not contain @code{\new} and @code{\context Voice}
1056 statements that would switch to a different Voice.
1058 Quoting grace notes is broken and can even cause LilyPond to
1061 Quoting nested triplets may result in poor notation.
1063 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
1064 written entirely in lower-case letters: @code{\addquote}.
1068 Notation Reference: @ref{Instrument transpositions}.
1071 @lsrdir{Staff,Staff-notation}
1073 Internals Reference: @internalsref{QuoteMusic}, @internalsref{Voice}.
1076 @node Formatting cue notes
1077 @subsubsection Formatting cue notes
1081 @cindex cue notes, formatting
1083 @cindex quoting other voices
1084 @cindex cues, formatting
1086 The previous section deals with inserting notes from another
1087 voice. There is a more advanced music function called
1088 @code{\cueDuring}, which makes formatting cue notes easier.
1093 \cueDuring #@var{name} #@var{updown} @var{music}
1096 This will insert notes from the part @var{name} into a
1097 @code{Voice} called @code{cue}. This happens
1098 simultaneously with @var{music}, which usually is a rest. When
1099 the cue notes start, the staff in effect becomes polyphonic for a
1100 moment. The argument @var{updown} determines whether the cue
1101 notes should be notated as a first or second voice.
1104 @lilypond[verbatim,ragged-right]
1107 \override Stem #'length-fraction = #0.8
1108 \override Beam #'thickness = #0.384
1109 \override Beam #'length-fraction = #0.8
1112 \addQuote clarinet \relative {
1117 \new Staff \relative <<
1119 % setup a context for cue notes.
1120 \new Voice = "cue" { \smaller \skip 1*21 }
1122 \set Score.skipBars = ##t
1126 \cueDuring #"clarinet" #UP {
1135 Here are a couple of hints for successful cue notes:
1139 Cue notes have smaller font sizes.
1142 The cued part is marked with the instrument playing the cue.
1145 When the original part takes over again, this should be marked
1146 with the name of the original instrument.
1149 Any other changes introduced by the cued part should also be
1150 undone. For example, if the cued instrument plays in a different
1151 clef, the original clef should be stated once again.
1155 The macro @code{\transposedCueDuring} is useful to add cues to
1156 instruments which use a completely different octave range (for
1157 example, having a cue of a piccolo flute within a contra bassoon
1160 @lilypond[verbatim,ragged-right,quote]
1161 picc = \relative c''' {
1167 \addQuote "picc" { \picc }
1169 cbsn = \relative c, {
1172 \transposedCueDuring #"picc" #UP c,, { R1 } |
1177 \context Staff = "picc" \picc
1178 \context Staff = "cbsn" \cbsn
1185 @lsrdir{Staff,Staff-notation}
1187 Internals Reference: @internalsref{Voice}.