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 vertical bracket
45 @cindex bracket, vertical
46 @cindex brace, vertical
47 @cindex vertical brace
53 Many scores consist of more than one staff. These staves can be
54 grouped in several different ways:
58 In a @code{GrandStaff}, the group is started with a brace
59 at the left, and bar lines are connected between the staves.
61 @lilypond[verbatim,ragged-right,quote]
70 In a @code{StaffGroup}, the bar lines will be drawn through
71 all the staves, but the group is started with a bracket.
73 @lilypond[verbatim,ragged-right,quote]
82 In a @code{ChoirStaff}, the group is started with a
83 bracket, but bar lines are not connected.
85 @lilypond[verbatim,ragged-right,quote]
94 If no context is specified, the default properties for the score
95 will be used: the group is started with a vertical line, and the
96 bar lines are not connected.
98 @lilypond[verbatim,ragged-right,quote]
106 @cindex Mensurstriche layout
107 @cindex Renaissance music
109 In addition to these four staff group types, other groupings can
110 be produced by changing various properties. E.g., the
111 @q{Mensurstriche} layout common in Renaissance music, with
112 bar lines running between but not through the staves, can be
113 produced from a @code{StaffGroup} or @code{GrandStaff} context if
114 the bar lines are made transparent in the @code{Staff} itself, with
115 the command @code{\override Staff.BarLine #'transparent = ##t}
117 @cindex staff, nested
119 Staff groups can be nested, using the context
120 @code{InnerStaffGroup} or @code{InnerChoirStaff}; see
121 @lsr{staff,staff-brackets.ly}
126 More complex nesting can be accomplished using the property
127 @code{systemStartDelimiterHierarchy}:
129 @lilypond[quote,ragged-right,verbatim]
132 \set StaffGroup.systemStartDelimiterHierarchy
133 = #'(SystemStartSquare (SystemStartBracket a
134 (SystemStartSquare b)) d)
143 Each staff group context sets the property
144 @code{systemStartDelimiter} to one of the values
145 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace},
146 and @internalsref{SystemStartBracket}. A fourth delimiter,
147 @code{systemStartSquare}, is also available, but must be
148 instantiated manually.
150 @c FIXME: Graham will deal with this. -gp
152 To display a bracket even if there is only one staff, see
153 @lsr{staff,display-bracket-with-only-one-staff-in-a
158 Music Glossary: @rglos{brace}, @rglos{staff}, @rglos{staves}
161 Snippets: @lsrdir{staff}
163 Internals Reference: @internalsref{ChoirStaff},
164 @internalsref{GrandStaff}, @internalsref{StaffGroup},
165 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace},
166 @internalsref{SystemStartBracket},
167 @internalsref{systemStartDelimiterHierarchy}.
171 @unnumberedsubsubsec Staff symbol
173 @cindex staff symbol, adjusting
174 @cindex staff, starting
175 @cindex staff, stopping
177 @fundindex \startStaff
182 The layout object which draws the lines of a staff is called
183 @code{staff symbol}. The staff symbol may be tuned in the number,
184 thickness and distance of lines, using properties. This is
185 demonstrated in the example files
186 @lsr{staff,changing-the-number-of-lines-in-a-staff.ly} and
187 @lsr{staff,changing-the-staff-size.ly}.
189 In addition, staves may be started and stopped at will. This is
190 done with @code{\startStaff} and @code{\stopStaff}.
192 @lilypond[verbatim,relative=2,fragment]
194 \override Staff.StaffSymbol #'line-count = 2
195 \stopStaff \startStaff
197 \revert Staff.StaffSymbol #'line-count
198 \stopStaff \startStaff
202 @cindex staves, Frenched
204 @cindex Frenched staves
206 In combination with Frenched staves, this may be used to typeset
207 @emph{ossia} sections. An example is shown here
209 @lilypond[verbatim,relative=2,quote]
213 \remove "Time_signature_engraver"
215 \override StaffSymbol #'staff-space = #(magstep -2)
224 bes8[^"ossia" g bes g]
241 @cindex staff lines, setting number of
242 @cindex staff lines, setting thickness of
243 @cindex thickness of staff lines, setting
244 @cindex number of staff lines, setting
248 Music Glossary: @rglos{ossia}, @rglos{staff}, @rglos{Frenched staff}.
250 Snippets: @lsrdir{staff}
252 Internals Reference: @internalsref{StaffSymbol},
253 @internalsref{DrumStaff}.
257 @unnumberedsubsubsec Hiding staves
259 @cindex Frenched scores
260 @cindex staves, hiding empty
261 @cindex hiding empty staves
263 In orchestral scores, staff lines that only have rests are usually
264 removed; this saves some space. This style is called @q{French
265 Score}. For @code{Lyrics}, @code{ChordNames} and
266 @code{FiguredBass}, this is switched on by default. When
267 the lines of these contexts turn out empty after the line-breaking
268 process, they are removed.
270 For normal staves, a specialized @code{Staff} context is
271 available, which does the same: staves containing nothing (or only
272 multi-measure rests) are removed. The context definition is
273 stored in @code{\RemoveEmptyStaffContext} variable. Observe how
274 the second staff in this example disappears in the second line
276 @lilypond[quote,ragged-right,verbatim]
278 \context { \RemoveEmptyStaffContext }
283 \new Staff { e4 f g a \break c1 }
284 \new Staff { c4 d e f \break R1 }
289 The first system shows all staves in full. If empty staves should
290 be removed from the first system too, set @code{remove-first} to
291 true in @code{VerticalAxisGroup}.
294 \override Score.VerticalAxisGroup #'remove-first = ##t
297 To remove other types of contexts, use
298 @code{\AncientRemoveEmptyStaffContext} or
299 @code{\RemoveEmptyRhythmicStaffContext}.
303 Another application of the @code{\RemoveEmptyStaffContext} is to
304 make ossia sections, i.e., alternative melodies on a separate
305 piece of staff, with help of a Frenched staff. See @ref{Staff
308 You can make the staff lines invisible by removing the
309 @code{Staff_symbol_engraver} from the @code{Staff} context.
312 @lilypond[quote,ragged-right,verbatim]
314 \context Staff \relative c'' { c8 c c16 c c c }
318 \remove Staff_symbol_engraver
326 Notation Reference: @ref{Staff symbol}.
328 Snippets: @lsrdir{staff}
330 Internals Reference: @internalsref{ChordNames},
331 @internalsref{FiguredBass}, @internalsref{Lyrics},
332 @internalsref{Staff}, @internalsref{VerticalAxisGroup}.
335 @subsection Writing parts
340 * Quoting other voices::
341 * Formatting cue notes::
344 @node Metronome marks
345 @unnumberedsubsubsec Metronome marks
348 @cindex beats per minute
349 @cindex metronome marking
354 Metronome settings can be entered as follows
357 \tempo @var{duration} = @var{per-minute}
360 In the MIDI output, they are interpreted as a tempo change. In
361 the layout output, a metronome marking is printed
364 @lilypond[quote,ragged-right,verbatim,fragment]
371 To change the tempo in the MIDI output without printing anything,
372 make the metronome marking invisible @example \once \override
373 Score.MetronomeMark #'transparent = ##t @end example
375 To print other metronome markings, use these markup commands
376 @lilypond[quote,ragged-right,verbatim,relative,fragment]
379 \smaller \general-align #Y #DOWN \note #"16." #1
381 \smaller \general-align #Y #DOWN \note #"8" #1
386 For more details, see @ref{Text markup}.
391 Music Glossary: @rglos{metronome}, @rglos{metronomic indication},
392 @rglos{tempo indication}, @rglos{metronome mark}.
394 Notation Reference: @ref{Text markup}.
396 Snippets: @lsrdir{staff}.
398 Internals Reference: @internalsref{MetronomeMark}, @ref{MIDI
404 Collisions are not checked. If you have notes above the top line
405 of the staff (or notes with articulations, slurs, text, etc), then
406 the metronome marking may be printed on top of musical symbols.
407 If this occurs, increase the padding of the metronome mark to
408 place it further away from the staff.
411 \override Score.MetronomeMark #'padding = #2.5
414 @c perhaps also an example of how to move it horizontally?
417 @node Instrument names
418 @unnumberedsubsubsec Instrument names
420 @cindex instrument names
421 @cindex instrument names, short
423 In an orchestral score, instrument names are printed at the left
426 This can be achieved by setting @code{Staff}.@code{instrumentName} and
427 @code{Staff}.@code{shortInstrumentName}, or
428 @code{PianoStaff}.@code{instrumentName} and
429 @code{PianoStaff}.@code{shortInstrumentName}. This will print text
430 before the start of the staff. For the first staff,
431 @code{instrumentName} is used. If set, @code{shortInstrumentName} is
432 used for the following staves.
434 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
435 \set Staff.instrumentName = "Ploink "
436 \set Staff.shortInstrumentName = "Plk "
442 You can also use markup texts to construct more complicated
443 instrument names, for example
445 @lilypond[quote,fragment,verbatim,ragged-right]
446 \set Staff.instrumentName = \markup {
447 \column { "Clarinetti"
448 \line { "in B" \smaller \flat } } }
452 @cindex instrument names, centering
453 @cindex centering instrument names
454 @cindex aligning instrument names
455 @cindex instrument names, aligning
457 If you wish to center the instrument names, you must center all of
460 @lilypond[quote,verbatim,ragged-right]
463 \set Staff.instrumentName = \markup {
464 \center-align { "Clarinetti"
465 \line { "in B" \smaller \flat } } }
469 \set Staff.instrumentName =
470 \markup{ \center-align { Vibraphone }}
477 For longer instrument names, it may be useful to increase the
478 @code{indent} setting in the @code{\layout} block.
480 To center instrument names while leaving extra space to the right,
482 @lilypond[quote,verbatim,ragged-right]
483 \new StaffGroup \relative
486 \set Staff.instrumentName =
487 \markup { \hcenter-in #10 "blabla" }
491 \set Staff.instrumentName =
492 \markup { \hcenter-in #10 "blo" }
498 To add instrument names to other contexts (such as
499 @code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}), the
500 engraver must be added to that context.
504 \context @{\GrandStaff \consists "Instrument_name_engraver"@}
509 More information about adding and removing engravers can be found
510 in @ref{Modifying context plug-ins}.
512 @cindex instrument names, changing
514 Instrument names may be changed in the middle of a piece,
516 @lilypond[quote,fragment,verbatim,ragged-right]
517 \set Staff.instrumentName = "First"
518 \set Staff.shortInstrumentName = "one"
521 \set Staff.instrumentName = "Second"
522 \set Staff.shortInstrumentName = "two"
530 Notation Reference: @ref{Modifying context plug-ins}.
532 Snippets: @lsrdir{staff}
534 Internals Reference: @internalsref{InstrumentName},
535 @internalsref{PianoStaff}, @internalsref{Staff}.
538 @node Quoting other voices
539 @unnumberedsubsubsec Quoting other voices
542 @cindex quoting other voices
545 @cindex cue transposition
546 @cindex trasposition of cue notes
547 @cindex quote transposition
548 @cindex transposition of quotes
552 @funindex \quoteDuring
553 @funindex quoteDuring
556 @funindex \transposition
557 @funindex transposition
559 With quotations, fragments of other parts can be inserted into a
560 part directly. Before a part can be quoted, it must be marked
561 especially as quotable. This is done with the @code{\addQuote}
565 \addQuote @var{name} @var{music}
570 Here, @var{name} is an identifying string. The @var{music} is any
571 kind of music. Here is an example of @code{\addQuote}
574 \addQuote clarinet \relative c' @{
579 This command must be entered at toplevel, i.e., outside any music
580 blocks. Typically, one would use an already defined music event
584 clarinet = \relative c' @{
587 \addQuote clarinet @{ \clarinet @}
591 After calling @code{\addQuote}, the quotation may then be done
592 with @code{\quoteDuring} or @code{\cueDuring},
595 \quoteDuring #@var{name} @var{music}
598 During a part, a piece of music can be quoted with the
599 @code{\quoteDuring} command.
602 \quoteDuring #"clarinet" @{ s2. @}
605 This would cite three quarter notes (the duration of @code{s2.})
606 of the previously added @code{clarinet} voice.
608 More precisely, it takes the current time-step of the part being
609 printed, and extracts the notes at the corresponding point of the
610 @code{\addQuote}d voice. Therefore, the argument to
611 @code{\addQuote} should be the entire part of the voice to be
612 quoted, including any rests at the beginning.
614 It is possible to use another music expression instead of
615 @code{s}, thus creating a polyphonic section, but this may not
616 always give the desired result.
618 Quotations take into account the transposition of both source and
619 target instruments, if they are specified using the
620 @code{\transposition} command.
622 @lilypond[quote,ragged-right,verbatim]
623 \addQuote clarinet \relative c' {
629 e'8 f'8 \quoteDuring #"clarinet" { s2 }
633 The type of events that are present in the quoted music can be
634 trimmed with the @code{quotedEventTypes} property. The default
635 value is @code{(note-event rest-event)}, which means that only
636 notes and rests of the quoted voice end up in the
637 @code{\quoteDuring}. Setting
640 \set Staff.quotedEventTypes =
641 #'(note-event articulation-event dynamic-event)
645 will quote notes (but no rests), together with scripts and
650 Only the contents of the first @code{Voice} occurring in an
651 @code{\addQuote} command will be considered for quotation, so
652 @var{music} can not contain @code{\new} and @code{\context Voice}
653 statements that would switch to a different Voice.
655 Quoting grace notes is broken and can even cause LilyPond to
658 Quoting nested triplets may result in poor notation.
660 In earlier versions of LilyPond (pre 2.11), @code{addQuote} was
661 written entirely in lower-case letters: @code{\addquote}.
665 Notation Reference: @ref{Instrument transpositions}.
667 Snippets: @lsrdir{staff}
669 Internals Reference: @internalsref{QuoteMusic}, @internalsref{Voice}.
672 @node Formatting cue notes
673 @unnumberedsubsubsec Formatting cue notes
677 @cindex cue notes, formatting
679 @cindex quoting other voices
680 @cindex cues, formatting
681 @cindex transposing cue notes
682 @cindex transposing cues
683 @cindex cues, transposing
684 @cindex cue notes, transposing
688 @funindex \transposedCueDuring
689 @funindex transposedCueDuring
691 The previous section deals with inserting notes from another
692 voice. There is a more advanced music function called
693 @code{\cueDuring}, which makes formatting cue notes easier.
698 \cueDuring #@var{name} #@var{updown} @var{music}
701 This will insert notes from the part @var{name} into a
702 @code{Voice} called @code{cue}. This happens
703 simultaneously with @var{music}, which usually is a rest. When
704 the cue notes start, the staff in effect becomes polyphonic for a
705 moment. The argument @var{updown} determines whether the cue
706 notes should be notated as a first or second voice.
709 @lilypond[verbatim,ragged-right]
712 \override Stem #'length-fraction = #0.8
713 \override Beam #'thickness = #0.384
714 \override Beam #'length-fraction = #0.8
717 \addQuote clarinet \relative {
722 \new Staff \relative <<
724 % setup a context for cue notes.
725 \new Voice = "cue" { \smaller \skip 1*21 }
727 \set Score.skipBars = ##t
731 \cueDuring #"clarinet" #UP {
740 Here are a couple of hints for successful cue notes:
744 Cue notes have smaller font sizes.
747 The cued part is marked with the instrument playing the cue.
750 When the original part takes over again, this should be marked
751 with the name of the original instrument.
754 Any other changes introduced by the cued part should also be
755 undone. For example, if the cued instrument plays in a different
756 clef, the original clef should be stated once again.
761 The macro @code{\transposedCueDuring} is useful to add cues to
762 instruments which use a completely different octave range (for
763 example, having a cue of a piccolo flute within a contra bassoon
766 @lilypond[verbatim,ragged-right,quote]
767 picc = \relative c''' {
773 \addQuote "picc" { \picc }
775 cbsn = \relative c, {
778 \transposedCueDuring #"picc" #UP c,, { R1 } |
783 \context Staff = "picc" \picc
784 \context Staff = "cbsn" \cbsn
790 Snippets: @lsrdir{staff}.
792 Internals Reference: @internalsref{Voice}.