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}.
127 Snippets: @lsrdir{Staff,Staff-notation}.
129 Internals Reference: @internalsref{Staff}, @internalsref{DrumStaff},
130 @internalsref{GregorianTranscriptionStaff}, @internalsref{RhythmicStaff},
131 @internalsref{TabStaff}, @internalsref{MensuralStaff},
132 @internalsref{VaticanaStaff}, @internalsref{StaffSymbol}.
136 @node Grouping staves
137 @subsubsection Grouping staves
139 @cindex start of system
140 @cindex staff, multiple
141 @cindex staves, multiple
142 @cindex system start delimiters
143 @cindex bracket, vertical
144 @cindex brace, vertical
152 LilyPond provides different types of contexts to group single staves
153 together. These contexts influence in the first place the appearance
154 of the system start delimiter, but they have also influence on the
155 behavior of the bar lines.
159 If no context is specified, the default properties for the score
160 will be used: the group is started with a vertical line, and the
161 bar lines are not connected. The name of the beginning bar line
162 grob is @code{SystemStartBar}.
164 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
172 In a @code{StaffGroup}, the bar lines will be drawn through
173 all the staves, and the group is started with a bracket.
175 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
183 In a @code{ChoirStaff}, the group is
184 started with a bracket, but bar lines are not connected.
186 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
194 In a @code{GrandStaff}, the group is started with a brace
195 at the left, and bar lines are connected between the staves.
197 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
205 The @code{PianoStaff} behaves almost as the @code{GrandStaff} but is
206 optimized for setting piano music. In particular it supports the printing
207 of an instrument name directly, see @ref{Instrument names}.
209 @lilypond[verbatim,ragged-right,quote,fragment,relative=2]
218 Each staff group context sets the property
219 @code{systemStartDelimiter} to one of the values
220 @code{SystemStartBar}, @code{SystemStartBrace},
221 and @code{SystemStartBracket}. A fourth delimiter,
222 @code{systemStartSquare}, is also available, but must be
223 instantiated manually. The usage of this last delimiter is shown further
224 down in the snippet section.
226 According to classic engraver rules an orchestral score consists of
227 staves connected only with a single line at the beginning of the system.
228 In LilyPond this is produced grouping the @code{Staff} contexts with
231 Each instrument family is grouped inside of a @code{StaffGroup} with a
232 starting bracket. A group of same instruments or an instrument using
233 more than one staff is grouped with braces in a @code{GrandStaff}.
235 As the context names tell, @code{PianoStaff} is used for notating
236 piano music and @code{ChoirStaff} for all kind of vocal ensemble music.
241 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
242 {use-square-bracket-at-the-start-of-a-staff-group.ly}
244 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
245 {display-bracket-with-only-one-staff-in-a-system.ly}
247 @cindex mensurstriche layout
248 @cindex renaissance music
249 @cindex transcription of mensural music
250 @cindex mensural music, transcription of
252 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
253 {mensurstriche-layout-bar-lines-between-the-staves.ly}
254 @c FIXME: move to NR 2.8.x when sectioning is ready
258 Music Glossary: @rglos{brace},
259 @rglos{bracket}, @rglos{grand staff}.
261 Snippets: @lsrdir{Staff,Staff-notation}
263 Internals Reference: @internalsref{Staff}, @internalsref{ChoirStaff},
264 @internalsref{GrandStaff}, @internalsref{PianoStaff},
265 @internalsref{StaffGroup}, @internalsref{systemStartDelimiter},
266 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace},
267 @internalsref{SystemStartBracket}, @internalsref{systemStartSquare}.
270 @node Deeper nested staff groups
271 @subsubsection Deeper nested staff groups
273 There are also two inner staff contexts named @code{InnerStaffGroup}
274 and @code{InnerChoirStaffGroup} besides the grouping contexts mentioned
275 in @ref{Grouping staves}. They behave in the same way as their simple
276 counterparts, except that they are contained in another staff grouping
277 context, thus producing one more bracket on top of the existing one.
278 Note that @code{GrandStaff} and @code{PianoStaff} do not have any inner
279 grouping contexts. They can both be inside any other staff context,
280 including inner staff groups, though.
282 Here is an example of an orchestral score using groupings and nesting
283 of these groupings. Note that the instrument names are omitted from the
284 source code, for instructions how to set them see @ref{Instrument names}.
286 @cindex staff, nested
287 @cindex staves, nested
288 @cindex nesting of staves
289 @cindex system start delimiters, nested
290 @cindex nested staff brackets
291 @cindex brackets, nesting of
292 @cindex braces, nesting of
293 @cindex inner staff group
294 @cindex inner choir staff group
299 \new StaffGroup %woodwinds
301 \new Staff @{ c'1 d' @} %flute
302 \new InnerStaffGroup <<
303 \new Staff @{ c' d' @} %sax
304 \new Staff @{ c' d' @} %oboe
305 \new Staff @{ c' d' @} %English horn
307 \new Staff @{ \clef bass c d @} %bassoon
309 \new StaffGroup %the brass group
311 \new Staff @{ c' d' @} %trumpet
312 \new Staff @{ \clef bass c d @} %trombone
313 \new GrandStaff %the horns need a GrandStaff (same instrument)
315 \new Staff @{ c' d' @}
316 \new Staff @{ \clef bass c d @}
319 \new ChoirStaff %for setting vocal music
321 \new Staff @{ c' d' @}
322 \new InnerChoirStaff <<
323 \new Staff @{ c' d' @}
324 \new Staff @{ c' d' @}
326 \new Staff @{ c' d' @}
328 \new PianoStaff %for the piano
330 \new Staff @{ c' d' @}
331 \new Staff @{\clef bass c d @}
336 @c no verbatim so instrument names are only in the music
337 @lilypond[ragged-right,quote]
339 \new StaffGroup %woodwinds
341 \new Staff {\set Staff.instrumentName = "fl" c'1 d' } %flute
342 \new InnerStaffGroup <<
343 \new Staff { \set Staff.instrumentName = "sax" c' d' } %sax 1
344 \new Staff { \set Staff.instrumentName = "ob" c' d' } %sax 2
345 \new Staff { \set Staff.instrumentName = "ca" c' d' }
347 \new Staff {\set Staff.instrumentName = "bs" \clef bass c d } %bassoon
349 \new StaffGroup %the brass group
351 \new Staff {\set Staff.instrumentName = "tr" c' d' } %trumpet
352 \new Staff {\set Staff.instrumentName = "tb" \clef bass c d } %trombone
353 \new GrandStaff %the horns need a GrandStaff (same instrument)
355 \new Staff {\set Staff.instrumentName = "cor1" c' d' }
356 \new Staff {\set Staff.instrumentName = "cor2" \clef bass c d }
359 \new ChoirStaff %for setting vocal music
361 \new Staff {\set Staff.instrumentName = "S" c' d' }
362 \new InnerChoirStaff <<
363 \new Staff {\set Staff.instrumentName = "A1" c' d' }
364 \new Staff {\set Staff.instrumentName = "A2" c' d' }
366 \new Staff {\set Staff.instrumentName = "T" c' d' }
368 \new PianoStaff %for the piano
371 \new Staff {\clef bass c d }
379 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
385 Snippets: @lsrdir{Staff,Staff-notation}
387 Internals Reference: @internalsref{InnerChoirStaffGroup},
388 @internalsref{InnerStaffGroup}, @internalsref{SystemStartBar},
389 @internalsref{SystemStartBrace}, @internalsref{SystemStartBracket},
390 @internalsref{systemStartDelimiterHierarchy}.
394 @node Modifying single staves
395 @subsection Modifying single staves
397 This section explains how to change specific attributes of one
398 staff like the staff lines, starting and stopping of staves, sizing
399 of staves, and setting ossia sections.
408 @subsubsection Staff symbol
410 @cindex adjusting staff symbol
411 @cindex drawing staff symbol
412 @cindex staff symbol, setting of
413 @cindex stop staff lines
414 @cindex start staff lines
415 @cindex staff lines, amount of
416 @cindex staff lines, number of
417 @cindex staff line, thickness of
418 @cindex amount of staff lines
419 @cindex thickness of staff lines
420 @cindex ledger lines, setting
421 @cindex setting of ledger lines
422 @cindex spacing of ledger lines
423 @cindex number of staff lines
425 The layout object which draws the lines of a staff is called
426 @code{staff symbol}. The staff symbol may be tuned in number,
427 thickness and distance of lines, using properties. It may also
428 be started and stopped at every point in the score.
432 Changing the number of staff lines is done by overriding
433 @code{line-count}. You may need to adjust the clef position
434 and the position of the middle C to fit to the new staff. For
435 an explanation, see the snippet section in @ref{Displaying pitches}.
437 @lilypond[verbatim,ragged-right,quote]
439 \override Staff.StaffSymbol #'line-count = #3
445 The placement and amount of the staff lines can also set totally
446 manually by defining their positions explicitly. The middle
447 of the staff has the value of 0, each half staff space up and down
448 adds an integer. The default values are 4 2 0 -2 -4. Bar lines
449 are drawn according to the calculated width of the system, but
450 they are always centered. As the
451 example shows, the positions of the notes are not influenced
452 by the position of the staff lines.
454 @lilypond[verbatim,ragged-right,quote]
456 \override StaffSymbol #' line-positions = #' ( 7 3 0 -4 -6 -7 )
463 The staff line thickness can be set by overriding the @code{thickness}
464 property. Note that it gets applied also to ledger lines and stems,
465 since they depend on the staff line thickness. The argument of
466 @code{thickness} is a factor of @code{line-thickness} which defaults
467 to the normal staff line thickness.
469 @lilypond[verbatim,ragged-right,quote]
471 \override StaffSymbol #'thickness = #3
478 The thickness of the ledger lines can also be set independent of the
479 settings for staff lines. The setting is calculated from a pair of
480 values which will be added for the final thickness. The first value
481 is the staff line thickness multiplied by a factor, the second is
482 the staff space multiplied by a factor. In the example the ledger
483 lines get their thickness from one staff line thickness plus 1/5
484 staff space, so they are heavier than a normal staff line.
486 @lilypond[verbatim,ragged-right,quote]
488 \override StaffSymbol #' ledger-line-thickness = #' ( 1 . 0.2 ) }
495 The distance of the stafflines can be changed with the
496 @code{staff-space} property. Its argument is the amount
497 of staff spaces that should be inserted between the lines.
498 The default value is 1. Setting the distance has
499 influence on the staff lines as well as on ledger lines.
501 @lilypond[verbatim,ragged-right,quote]
503 \override StaffSymbol #' staff-space = #1.5
510 The length of the staff line can also be adjusted
511 manually. The unit is one staff space. Spacing
512 of the objects inside the staff does not get influenced
515 @lilypond[verbatim,ragged-right,quote]
517 \override StaffSymbol #' width = #23
525 These properties can only be set before instantiating the staff symbol.
526 But it is possible to start and stop staves in the middle of a score,
527 so each new setting will be applied to the newly instantiated staff.
529 @lilypond[verbatim,relative=2,fragment]
531 %Set here the overrides for the staff
532 \override Staff.StaffSymbol #'line-count = 2
533 \stopStaff \startStaff
535 %Revert to the default
536 \revert Staff.StaffSymbol #'line-count
537 \stopStaff \startStaff
543 @code{\stopStaff}, @code{\startStaff}
547 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
548 {making-some-staff-lines-thicker-than-the-others.ly}
552 Glossary: @rglos{line}, @rglos{ledger line}, @rglos{staff}.
554 Internals Reference: @internalsref{StaffSymbol}.
558 When setting staff lines manually, bar lines are
559 always drawn centered on the position 0, so the
560 maximum distance of the bar lines in either direction
565 @subsubsection Ossia staves
567 @cindex staff, Frenched
569 @cindex Frenched staves
570 @cindex staff, resizing of
571 @cindex resizing of staves
573 Tweaking the staff object allows to resize the staff:
575 @lilypond[verbatim,ragged-right,quote]
578 \override StaffSymbol #'staff-space = #(magstep -3)
579 \override StaffSymbol #'thickness = # (magstep -3)
588 This involves shrinking the staff spaces, the staff lines and
589 the font size by the factor 3. You find a more precise explanation
590 in @ref{Setting the staff size}.
592 The @emph{ossia} section in the next example are just put parallel
593 to the main staff with @code{<<} and @code{>>} brackets. The @emph{ossia}
594 staff is stopped and started explicitely and white space is inserted
595 with the @code{\skip} command.
597 @lilypond[verbatim,relative=2,quote]
601 %No time signature in the ossia staff
602 \remove "Time_signature_engraver"
604 \override StaffSymbol #'staff-space = #(magstep -3)
605 \override StaffSymbol #'thickness = # (magstep -3)
614 bes8[^"ossia" g bes g]
622 \new Staff \relative c'' {
632 @c lilypondfile{Making-some-staff-lines-thicker-than-the-others.ly}
637 Music Glossary: @rglos{ossia}, @rglos{staff}, @rglos{Frenched staff}.
639 Snippets: @lsrdir{Staff,Staff-notation}.
641 Internals Reference: @internalsref{StaffSymbol}.
645 @subsubsection Hiding staves
647 @cindex Frenched scores
648 @cindex staff, hiding
650 @cindex hiding of staves
652 @cindex Frenched staves
654 In orchestral scores, staff lines that only have rests are usually
655 removed; this saves some space. This style is called @q{French
656 Score}. For the @code{Lyrics}, @code{ChordNames}, and
657 @code{FiguredBass} contexts, this is switched on by default. When
658 the lines of these contexts turn out empty after the line-breaking
659 process, they are removed.
661 For normal staves this behaviour is called
662 with the @code{\RemoveEmptyStaffContext} command. It is set
663 in the @code{\layout} block. As a result staves containing
664 nothing or whole mesure rests are removed after a line break.
666 @lilypond[quote,ragged-right,verbatim]
668 \context { \RemoveEmptyStaffContext }
672 \new Staff { e4 f g a \break c1 }
673 \new Staff { c4 d e f \break R1 }
679 To remove other types of contexts, use
680 @code{\AncientRemoveEmptyStaffContext} or
681 @code{\RemoveEmptyRhythmicStaffContext}.
685 Another application of the @code{\RemoveEmptyStaffContext} is to
686 make ossia sections, i.e., alternative melodies on a separate
687 piece of staff, with help of a Frenched staff. See @ref{Ossia staves}.
689 You can make the staff lines invisible by removing the
690 @code{Staff_symbol_engraver} from the @code{Staff} context.
693 @lilypond[quote,ragged-right,verbatim]
695 \context Staff \relative c'' { c8 c c16 c c c }
699 \remove Staff_symbol_engraver
707 The first empty staff can also be removed from the score with a
708 setting in the @code{VerticalAxisGroup} property. This can be done
709 globally inside the @code{\layout} block, or locally inside the
710 specific staff that should be removed. In the latter case,
711 you have to specify the context (@code{Staff} applies only to the
712 current staff) in front of the property.
714 The lower staff of the second staff group is not removed,
715 because the setting applies only to the specific staff inside
716 of which it is written.
718 @lilypond[quote,ragged-right,verbatim,relative=2]
721 \RemoveEmptyStaffContext
722 %To use the setting globally, uncomment the following line:
723 %\override VerticalAxisGroup #'remove-first = ##t
731 %To use the setting globally, comment this line, uncomment the line above
732 \override Staff.VerticalAxisGroup #'remove-first = ##t
737 \new Staff { e4 f g a \break c1 }
738 \new Staff { R \break R1 }
742 @c FIXME not yet in master
743 @c lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
744 @c {remove-the-first-empy-line.ly}
748 @code{\RemoveEmptyStaffContext},
749 @code{\AncientRemoveEmptyStaffContext},
750 @code{\RemoveEmptyRhythmicStaffContext},
754 Notation Reference: @ref{Staff symbol}.
756 Snippets: @lsrdir{Staff,Staff-notation}
758 Internals Reference: @internalsref{ChordNames},
759 @internalsref{FiguredBass}, @internalsref{Lyrics},
760 @internalsref{Staff}, @internalsref{VerticalAxisGroup}.
763 @subsection Writing parts
768 * Quoting other voices::
769 * Formatting cue notes::
772 @node Metronome marks
773 @subsubsection Metronome marks
776 @cindex beats per minute
777 @cindex metronome marking
779 Metronome settings can be entered as follows
782 \tempo @var{duration} = @var{per-minute}
785 In the MIDI output, they are interpreted as a tempo change. In
786 the layout output, a metronome marking is printed
790 @lilypond[quote,ragged-right,verbatim,fragment]
797 To change the tempo in the MIDI output without printing anything,
798 make the metronome marking invisible @example \once \override
799 Score.MetronomeMark #'transparent = ##t @end example
801 To print other metronome markings, use these markup commands
802 @lilypond[quote,ragged-right,verbatim,relative,fragment]
805 \smaller \general-align #Y #DOWN \note #"16." #1
807 \smaller \general-align #Y #DOWN \note #"8" #1
812 For more details, see @ref{Formatting text}.
817 Music Glossary: @rglos{metronome}, @rglos{metronomic indication},
818 @rglos{tempo indication}, @rglos{metronome mark}.
820 Notation Reference: @ref{Formatting text}.
822 Snippets: @lsrdir{Staff,Staff-notation}.
824 Internals Reference: @internalsref{MetronomeMark}, @ref{MIDI
830 Collisions are not checked. If you have notes above the top line
831 of the staff (or notes with articulations, slurs, text, etc), then
832 the metronome marking may be printed on top of musical symbols.
833 If this occurs, increase the padding of the metronome mark to
834 place it further away from the staff.
837 \override Score.MetronomeMark #'padding = #2.5
840 @c perhaps also an example of how to move it horizontally?
843 @node Instrument names
844 @subsubsection Instrument names
846 @cindex instrument names
847 @cindex instrument names, short
849 In an orchestral score, instrument names are printed at the left
852 This can be achieved by setting @code{Staff}.@code{instrumentName} and
853 @code{Staff}.@code{shortInstrumentName}, or
854 @code{PianoStaff}.@code{instrumentName} and
855 @code{PianoStaff}.@code{shortInstrumentName}. This will print text
856 before the start of the staff. For the first staff,
857 @code{instrumentName} is used. If set, @code{shortInstrumentName} is
858 used for the following staves.
860 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
861 \set Staff.instrumentName = "Ploink "
862 \set Staff.shortInstrumentName = "Plk "
868 You can also use markup texts to construct more complicated
869 instrument names, for example
871 @lilypond[quote,fragment,verbatim,ragged-right]
872 \set Staff.instrumentName = \markup {
873 \column { "Clarinetti"
874 \line { "in B" \smaller \flat } } }
878 @cindex instrument names, centering
880 As instrument names are centered by default, multi line names
881 are better entered using @code{\center-align}:
883 @lilypond[quote,verbatim,ragged-right]
886 \set Staff.instrumentName = \markup \center-align {
888 \line { "in B" \smaller \flat }
893 \set Staff.instrumentName = "Vibraphone"
900 For longer instrument names, it may be useful to increase the
901 @code{indent} setting in the @code{\layout} block.
903 Short instrument names, printed before the systems following the first
904 one, are also centered by default, in a space which width is given by
905 the @code{short-indent} variable of the @code{\layout} block.
907 To add instrument names to other contexts (such as
908 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}), the
909 engraver must be added to that context.
913 \context @{\GrandStaff \consists "Instrument_name_engraver"@}
918 More information about adding and removing engravers can be found
919 in @ref{Modifying context plug-ins}.
921 @cindex instrument names, changing
923 Instrument names may be changed in the middle of a piece,
925 @lilypond[quote,fragment,verbatim,ragged-right]
926 \set Staff.instrumentName = "First"
927 \set Staff.shortInstrumentName = "one"
930 \set Staff.instrumentName = "Second"
931 \set Staff.shortInstrumentName = "two"
939 Notation Reference: @ref{Modifying context plug-ins}.
941 Snippets: @lsrdir{Staff,Staff-notation}
943 Internals Reference: @internalsref{InstrumentName},
944 @internalsref{PianoStaff}, @internalsref{Staff}.
947 @node Quoting other voices
948 @subsubsection Quoting other voices
951 @cindex quoting other voices
955 With quotations, fragments of other parts can be inserted into a
956 part directly. Before a part can be quoted, it must be marked
957 especially as quotable. This is done with the @code{\addQuote}
961 \addQuote @var{name} @var{music}
966 Here, @var{name} is an identifying string. The @var{music} is any
967 kind of music. Here is an example of @code{\addQuote}
970 \addQuote clarinet \relative c' @{
975 This command must be entered at toplevel, i.e., outside any music
976 blocks. Typically, one would use an already defined music event
980 clarinet = \relative c' @{
983 \addQuote clarinet @{ \clarinet @}
987 After calling @code{\addQuote}, the quotation may then be done
988 with @code{\quoteDuring} or @code{\cueDuring},
991 \quoteDuring #@var{name} @var{music}
994 During a part, a piece of music can be quoted with the
995 @code{\quoteDuring} command.
998 \quoteDuring #"clarinet" @{ s2. @}
1001 This would cite three quarter notes (the duration of @code{s2.})
1002 of the previously added @code{clarinet} voice.
1004 More precisely, it takes the current time-step of the part being
1005 printed, and extracts the notes at the corresponding point of the
1006 @code{\addQuote}d voice. Therefore, the argument to
1007 @code{\addQuote} should be the entire part of the voice to be
1008 quoted, including any rests at the beginning.
1010 It is possible to use another music expression instead of
1011 @code{s}, thus creating a polyphonic section, but this may not
1012 always give the desired result.
1014 Quotations take into account the transposition of both source and
1015 target instruments, if they are specified using the
1016 @code{\transposition} command.
1018 @lilypond[quote,ragged-right,verbatim]
1019 \addQuote clarinet \relative c' {
1025 e'8 f'8 \quoteDuring #"clarinet" { s2 }
1029 The type of events that are present in the quoted music can be
1030 trimmed with the @code{quotedEventTypes} property. The default
1031 value is @code{(note-event rest-event)}, which means that only
1032 notes and rests of the quoted voice end up in the
1033 @code{\quoteDuring}. Setting
1036 \set Staff.quotedEventTypes =
1037 #'(note-event articulation-event dynamic-event)
1041 will quote notes (but no rests), together with scripts and
1046 Only the contents of the first @code{Voice} occurring in an
1047 @code{\addQuote} command will be considered for quotation, so
1048 @var{music} can not contain @code{\new} and @code{\context Voice}
1049 statements that would switch to a different Voice.
1051 Quoting grace notes is broken and can even cause LilyPond to
1054 Quoting nested triplets may result in poor notation.
1056 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
1057 written entirely in lower-case letters: @code{\addquote}.
1061 Notation Reference: @ref{Instrument transpositions}.
1063 Snippets: @lsrdir{Staff,Staff-notation}
1065 Internals Reference: @internalsref{QuoteMusic}, @internalsref{Voice}.
1068 @node Formatting cue notes
1069 @subsubsection Formatting cue notes
1073 @cindex cue notes, formatting
1075 @cindex quoting other voices
1076 @cindex cues, formatting
1078 The previous section deals with inserting notes from another
1079 voice. There is a more advanced music function called
1080 @code{\cueDuring}, which makes formatting cue notes easier.
1085 \cueDuring #@var{name} #@var{updown} @var{music}
1088 This will insert notes from the part @var{name} into a
1089 @code{Voice} called @code{cue}. This happens
1090 simultaneously with @var{music}, which usually is a rest. When
1091 the cue notes start, the staff in effect becomes polyphonic for a
1092 moment. The argument @var{updown} determines whether the cue
1093 notes should be notated as a first or second voice.
1096 @lilypond[verbatim,ragged-right]
1099 \override Stem #'length-fraction = #0.8
1100 \override Beam #'thickness = #0.384
1101 \override Beam #'length-fraction = #0.8
1104 \addQuote clarinet \relative {
1109 \new Staff \relative <<
1111 % setup a context for cue notes.
1112 \new Voice = "cue" { \smaller \skip 1*21 }
1114 \set Score.skipBars = ##t
1118 \cueDuring #"clarinet" #UP {
1127 Here are a couple of hints for successful cue notes:
1131 Cue notes have smaller font sizes.
1134 The cued part is marked with the instrument playing the cue.
1137 When the original part takes over again, this should be marked
1138 with the name of the original instrument.
1141 Any other changes introduced by the cued part should also be
1142 undone. For example, if the cued instrument plays in a different
1143 clef, the original clef should be stated once again.
1147 The macro @code{\transposedCueDuring} is useful to add cues to
1148 instruments which use a completely different octave range (for
1149 example, having a cue of a piccolo flute within a contra bassoon
1152 @lilypond[verbatim,ragged-right,quote]
1153 picc = \relative c''' {
1159 \addQuote "picc" { \picc }
1161 cbsn = \relative c, {
1164 \transposedCueDuring #"picc" #UP c,, { R1 } |
1169 \context Staff = "picc" \picc
1170 \context Staff = "cbsn" \cbsn
1176 Snippets: @lsrdir{Staff,Staff-notation}.
1178 Internals Reference: @internalsref{Voice}.