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
13 with a set of horizontal lines, called a staff (plural @q{staves}). In
14 LilyPond, these lines are drawn using a separate layout object called
17 Two or more staves can be grouped vertically in a
18 @internalsref{GrandStaff}, a @internalsref{StaffGroup}, or a
19 @internalsref{ChoirStaff}.
21 @c It seemed awkward to have the general definition of a stave in the
22 @c second section, since it is already used in the first. I have moved it
32 @node Displaying staves
33 @subsection Displaying staves
36 * System start delimiters::
41 @node System start delimiters
42 @unnumberedsubsubsec System start delimiters
44 @cindex start of system
45 @cindex Staff, multiple
46 @cindex bracket, vertical
47 @cindex brace, vertical
52 Many scores consist of more than one staff. These staves can be
53 grouped in several different ways:
55 @c The fourth delimiter, SystemStartSquare, should also be mentioned, with a
56 @c reference to the relevant section, and a single line of code here showing
61 In a @internalsref{GrandStaff},
62 the group is started with a brace at the left, and bar lines are connected
64 @c Arpeggios can run through several staves of a @code{GrandStaff}
66 @lilypond[verbatim,ragged-right,quote]
75 In a @internalsref{StaffGroup}, the barlines
76 will be drawn through all the staves, but the group is started with a
79 @lilypond[verbatim,ragged-right,quote]
88 In a @internalsref{ChoirStaff}, the group is started with a bracket,
89 but bar lines are not connected.
91 @lilypond[verbatim,ragged-right,quote]
100 If no context is specified, the default properties for the score will
101 be used: the group is started with a vertical line, and the bar lines are
104 @lilypond[verbatim,ragged-right,quote]
112 In addition to these four staff group types, other groupings can
113 be produced by changing various properties. E.g., the
114 "Mensurstriche" layout common in Renaissance music, with barlines
115 running between but not through the staves, can be produced from a
116 @code{StaffGroup} or @code{GrandStaff} context if the barlines are
117 made transparent in the @code{Staff} itself, with the command
118 @code{\override Staff.BarLine #'transparent = ##t}
122 The bar lines at the start of each system are
123 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace}, and
124 @internalsref{SystemStartBracket}. Only one of these types is created
125 in every context, and that type is determined by the property
126 @code{systemStartDelimiter}.
130 @c Is it possible to use other headings than this one? It's not very
131 @c informative... "Nesting braces and brackets" would be better, imho.
133 System start delimiters may be deeply nested,
135 @lilypond[quote,ragged-right,verbatim]
138 \set StaffGroup.systemStartDelimiterHierarchy
139 = #'(SystemStartSquare (SystemStartBracket a (SystemStartSquare b)) d)
150 @unnumberedsubsubsec Staff symbol
152 @cindex adjusting staff symbol
154 The layout object which draws the lines of a staff is called @code{staff
155 symbol}. The staff symbol may be tuned in the number, thickness and
156 distance of lines, using properties. This is demonstrated in the example
157 files @lsr{staff,changing-the-number-of-lines-in-a-staff.ly} and
158 @lsr{staff,changing-the-staff-size.ly}.
160 In addition, staves may be started and stopped at will. This is done
161 with @code{\startStaff} and @code{\stopStaff}.
163 @lilypond[verbatim,relative=2,fragment]
165 \override Staff.StaffSymbol #'line-count = 2
166 \stopStaff \startStaff
168 \revert Staff.StaffSymbol #'line-count
169 \stopStaff \startStaff
173 In combination with Frenched staves, this may be used to typeset ossia
174 sections. An example is shown here
178 @lilypondfile{ossia.ly}
180 @cindex staff lines, setting number of
181 @cindex staff lines, setting thickness of
182 @cindex thickness of staff lines, setting
183 @cindex number of staff lines, setting
187 Program reference: @internalsref{StaffSymbol}.
189 Examples: @lsrdir{staff}
193 @unnumberedsubsubsec Hiding staves
195 @cindex Frenched scores
196 @cindex Hiding staves
198 In orchestral scores, staff lines that only have rests are usually
199 removed; this saves some space. This style is called @q{French
200 Score}. For @internalsref{Lyrics}, @internalsref{ChordNames} and
201 @internalsref{FiguredBass}, this is switched on by default. When
202 the lines of these contexts turn out empty after the line-breaking
203 process, they are removed.
205 For normal staves, a specialized @internalsref{Staff} context is
206 available, which does the same: staves containing nothing (or only
207 multi-measure rests) are removed. The context definition is stored in
208 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
209 in this example disappears in the second line
211 @lilypond[quote,ragged-right,verbatim]
213 \context { \RemoveEmptyStaffContext }
218 \new Staff { e4 f g a \break c1 }
219 \new Staff { c4 d e f \break R1 }
224 The first system shows all staves in full. If empty staves should be
225 removed from the first system too, set @code{remove-first} to true in
226 @internalsref{VerticalAxisGroup}.
229 \override Score.VerticalAxisGroup #'remove-first = ##t
232 To remove other types of contexts, use @code{\AncientRemoveEmptyStaffContext}
233 or @code{\RemoveEmptyRhythmicStaffContext}.
235 Another application is making ossia sections, i.e., alternative
236 melodies on a separate piece of staff, with help of a Frenched
242 @subsection Writing parts
247 * Quoting other voices::
248 * Formatting cue notes::
251 @node Metronome marks
252 @unnumberedsubsubsec Metronome marks
255 @cindex beats per minute
256 @cindex metronome marking
258 Metronome settings can be entered as follows
260 \tempo @var{duration} = @var{per-minute}
263 In the MIDI output, they are interpreted as a tempo change. In the
264 layout output, a metronome marking is printed
266 @lilypond[quote,ragged-right,verbatim,fragment]
273 To change the tempo in the MIDI output without printing anything, make
274 the metronome marking invisible
276 \once \override Score.MetronomeMark #'transparent = ##t
279 To print other metronome markings, use these markup commands
280 @lilypond[quote,ragged-right,verbatim,relative,fragment]
283 \smaller \general-align #Y #DOWN \note #"16." #1
285 \smaller \general-align #Y #DOWN \note #"8" #1
290 See @ref{Text markup}, for more details.
295 Program reference: @internalsref{MetronomeMark}.
300 Collisions are not checked. If you have notes above the top line of
301 the staff (or notes with articulations, slurs, text, etc), then the
302 metronome marking may be printed on top of musical symbols. If this
303 occurs, increase the padding of the metronome mark to place it
304 further away from the staff.
307 \override Score.MetronomeMark #'padding = #2.5
311 @node Instrument names
312 @unnumberedsubsubsec Instrument names
314 In an orchestral score, instrument names are printed at the left side
317 This can be achieved by setting @internalsref{Staff}.@code{instrumentName}
318 and @internalsref{Staff}.@code{shortInstrumentName}, or
319 @internalsref{PianoStaff}.@code{instrumentName} and
320 @internalsref{PianoStaff}.@code{shortInstrumentName}. This will
322 the start of the staff. For the first staff, @code{instrumentName} is
323 used, for the following ones, @code{shortInstrumentName} is used.
325 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
326 \set Staff.instrumentName = "Ploink "
327 \set Staff.shortInstrumentName = "Plk "
333 You can also use markup texts to construct more complicated instrument
336 @lilypond[quote,fragment,verbatim,ragged-right]
337 \set Staff.instrumentName = \markup {
338 \column { "Clarinetti"
339 \line { "in B" \smaller \flat } } }
343 If you wish to center the instrument names, you must center all of them
345 @lilypond[quote,verbatim,ragged-right]
348 \set Staff.instrumentName = \markup {
349 \center-align { "Clarinetti"
350 \line { "in B" \smaller \flat } } }
354 \set Staff.instrumentName = \markup{ \center-align { Vibraphone }}
361 For longer instrument names, it may be useful to increase the
362 @code{indent} setting in the @code{\layout} block.
364 To center instrument names while leaving extra space to the right,
366 @lilypond[quote,verbatim,ragged-right]
367 \new StaffGroup \relative
370 \set Staff.instrumentName = \markup { \hcenter-in #10 "blabla" }
374 \set Staff.instrumentName = \markup { \hcenter-in #10 "blo" }
380 To add instrument names to other contexts (such as @code{GrandStaff},
381 @code{ChoirStaff}, or @code{StaffGroup}), the engraver must
382 be added to that context.
386 \context @{\GrandStaff \consists "Instrument_name_engraver"@}
391 More information about adding and removing engravers can
392 be found in @ref{Modifying context plug-ins}.
394 Instrument names may be changed in the middle of a piece,
396 @lilypond[quote,fragment,verbatim,ragged-right]
397 \set Staff.instrumentName = "First"
398 \set Staff.shortInstrumentName = "one"
401 \set Staff.instrumentName = "Second"
402 \set Staff.shortInstrumentName = "two"
410 Program reference: @internalsref{InstrumentName}.
413 @node Quoting other voices
414 @unnumberedsubsubsec Quoting other voices
418 With quotations, fragments of other parts can be inserted into a part
419 directly. Before a part can be quoted, it must be marked especially as
420 quotable. This is done with the @code{\addQuote} command.
423 \addQuote @var{name} @var{music}
428 Here, @var{name} is an identifying string. The @var{music} is any kind
429 of music. Here is an example of @code{\addQuote}
432 \addQuote clarinet \relative c' @{
437 This command must be entered at toplevel, i.e., outside any music
440 After calling @code{\addQuote}, the quotation may then be done with
441 @code{\quoteDuring} or @code{\cueDuring},
444 \quoteDuring #@var{name} @var{music}
447 During a part, a piece of music can be quoted with the @code{\quoteDuring}
451 \quoteDuring #"clarinet" @{ s2. @}
454 This would cite three quarter notes (the duration of @code{s2.}) of
455 the previously added @code{clarinet} voice.
458 More precisely, it takes the current time-step of the part being
459 printed, and extracts the notes at the corresponding point of the
460 @code{\addQuote}d voice. Therefore, the argument to @code{\addQuote}
461 should be the entire part of the voice to be quoted, including any
462 rests at the beginning.
464 Quotations take into account the transposition of both source and target
465 instruments, if they are specified using the @code{\transposition} command.
467 @lilypond[quote,ragged-right,verbatim]
468 \addQuote clarinet \relative c' {
474 e'8 f'8 \quoteDuring #"clarinet" { s2 }
478 The type of events that are present in cue notes can be trimmed with
479 the @code{quotedEventTypes} property. The default value is
480 @code{(note-event rest-event)}, which means that only notes and
481 rests of the cued voice end up in the @code{\quoteDuring}.
485 \set Staff.quotedEventTypes =
486 #'(note-event articulation-event dynamic-event)
490 will quote notes (but no rests), together with scripts and dynamics.
494 Only the contents of the first @internalsref{Voice} occurring in an
495 @code{\addQuote} command will be considered for quotation, so
496 @var{music} can not contain @code{\new} and @code{\context Voice}
497 statements that would switch to a different Voice.
499 Quoting grace notes is broken and can even cause LilyPond to crash.
501 Quoting nested triplets may result in poor notation.
506 In this manual: @ref{Instrument transpositions}.
508 Examples: @lsr{parts,quote.ly}, @lsr{parts,quote-transportation.ly}
510 Program reference: @internalsref{QuoteMusic}.
513 @node Formatting cue notes
514 @unnumberedsubsubsec Formatting cue notes
516 @cindex cues, formatting
518 The previous section deals with inserting notes from another voice.
519 There is a more advanced music function called @code{\cueDuring},
520 which makes formatting cue notes easier.
525 \cueDuring #@var{name} #@var{updown} @var{music}
528 This will insert notes from the part @var{name} into a
529 @internalsref{Voice} called @code{cue}. This happens simultaneously
530 with @var{music}, which usually is a rest. When the cue notes start,
531 the staff in effect becomes polyphonic for a moment. The argument
532 @var{updown} determines whether the cue notes should be notated as a
533 first or second voice.
536 @lilypond[verbatim,ragged-right]
539 \override Stem #'length-fraction = #0.8
540 \override Beam #'thickness = #0.384
541 \override Beam #'length-fraction = #0.8
544 \addQuote clarinet \relative {
549 \new Staff \relative <<
551 % setup a context for cue notes.
552 \new Voice = "cue" { \smaller \skip 1*21 }
554 \set Score.skipBars = ##t
558 \cueDuring #"clarinet" #UP {
567 Here are a couple of hints for successful cue notes
571 Cue notes have smaller font sizes.
573 the cued part is marked with the instrument playing the cue.
575 when the original part takes over again, this should be marked with
576 the name of the original instrument.
578 @c really? Are you sure about that last point? I'll check after 3.0 -gp
580 @c Yes, this is good practice. Otherwise, the start of the original
581 @c part can only be seen from the font size. This is not good enough
582 @c for sight-reading. It is possilbe to use other
583 @c markers (e.g. a big close-bracket over the staff) to indicate the cue
589 Any other changes introduced by the cued part should also be
590 undone. For example, if the cued instrument plays in a different clef,
591 the original clef should be stated once again.
595 The macro @code{\transposedCueDuring} is
596 useful to add cues to instruments which use a completely different
597 octave range (for example, having a cue of a piccolo flute within
598 a contra bassoon part).
600 @lilypond[verbatim,ragged-right,quote]
601 picc = \relative c''' {
607 \addQuote "picc" { \picc }
609 cbsn = \relative c, {
612 \transposedCueDuring #"picc" #UP c,, { R1 } |
617 \context Staff = "picc" \picc
618 \context Staff = "cbsn" \cbsn