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 @lilypondfile[quote,ragged-right,line-width=16\cm,staffsize=16]
15 Notes, dynamic signs, etc., are grouped with a set of horizontal
16 lines, called a staff (plural @q{staves}). In LilyPond, these
17 lines are drawn using a separate layout object called @code{staff
20 Two or more staves can be grouped vertically in a
21 @internalsref{GrandStaff}, a @internalsref{StaffGroup}, or a
22 @internalsref{ChoirStaff}.
31 @node Displaying staves
32 @subsection Displaying staves
35 * System start delimiters::
40 @node System start delimiters
41 @unnumberedsubsubsec System start delimiters
43 @cindex start of system
44 @cindex Staff, multiple
45 @cindex bracket, vertical
46 @cindex brace, vertical
51 Many scores consist of more than one staff. These staves can be
52 grouped in several different ways:
56 In a @internalsref{GrandStaff}, the group is started with a brace
57 at the left, and bar lines are connected between the staves.
59 @lilypond[verbatim,ragged-right,quote]
68 In a @internalsref{StaffGroup}, the bar lines will be drawn through
69 all the staves, but the group is started with a bracket.
71 @lilypond[verbatim,ragged-right,quote]
80 In a @internalsref{ChoirStaff}, the group is started with a
81 bracket, but bar lines are not connected.
83 @lilypond[verbatim,ragged-right,quote]
92 If no context is specified, the default properties for the score
93 will be used: the group is started with a vertical line, and the
94 bar lines are not connected.
96 @lilypond[verbatim,ragged-right,quote]
104 In addition to these four staff group types, other groupings can
105 be produced by changing various properties. E.g., the
106 @q{Mensurstriche} layout common in Renaissance music, with
107 bar lines running between but not through the staves, can be
108 produced from a @code{StaffGroup} or @code{GrandStaff} context if
109 the bar lines are made transparent in the @code{Staff} itself, with
110 the command @code{\override Staff.BarLine #'transparent = ##t}
112 @cindex staff, nested
114 Staff groups can be nested, using the context
115 @code{InnerStaffGroup} or @code{InnerChoirStaff}; see
116 @lsr{staff,staff-brackets.ly}
121 More complex nesting can be accomplished using the property
122 @internalsref{systemStartDelimiterHierarchy}:
124 @lilypond[quote,ragged-right,verbatim]
127 \set StaffGroup.systemStartDelimiterHierarchy
128 = #'(SystemStartSquare (SystemStartBracket a
129 (SystemStartSquare b)) d)
140 Snippets: @lsrdir{staff}
142 Each staff group context sets the property
143 @code{systemStartDelimiter} to one of the values
144 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace},
145 and @internalsref{SystemStartBracket}. A fourth delimiter,
146 @code{systemStartSquare}, is also available, but must be
147 instantiated manually.
151 To display a bracket even if there is only one staff, see
152 @lsr{staff,display-bracket-with-only-one-staff-in-a
157 @unnumberedsubsubsec Staff symbol
159 @cindex adjusting staff symbol
161 The layout object which draws the lines of a staff is called
162 @code{staff symbol}. The staff symbol may be tuned in the number,
163 thickness and distance of lines, using properties. This is
164 demonstrated in the example files
165 @lsr{staff,changing-the-number-of-lines-in-a-staff.ly} and
166 @lsr{staff,changing-the-staff-size.ly}.
168 In addition, staves may be started and stopped at will. This is
169 done with @code{\startStaff} and @code{\stopStaff}.
171 @lilypond[verbatim,relative=2,fragment]
173 \override Staff.StaffSymbol #'line-count = 2
174 \stopStaff \startStaff
176 \revert Staff.StaffSymbol #'line-count
177 \stopStaff \startStaff
181 In combination with Frenched staves, this may be used to typeset
182 @emph{ossia} sections. An example is shown here
184 @cindex staves, Frenched
187 @lilypond[verbatim,relative=2,quote]
191 \remove "Time_signature_engraver"
193 \override StaffSymbol #'staff-space = #(magstep -2)
202 bes8[^"ossia" g bes g]
219 @cindex staff lines, setting number of
220 @cindex staff lines, setting thickness of
221 @cindex thickness of staff lines, setting
222 @cindex number of staff lines, setting
226 Snippets: @lsrdir{staff}
228 Internals Reference: @internalsref{StaffSymbol},
229 @internalsref{DrumStaff}.
231 Examples: @lsrdir{staff}
235 @unnumberedsubsubsec Hiding staves
237 @cindex Frenched scores
238 @cindex staves, hiding
240 In orchestral scores, staff lines that only have rests are usually
241 removed; this saves some space. This style is called @q{French
242 Score}. For @internalsref{Lyrics}, @internalsref{ChordNames} and
243 @internalsref{FiguredBass}, this is switched on by default. When
244 the lines of these contexts turn out empty after the line-breaking
245 process, they are removed.
247 For normal staves, a specialized @internalsref{Staff} context is
248 available, which does the same: staves containing nothing (or only
249 multi-measure rests) are removed. The context definition is
250 stored in @code{\RemoveEmptyStaffContext} variable. Observe how
251 the second staff in this example disappears in the second line
253 @lilypond[quote,ragged-right,verbatim]
255 \context { \RemoveEmptyStaffContext }
260 \new Staff { e4 f g a \break c1 }
261 \new Staff { c4 d e f \break R1 }
266 The first system shows all staves in full. If empty staves should
267 be removed from the first system too, set @code{remove-first} to
268 true in @internalsref{VerticalAxisGroup}.
271 \override Score.VerticalAxisGroup #'remove-first = ##t
274 To remove other types of contexts, use
275 @code{\AncientRemoveEmptyStaffContext} or
276 @code{\RemoveEmptyRhythmicStaffContext}.
278 Another application of the @code{\RemoveEmptyStaffContext} is to
279 make ossia sections, i.e., alternative melodies on a separate
280 piece of staff, with help of a Frenched staff. See @ref{Staff
283 You can make the staff lines invisible by removing the
284 @code{Staff_symbol_engraver} from the @code{Staff} context.
287 @lilypond[quote,ragged-right,verbatim]
289 \context Staff \relative c'' { c8 c c16 c c c }
293 \remove Staff_symbol_engraver
301 Snippets: @lsrdir{staff}
304 @subsection Writing parts
309 * Quoting other voices::
310 * Formatting cue notes::
313 @node Metronome marks
314 @unnumberedsubsubsec Metronome marks
317 @cindex beats per minute
318 @cindex metronome marking
320 Metronome settings can be entered as follows
323 \tempo @var{duration} = @var{per-minute}
326 In the MIDI output, they are interpreted as a tempo change. In
327 the layout output, a metronome marking is printed
331 @lilypond[quote,ragged-right,verbatim,fragment]
338 To change the tempo in the MIDI output without printing anything,
339 make the metronome marking invisible @example \once \override
340 Score.MetronomeMark #'transparent = ##t @end example
342 To print other metronome markings, use these markup commands
343 @lilypond[quote,ragged-right,verbatim,relative,fragment]
346 \smaller \general-align #Y #DOWN \note #"16." #1
348 \smaller \general-align #Y #DOWN \note #"8" #1
353 For more details, see @ref{Text markup}.
358 Internals Reference: @internalsref{MetronomeMark}, @ref{MIDI
364 Collisions are not checked. If you have notes above the top line
365 of the staff (or notes with articulations, slurs, text, etc), then
366 the metronome marking may be printed on top of musical symbols.
367 If this occurs, increase the padding of the metronome mark to
368 place it further away from the staff.
371 \override Score.MetronomeMark #'padding = #2.5
374 @c perhaps also an example of how to move it horizontally?
378 Snippets: @lsrdir{staff}
380 @node Instrument names
381 @unnumberedsubsubsec Instrument names
383 In an orchestral score, instrument names are printed at the left
386 This can be achieved by setting
387 @internalsref{Staff}.@code{instrumentName} and
388 @internalsref{Staff}.@code{shortInstrumentName}, or
389 @internalsref{PianoStaff}.@code{instrumentName} and
390 @internalsref{PianoStaff}.@code{shortInstrumentName}. This will
391 print text before the start of the staff. For the first staff,
392 @code{instrumentName} is used. If set, @code{shortInstrumentName}
393 is used for the following staves.
395 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
396 \set Staff.instrumentName = "Ploink "
397 \set Staff.shortInstrumentName = "Plk "
403 You can also use markup texts to construct more complicated
404 instrument names, for example
406 @lilypond[quote,fragment,verbatim,ragged-right]
407 \set Staff.instrumentName = \markup {
408 \column { "Clarinetti"
409 \line { "in B" \smaller \flat } } }
413 If you wish to center the instrument names, you must center all of
416 @lilypond[quote,verbatim,ragged-right]
419 \set Staff.instrumentName = \markup {
420 \center-align { "Clarinetti"
421 \line { "in B" \smaller \flat } } }
425 \set Staff.instrumentName =
426 \markup{ \center-align { Vibraphone }}
433 For longer instrument names, it may be useful to increase the
434 @code{indent} setting in the @code{\layout} block.
436 To center instrument names while leaving extra space to the right,
438 @lilypond[quote,verbatim,ragged-right]
439 \new StaffGroup \relative
442 \set Staff.instrumentName =
443 \markup { \hcenter-in #10 "blabla" }
447 \set Staff.instrumentName =
448 \markup { \hcenter-in #10 "blo" }
454 To add instrument names to other contexts (such as
455 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}), the
456 engraver must be added to that context.
460 \context @{\GrandStaff \consists "Instrument_name_engraver"@}
465 More information about adding and removing engravers can be found
466 in @ref{Modifying context plug-ins}.
468 Instrument names may be changed in the middle of a piece,
470 @lilypond[quote,fragment,verbatim,ragged-right]
471 \set Staff.instrumentName = "First"
472 \set Staff.shortInstrumentName = "one"
475 \set Staff.instrumentName = "Second"
476 \set Staff.shortInstrumentName = "two"
484 Snippets: @lsrdir{staff}
486 Internals Reference: @internalsref{InstrumentName}.
489 @node Quoting other voices
490 @unnumberedsubsubsec Quoting other voices
494 With quotations, fragments of other parts can be inserted into a
495 part directly. Before a part can be quoted, it must be marked
496 especially as quotable. This is done with the @code{\addQuote}
500 \addQuote @var{name} @var{music}
505 Here, @var{name} is an identifying string. The @var{music} is any
506 kind of music. Here is an example of @code{\addQuote}
509 \addQuote clarinet \relative c' @{
514 This command must be entered at toplevel, i.e., outside any music
515 blocks. Typically, one would use an already defined music event
519 clarinet = \relative c' @{
522 \addQuote clarinet @{ \clarinet @}
526 After calling @code{\addQuote}, the quotation may then be done
527 with @code{\quoteDuring} or @code{\cueDuring},
530 \quoteDuring #@var{name} @var{music}
533 During a part, a piece of music can be quoted with the
534 @code{\quoteDuring} command.
537 \quoteDuring #"clarinet" @{ s2. @}
540 This would cite three quarter notes (the duration of @code{s2.})
541 of the previously added @code{clarinet} voice.
543 More precisely, it takes the current time-step of the part being
544 printed, and extracts the notes at the corresponding point of the
545 @code{\addQuote}d voice. Therefore, the argument to
546 @code{\addQuote} should be the entire part of the voice to be
547 quoted, including any rests at the beginning.
549 It is possible to use another music expression instead of
550 @code{s}, thus creating a polyphonic section, but this may not
551 always give the desired result.
553 Quotations take into account the transposition of both source and
554 target instruments, if they are specified using the
555 @code{\transposition} command.
557 @lilypond[quote,ragged-right,verbatim]
558 \addQuote clarinet \relative c' {
564 e'8 f'8 \quoteDuring #"clarinet" { s2 }
568 The type of events that are present in the quoted music can be
569 trimmed with the @code{quotedEventTypes} property. The default
570 value is @code{(note-event rest-event)}, which means that only
571 notes and rests of the quoted voice end up in the
572 @code{\quoteDuring}. Setting
575 \set Staff.quotedEventTypes =
576 #'(note-event articulation-event dynamic-event)
580 will quote notes (but no rests), together with scripts and
585 Only the contents of the first @internalsref{Voice} occurring in
586 an @code{\addQuote} command will be considered for quotation, so
587 @var{music} can not contain @code{\new} and @code{\context Voice}
588 statements that would switch to a different Voice.
590 Quoting grace notes is broken and can even cause LilyPond to
593 Quoting nested triplets may result in poor notation.
595 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
596 written entirely in lower-case letters: @code{\addquote}.
600 Notation Reference: @ref{Instrument transpositions}.
602 Snippets: @lsrdir{staff}
604 Internals Reference: @internalsref{QuoteMusic}.
607 @node Formatting cue notes
608 @unnumberedsubsubsec Formatting cue notes
610 @cindex cues, formatting
612 The previous section deals with inserting notes from another
613 voice. There is a more advanced music function called
614 @code{\cueDuring}, which makes formatting cue notes easier.
619 \cueDuring #@var{name} #@var{updown} @var{music}
622 This will insert notes from the part @var{name} into a
623 @internalsref{Voice} called @code{cue}. This happens
624 simultaneously with @var{music}, which usually is a rest. When
625 the cue notes start, the staff in effect becomes polyphonic for a
626 moment. The argument @var{updown} determines whether the cue
627 notes should be notated as a first or second voice.
630 @lilypond[verbatim,ragged-right]
633 \override Stem #'length-fraction = #0.8
634 \override Beam #'thickness = #0.384
635 \override Beam #'length-fraction = #0.8
638 \addQuote clarinet \relative {
643 \new Staff \relative <<
645 % setup a context for cue notes.
646 \new Voice = "cue" { \smaller \skip 1*21 }
648 \set Score.skipBars = ##t
652 \cueDuring #"clarinet" #UP {
661 Here are a couple of hints for successful cue notes
665 Cue notes have smaller font sizes.
668 the cued part is marked with the instrument playing the cue.
671 when the original part takes over again, this should be marked
672 with the name of the original instrument.
674 Any other changes introduced by the cued part should also be
675 undone. For example, if the cued instrument plays in a different
676 clef, the original clef should be stated once again.
680 The macro @code{\transposedCueDuring} is useful to add cues to
681 instruments which use a completely different octave range (for
682 example, having a cue of a piccolo flute within a contra bassoon
685 @lilypond[verbatim,ragged-right,quote]
686 picc = \relative c''' {
692 \addQuote "picc" { \picc }
694 cbsn = \relative c, {
697 \transposedCueDuring #"picc" #UP c,, { R1 } |
702 \context Staff = "picc" \picc
703 \context Staff = "cbsn" \cbsn
709 Snippets: @lsrdir{staff}