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.
10 @section Staff notation
12 Notes, dynamic signs, etc., are grouped with a set of horizontal
13 lines, called a staff (plural @q{staves}). In LilyPond, these
14 lines are drawn using a separate layout object called @code{staff
17 Two or more staves can be grouped vertically in a
18 @internalsref{GrandStaff}, a @internalsref{StaffGroup}, or a
19 @internalsref{ChoirStaff}.
28 @node Displaying staves
29 @subsection Displaying staves
32 * System start delimiters::
37 @node System start delimiters
38 @unnumberedsubsubsec System start delimiters
40 @cindex start of system
41 @cindex Staff, multiple
42 @cindex bracket, vertical
43 @cindex brace, vertical
48 Many scores consist of more than one staff. These staves can be
49 grouped in several different ways:
53 In a @internalsref{GrandStaff}, the group is started with a brace
54 at the left, and bar lines are connected between the staves.
56 @lilypond[verbatim,ragged-right,quote]
65 In a @internalsref{StaffGroup}, the barlines will be drawn through
66 all the staves, but the group is started with a bracket.
68 @lilypond[verbatim,ragged-right,quote]
77 In a @internalsref{ChoirStaff}, the group is started with a
78 bracket, but bar lines are not connected.
80 @lilypond[verbatim,ragged-right,quote]
89 If no context is specified, the default properties for the score
90 will be used: the group is started with a vertical line, and the
91 bar lines are not connected.
93 @lilypond[verbatim,ragged-right,quote]
101 In addition to these four staff group types, other groupings can
102 be produced by changing various properties. E.g., the
103 @q{Mensurstriche} layout common in Renaissance music, with
104 barlines running between but not through the staves, can be
105 produced from a @code{StaffGroup} or @code{GrandStaff} context if
106 the barlines are made transparent in the @code{Staff} itself, with
107 the command @code{\override Staff.BarLine #'transparent = ##t}
109 @cindex staff, nested
111 Staff groups can be nested, using the context
112 @code{InnerStaffGroup} or @code{InnerChoirStaff}; see
113 @lsr{staff,staff-brackets.ly}
118 More complex nesting can be accomplished using the property
119 @internalsref{systemStartDelimiterHierarchy}:
121 @lilypond[quote,ragged-right,verbatim]
124 \set StaffGroup.systemStartDelimiterHierarchy
125 = #'(SystemStartSquare (SystemStartBracket a
126 (SystemStartSquare b)) d)
137 Each staff group context sets the property
138 @code{systemStartDelimiter} to one of the values
139 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace},
140 and @internalsref{SystemStartBracket}. A fourth delimiter,
141 @code{systemStartSquare}, is also available, but must be
142 instantiated manually.
146 To display a bracket even if there is only one staff, see
147 @lsr{staff,display-bracket-with-only-one-staff-in-a
152 @unnumberedsubsubsec Staff symbol
154 @cindex adjusting staff symbol
156 The layout object which draws the lines of a staff is called
157 @code{staff symbol}. The staff symbol may be tuned in the number,
158 thickness and distance of lines, using properties. This is
159 demonstrated in the example files
160 @lsr{staff,changing-the-number-of-lines-in-a-staff.ly} and
161 @lsr{staff,changing-the-staff-size.ly}.
163 In addition, staves may be started and stopped at will. This is
164 done with @code{\startStaff} and @code{\stopStaff}.
166 @lilypond[verbatim,relative=2,fragment]
168 \override Staff.StaffSymbol #'line-count = 2
169 \stopStaff \startStaff
171 \revert Staff.StaffSymbol #'line-count
172 \stopStaff \startStaff
176 In combination with Frenched staves, this may be used to typeset
177 @emph{ossia} sections. An example is shown here
179 @cindex staves, Frenched
182 @lilypond[verbatim,relative=2,quote]
186 \remove "Time_signature_engraver"
188 \override StaffSymbol #'staff-space = #(magstep -2)
197 bes8[^"ossia" g bes g]
214 @cindex staff lines, setting number of
215 @cindex staff lines, setting thickness of
216 @cindex thickness of staff lines, setting
217 @cindex number of staff lines, setting
221 Internals Reference: @internalsref{StaffSymbol},
222 @internalsref{DrumStaff}.
224 Examples: @lsrdir{staff}
228 @unnumberedsubsubsec Hiding staves
230 @cindex Frenched scores
231 @cindex staves, hiding
233 In orchestral scores, staff lines that only have rests are usually
234 removed; this saves some space. This style is called @q{French
235 Score}. For @internalsref{Lyrics}, @internalsref{ChordNames} and
236 @internalsref{FiguredBass}, this is switched on by default. When
237 the lines of these contexts turn out empty after the line-breaking
238 process, they are removed.
240 For normal staves, a specialized @internalsref{Staff} context is
241 available, which does the same: staves containing nothing (or only
242 multi-measure rests) are removed. The context definition is
243 stored in @code{\RemoveEmptyStaffContext} variable. Observe how
244 the second staff in this example disappears in the second line
246 @lilypond[quote,ragged-right,verbatim]
248 \context { \RemoveEmptyStaffContext }
253 \new Staff { e4 f g a \break c1 }
254 \new Staff { c4 d e f \break R1 }
259 The first system shows all staves in full. If empty staves should
260 be removed from the first system too, set @code{remove-first} to
261 true in @internalsref{VerticalAxisGroup}.
264 \override Score.VerticalAxisGroup #'remove-first = ##t
267 To remove other types of contexts, use
268 @code{\AncientRemoveEmptyStaffContext} or
269 @code{\RemoveEmptyRhythmicStaffContext}.
271 Another application of the @code{\RemoveEmptyStaffContext} is to
272 make ossia sections, i.e., alternative melodies on a separate
273 piece of staff, with help of a Frenched staff. See @ref{Staff
276 You can make the staff lines invisible by removing the
277 @code{Staff_symbol_engraver} from the @code{Staff} context.
280 @lilypond[quote,ragged-right,verbatim]
282 \context Staff \relative c'' { c8 c c16 c c c }
286 \remove Staff_symbol_engraver
293 @subsection Writing parts
298 * Quoting other voices::
299 * Formatting cue notes::
302 @node Metronome marks
303 @unnumberedsubsubsec Metronome marks
306 @cindex beats per minute
307 @cindex metronome marking
309 Metronome settings can be entered as follows
312 \tempo @var{duration} = @var{per-minute}
315 In the MIDI output, they are interpreted as a tempo change. In
316 the layout output, a metronome marking is printed
320 @lilypond[quote,ragged-right,verbatim,fragment]
327 To change the tempo in the MIDI output without printing anything,
328 make the metronome marking invisible @example \once \override
329 Score.MetronomeMark #'transparent = ##t @end example
331 To print other metronome markings, use these markup commands
332 @lilypond[quote,ragged-right,verbatim,relative,fragment]
335 \smaller \general-align #Y #DOWN \note #"16." #1
337 \smaller \general-align #Y #DOWN \note #"8" #1
342 For more details, see @ref{Text markup}.
347 Internals Reference: @internalsref{MetronomeMark}, @ref{MIDI
353 Collisions are not checked. If you have notes above the top line
354 of the staff (or notes with articulations, slurs, text, etc), then
355 the metronome marking may be printed on top of musical symbols.
356 If this occurs, increase the padding of the metronome mark to
357 place it further away from the staff.
360 \override Score.MetronomeMark #'padding = #2.5
363 @c perhaps also an example of how to move it horizontally?
365 @node Instrument names
366 @unnumberedsubsubsec Instrument names
368 In an orchestral score, instrument names are printed at the left
371 This can be achieved by setting
372 @internalsref{Staff}.@code{instrumentName} and
373 @internalsref{Staff}.@code{shortInstrumentName}, or
374 @internalsref{PianoStaff}.@code{instrumentName} and
375 @internalsref{PianoStaff}.@code{shortInstrumentName}. This will
376 print text before the start of the staff. For the first staff,
377 @code{instrumentName} is used. If set, @code{shortInstrumentName}
378 is used for the following staves.
380 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
381 \set Staff.instrumentName = "Ploink "
382 \set Staff.shortInstrumentName = "Plk "
388 You can also use markup texts to construct more complicated
389 instrument names, for example
391 @lilypond[quote,fragment,verbatim,ragged-right]
392 \set Staff.instrumentName = \markup {
393 \column { "Clarinetti"
394 \line { "in B" \smaller \flat } } }
398 If you wish to center the instrument names, you must center all of
401 @lilypond[quote,verbatim,ragged-right]
404 \set Staff.instrumentName = \markup {
405 \center-align { "Clarinetti"
406 \line { "in B" \smaller \flat } } }
410 \set Staff.instrumentName =
411 \markup{ \center-align { Vibraphone }}
418 For longer instrument names, it may be useful to increase the
419 @code{indent} setting in the @code{\layout} block.
421 To center instrument names while leaving extra space to the right,
423 @lilypond[quote,verbatim,ragged-right]
424 \new StaffGroup \relative
427 \set Staff.instrumentName =
428 \markup { \hcenter-in #10 "blabla" }
432 \set Staff.instrumentName =
433 \markup { \hcenter-in #10 "blo" }
439 To add instrument names to other contexts (such as
440 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}), the
441 engraver must be added to that context.
445 \context @{\GrandStaff \consists "Instrument_name_engraver"@}
450 More information about adding and removing engravers can be found
451 in @ref{Modifying context plug-ins}.
453 Instrument names may be changed in the middle of a piece,
455 @lilypond[quote,fragment,verbatim,ragged-right]
456 \set Staff.instrumentName = "First"
457 \set Staff.shortInstrumentName = "one"
460 \set Staff.instrumentName = "Second"
461 \set Staff.shortInstrumentName = "two"
469 Internals Reference: @internalsref{InstrumentName}.
472 @node Quoting other voices
473 @unnumberedsubsubsec Quoting other voices
477 With quotations, fragments of other parts can be inserted into a
478 part directly. Before a part can be quoted, it must be marked
479 especially as quotable. This is done with the @code{\addQuote}
483 \addQuote @var{name} @var{music}
488 Here, @var{name} is an identifying string. The @var{music} is any
489 kind of music. Here is an example of @code{\addQuote}
492 \addQuote clarinet \relative c' @{
497 This command must be entered at toplevel, i.e., outside any music
498 blocks. Typically, one would use an already defined music event
502 clarinet = \relative c' @{
505 \addQuote clarinet @{ \clarinet @}
509 After calling @code{\addQuote}, the quotation may then be done
510 with @code{\quoteDuring} or @code{\cueDuring},
513 \quoteDuring #@var{name} @var{music}
516 During a part, a piece of music can be quoted with the
517 @code{\quoteDuring} command.
520 \quoteDuring #"clarinet" @{ s2. @}
523 This would cite three quarter notes (the duration of @code{s2.})
524 of the previously added @code{clarinet} voice.
526 More precisely, it takes the current time-step of the part being
527 printed, and extracts the notes at the corresponding point of the
528 @code{\addQuote}d voice. Therefore, the argument to
529 @code{\addQuote} should be the entire part of the voice to be
530 quoted, including any rests at the beginning.
532 It is possible to use another music expression instead of
533 @code{s}, thus creating a polyphonic section, but this may not
534 always give the desired result.
536 Quotations take into account the transposition of both source and
537 target instruments, if they are specified using the
538 @code{\transposition} command.
540 @lilypond[quote,ragged-right,verbatim]
541 \addQuote clarinet \relative c' {
547 e'8 f'8 \quoteDuring #"clarinet" { s2 }
551 The type of events that are present in the quoted music can be
552 trimmed with the @code{quotedEventTypes} property. The default
553 value is @code{(note-event rest-event)}, which means that only
554 notes and rests of the quoted voice end up in the
555 @code{\quoteDuring}. Setting
558 \set Staff.quotedEventTypes =
559 #'(note-event articulation-event dynamic-event)
563 will quote notes (but no rests), together with scripts and
568 Only the contents of the first @internalsref{Voice} occurring in
569 an @code{\addQuote} command will be considered for quotation, so
570 @var{music} can not contain @code{\new} and @code{\context Voice}
571 statements that would switch to a different Voice.
573 Quoting grace notes is broken and can even cause LilyPond to
576 Quoting nested triplets may result in poor notation.
578 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
579 written entirely in lower-case letters: @code{\addquote}.
583 In this manual: @ref{Instrument transpositions}.
585 Examples: @lsr{parts,quote.ly},
586 @lsr{parts,quote-transportation.ly}
588 Internals Reference: @internalsref{QuoteMusic}.
591 @node Formatting cue notes
592 @unnumberedsubsubsec Formatting cue notes
594 @cindex cues, formatting
596 The previous section deals with inserting notes from another
597 voice. There is a more advanced music function called
598 @code{\cueDuring}, which makes formatting cue notes easier.
603 \cueDuring #@var{name} #@var{updown} @var{music}
606 This will insert notes from the part @var{name} into a
607 @internalsref{Voice} called @code{cue}. This happens
608 simultaneously with @var{music}, which usually is a rest. When
609 the cue notes start, the staff in effect becomes polyphonic for a
610 moment. The argument @var{updown} determines whether the cue
611 notes should be notated as a first or second voice.
614 @lilypond[verbatim,ragged-right]
617 \override Stem #'length-fraction = #0.8
618 \override Beam #'thickness = #0.384
619 \override Beam #'length-fraction = #0.8
622 \addQuote clarinet \relative {
627 \new Staff \relative <<
629 % setup a context for cue notes.
630 \new Voice = "cue" { \smaller \skip 1*21 }
632 \set Score.skipBars = ##t
636 \cueDuring #"clarinet" #UP {
645 Here are a couple of hints for successful cue notes
649 Cue notes have smaller font sizes.
652 the cued part is marked with the instrument playing the cue.
655 when the original part takes over again, this should be marked
656 with the name of the original instrument.
658 Any other changes introduced by the cued part should also be
659 undone. For example, if the cued instrument plays in a different
660 clef, the original clef should be stated once again.
664 The macro @code{\transposedCueDuring} is useful to add cues to
665 instruments which use a completely different octave range (for
666 example, having a cue of a piccolo flute within a contra bassoon
669 @lilypond[verbatim,ragged-right,quote]
670 picc = \relative c''' {
676 \addQuote "picc" { \picc }
678 cbsn = \relative c, {
681 \transposedCueDuring #"picc" #UP c,, { R1 } |
686 \context Staff = "picc" \picc
687 \context Staff = "cbsn" \cbsn