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, rests, 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 @code{GrandStaff}, a
21 @code{StaffGroup}, or a @code{ChoirStaff}.
30 @node Displaying staves
31 @subsection Displaying staves
34 * System start delimiters::
39 @node System start delimiters
40 @unnumberedsubsubsec System start delimiters
42 @cindex start of system
43 @cindex staff, multiple
44 @cindex bracket, vertical
45 @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 @code{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 @code{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 @code{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 @cindex Mensurstriche layout
105 @cindex Renaissance music
107 In addition to these four staff group types, other groupings can
108 be produced by changing various properties. E.g., the
109 @q{Mensurstriche} layout common in Renaissance music, with
110 bar lines running between but not through the staves, can be
111 produced from a @code{StaffGroup} or @code{GrandStaff} context if
112 the bar lines are made transparent in the @code{Staff} itself, with
113 the command @code{\override Staff.BarLine #'transparent = ##t}
115 @cindex staff, nested
117 Staff groups can be nested, using the context
118 @code{InnerStaffGroup} or @code{InnerChoirStaff}; see
119 @lsr{staff,staff-brackets.ly}
124 More complex nesting can be accomplished using the property
125 @code{systemStartDelimiterHierarchy}:
127 @lilypond[quote,ragged-right,verbatim]
130 \set StaffGroup.systemStartDelimiterHierarchy
131 = #'(SystemStartSquare (SystemStartBracket a
132 (SystemStartSquare b)) d)
141 Each staff group context sets the property
142 @code{systemStartDelimiter} to one of the values
143 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace},
144 and @internalsref{SystemStartBracket}. A fourth delimiter,
145 @code{systemStartSquare}, is also available, but must be
146 instantiated manually
148 @c FIXME: Graham will deal with this. -gp
150 To display a bracket even if there is only one staff, see
151 @lsr{staff,display-bracket-with-only-one-staff-in-a
156 Music Glossary: @rglos{brace}, @rglos{staff}, @rglos{staves}
159 Snippets: @lsrdir{staff}
161 Internals Reference: @internalsref{ChoirStaff},
162 @internalsref{GrandStaff}, @internalsref{StaffGroup},
163 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace},
164 @internalsref{SystemStartBracket},
165 @internalsref{systemStartDelimiterHierarchy}.
169 @unnumberedsubsubsec Staff symbol
171 @cindex adjusting staff symbol
173 The layout object which draws the lines of a staff is called
174 @code{staff symbol}. The staff symbol may be tuned in the number,
175 thickness and distance of lines, using properties. This is
176 demonstrated in the example files
177 @lsr{staff,changing-the-number-of-lines-in-a-staff.ly} and
178 @lsr{staff,changing-the-staff-size.ly}.
180 In addition, staves may be started and stopped at will. This is
181 done with @code{\startStaff} and @code{\stopStaff}.
183 @lilypond[verbatim,relative=2,fragment]
185 \override Staff.StaffSymbol #'line-count = 2
186 \stopStaff \startStaff
188 \revert Staff.StaffSymbol #'line-count
189 \stopStaff \startStaff
193 @cindex staves, Frenched
195 @cindex Frenched staves
197 In combination with Frenched staves, this may be used to typeset
198 @emph{ossia} sections. An example is shown here
200 @lilypond[verbatim,relative=2,quote]
204 \remove "Time_signature_engraver"
206 \override StaffSymbol #'staff-space = #(magstep -2)
215 bes8[^"ossia" g bes g]
232 @cindex staff lines, setting number of
233 @cindex staff lines, setting thickness of
234 @cindex thickness of staff lines, setting
235 @cindex number of staff lines, setting
239 Music Glossary: @rglos{ossia}, @rglos{staff}, @rglos{Frenched staff}.
241 Snippets: @lsrdir{staff}
243 Internals Reference: @internalsref{StaffSymbol},
244 @internalsref{DrumStaff}.
248 @unnumberedsubsubsec Hiding staves
250 @cindex Frenched scores
251 @cindex staves, hiding
252 @cindex staves, empty
254 In orchestral scores, staff lines that only have rests are usually
255 removed; this saves some space. This style is called @q{French
256 Score}. For @code{Lyrics}, @code{ChordNames} and
257 @code{FiguredBass}, this is switched on by default. When
258 the lines of these contexts turn out empty after the line-breaking
259 process, they are removed.
261 For normal staves, a specialized @code{Staff} context is
262 available, which does the same: staves containing nothing (or only
263 multi-measure rests) are removed. The context definition is
264 stored in @code{\RemoveEmptyStaffContext} variable. Observe how
265 the second staff in this example disappears in the second line
267 @lilypond[quote,ragged-right,verbatim]
269 \context { \RemoveEmptyStaffContext }
274 \new Staff { e4 f g a \break c1 }
275 \new Staff { c4 d e f \break R1 }
280 The first system shows all staves in full. If empty staves should
281 be removed from the first system too, set @code{remove-first} to
282 true in @code{VerticalAxisGroup}.
285 \override Score.VerticalAxisGroup #'remove-first = ##t
288 To remove other types of contexts, use
289 @code{\AncientRemoveEmptyStaffContext} or
290 @code{\RemoveEmptyRhythmicStaffContext}.
294 Another application of the @code{\RemoveEmptyStaffContext} is to
295 make ossia sections, i.e., alternative melodies on a separate
296 piece of staff, with help of a Frenched staff. See @ref{Staff
299 You can make the staff lines invisible by removing the
300 @code{Staff_symbol_engraver} from the @code{Staff} context.
303 @lilypond[quote,ragged-right,verbatim]
305 \context Staff \relative c'' { c8 c c16 c c c }
309 \remove Staff_symbol_engraver
317 Notation Reference: @ref{Staff symbol}.
319 Snippets: @lsrdir{staff}
321 Internals Reference: @internalsref{ChordNames},
322 @internalsref{FiguredBass}, @internalsref{Lyrics},
323 @internalsref{Staff}, @internalsref{VerticalAxisGroup}.
326 @subsection Writing parts
331 * Quoting other voices::
332 * Formatting cue notes::
335 @node Metronome marks
336 @unnumberedsubsubsec Metronome marks
339 @cindex beats per minute
340 @cindex metronome marking
342 Metronome settings can be entered as follows
345 \tempo @var{duration} = @var{per-minute}
348 In the MIDI output, they are interpreted as a tempo change. In
349 the layout output, a metronome marking is printed
353 @lilypond[quote,ragged-right,verbatim,fragment]
360 To change the tempo in the MIDI output without printing anything,
361 make the metronome marking invisible @example \once \override
362 Score.MetronomeMark #'transparent = ##t @end example
364 To print other metronome markings, use these markup commands
365 @lilypond[quote,ragged-right,verbatim,relative,fragment]
368 \smaller \general-align #Y #DOWN \note #"16." #1
370 \smaller \general-align #Y #DOWN \note #"8" #1
375 For more details, see @ref{Text markup}.
380 Music Glossary: @rglos{metronome}, @rglos{metronomic indication},
381 @rglos{tempo indication}, @rglos{metronome mark}.
383 Notation Reference: @ref{Text markup}.
385 Snippets: @lsrdir{staff}.
387 Internals Reference: @internalsref{MetronomeMark}, @ref{MIDI
393 Collisions are not checked. If you have notes above the top line
394 of the staff (or notes with articulations, slurs, text, etc), then
395 the metronome marking may be printed on top of musical symbols.
396 If this occurs, increase the padding of the metronome mark to
397 place it further away from the staff.
400 \override Score.MetronomeMark #'padding = #2.5
403 @c perhaps also an example of how to move it horizontally?
406 @node Instrument names
407 @unnumberedsubsubsec Instrument names
409 @cindex instrument names
410 @cindex instrument names, short
412 In an orchestral score, instrument names are printed at the left
415 This can be achieved by setting @code{Staff}.@code{instrumentName} and
416 @code{Staff}.@code{shortInstrumentName}, or
417 @code{PianoStaff}.@code{instrumentName} and
418 @code{PianoStaff}.@code{shortInstrumentName}. This will print text
419 before the start of the staff. For the first staff,
420 @code{instrumentName} is used. If set, @code{shortInstrumentName} is
421 used for the following staves.
423 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
424 \set Staff.instrumentName = "Ploink "
425 \set Staff.shortInstrumentName = "Plk "
431 You can also use markup texts to construct more complicated
432 instrument names, for example
434 @lilypond[quote,fragment,verbatim,ragged-right]
435 \set Staff.instrumentName = \markup {
436 \column { "Clarinetti"
437 \line { "in B" \smaller \flat } } }
441 @cindex instrument names, centering
443 If you wish to center the instrument names, you must center all of
446 @lilypond[quote,verbatim,ragged-right]
449 \set Staff.instrumentName = \markup {
450 \center-align { "Clarinetti"
451 \line { "in B" \smaller \flat } } }
455 \set Staff.instrumentName =
456 \markup{ \center-align { Vibraphone }}
463 For longer instrument names, it may be useful to increase the
464 @code{indent} setting in the @code{\layout} block.
466 To center instrument names while leaving extra space to the right,
468 @lilypond[quote,verbatim,ragged-right]
469 \new StaffGroup \relative
472 \set Staff.instrumentName =
473 \markup { \hcenter-in #10 "blabla" }
477 \set Staff.instrumentName =
478 \markup { \hcenter-in #10 "blo" }
484 To add instrument names to other contexts (such as
485 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}), the
486 engraver must be added to that context.
490 \context @{\GrandStaff \consists "Instrument_name_engraver"@}
495 More information about adding and removing engravers can be found
496 in @ref{Modifying context plug-ins}.
498 @cindex instrument names, changing
500 Instrument names may be changed in the middle of a piece,
502 @lilypond[quote,fragment,verbatim,ragged-right]
503 \set Staff.instrumentName = "First"
504 \set Staff.shortInstrumentName = "one"
507 \set Staff.instrumentName = "Second"
508 \set Staff.shortInstrumentName = "two"
516 Notation Reference: @ref{Modifying context plug-ins}.
518 Snippets: @lsrdir{staff}
520 Internals Reference: @internalsref{InstrumentName},
521 @internalsref{PianoStaff}, @internalsref{Staff}.
524 @node Quoting other voices
525 @unnumberedsubsubsec Quoting other voices
528 @cindex quoting other voices
532 With quotations, fragments of other parts can be inserted into a
533 part directly. Before a part can be quoted, it must be marked
534 especially as quotable. This is done with the @code{\addQuote}
538 \addQuote @var{name} @var{music}
543 Here, @var{name} is an identifying string. The @var{music} is any
544 kind of music. Here is an example of @code{\addQuote}
547 \addQuote clarinet \relative c' @{
552 This command must be entered at toplevel, i.e., outside any music
553 blocks. Typically, one would use an already defined music event
557 clarinet = \relative c' @{
560 \addQuote clarinet @{ \clarinet @}
564 After calling @code{\addQuote}, the quotation may then be done
565 with @code{\quoteDuring} or @code{\cueDuring},
568 \quoteDuring #@var{name} @var{music}
571 During a part, a piece of music can be quoted with the
572 @code{\quoteDuring} command.
575 \quoteDuring #"clarinet" @{ s2. @}
578 This would cite three quarter notes (the duration of @code{s2.})
579 of the previously added @code{clarinet} voice.
581 More precisely, it takes the current time-step of the part being
582 printed, and extracts the notes at the corresponding point of the
583 @code{\addQuote}d voice. Therefore, the argument to
584 @code{\addQuote} should be the entire part of the voice to be
585 quoted, including any rests at the beginning.
587 It is possible to use another music expression instead of
588 @code{s}, thus creating a polyphonic section, but this may not
589 always give the desired result.
591 Quotations take into account the transposition of both source and
592 target instruments, if they are specified using the
593 @code{\transposition} command.
595 @lilypond[quote,ragged-right,verbatim]
596 \addQuote clarinet \relative c' {
602 e'8 f'8 \quoteDuring #"clarinet" { s2 }
606 The type of events that are present in the quoted music can be
607 trimmed with the @code{quotedEventTypes} property. The default
608 value is @code{(note-event rest-event)}, which means that only
609 notes and rests of the quoted voice end up in the
610 @code{\quoteDuring}. Setting
613 \set Staff.quotedEventTypes =
614 #'(note-event articulation-event dynamic-event)
618 will quote notes (but no rests), together with scripts and
623 Only the contents of the first @code{Voice} occurring in an
624 @code{\addQuote} command will be considered for quotation, so
625 @var{music} can not contain @code{\new} and @code{\context Voice}
626 statements that would switch to a different Voice.
628 Quoting grace notes is broken and can even cause LilyPond to
631 Quoting nested triplets may result in poor notation.
633 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
634 written entirely in lower-case letters: @code{\addquote}.
638 Notation Reference: @ref{Instrument transpositions}.
640 Snippets: @lsrdir{staff}
642 Internals Reference: @internalsref{QuoteMusic}, @internalsref{Voice}.
645 @node Formatting cue notes
646 @unnumberedsubsubsec Formatting cue notes
650 @cindex cue notes, formatting
652 @cindex quoting other voices
653 @cindex cues, formatting
655 The previous section deals with inserting notes from another
656 voice. There is a more advanced music function called
657 @code{\cueDuring}, which makes formatting cue notes easier.
662 \cueDuring #@var{name} #@var{updown} @var{music}
665 This will insert notes from the part @var{name} into a
666 @code{Voice} called @code{cue}. This happens
667 simultaneously with @var{music}, which usually is a rest. When
668 the cue notes start, the staff in effect becomes polyphonic for a
669 moment. The argument @var{updown} determines whether the cue
670 notes should be notated as a first or second voice.
673 @lilypond[verbatim,ragged-right]
676 \override Stem #'length-fraction = #0.8
677 \override Beam #'thickness = #0.384
678 \override Beam #'length-fraction = #0.8
681 \addQuote clarinet \relative {
686 \new Staff \relative <<
688 % setup a context for cue notes.
689 \new Voice = "cue" { \smaller \skip 1*21 }
691 \set Score.skipBars = ##t
695 \cueDuring #"clarinet" #UP {
704 Here are a couple of hints for successful cue notes:
708 Cue notes have smaller font sizes.
711 The cued part is marked with the instrument playing the cue.
714 When the original part takes over again, this should be marked
715 with the name of the original instrument.
718 Any other changes introduced by the cued part should also be
719 undone. For example, if the cued instrument plays in a different
720 clef, the original clef should be stated once again.
724 The macro @code{\transposedCueDuring} is useful to add cues to
725 instruments which use a completely different octave range (for
726 example, having a cue of a piccolo flute within a contra bassoon
729 @lilypond[verbatim,ragged-right,quote]
730 picc = \relative c''' {
736 \addQuote "picc" { \picc }
738 cbsn = \relative c, {
741 \transposedCueDuring #"picc" #UP c,, { R1 } |
746 \context Staff = "picc" \picc
747 \context Staff = "cbsn" \cbsn
753 Snippets: @lsrdir{staff}.
755 Internals Reference: @internalsref{Voice}.