1 @c -*- coding: utf-8; mode: texinfo; -*-
7 * TODO piano node fix::
10 @node TODO piano node fix
11 @subsection TODO piano node fix
13 Piano staves are two normal staves coupled with a brace. The staves
14 are largely independent, but sometimes voices can cross between the
15 two staves. The same notation is also used for harps and other key
16 instruments. The @internalsref{PianoStaff} is especially built to
17 handle this cross-staffing behavior. In this section we discuss the
18 @internalsref{PianoStaff} and some other pianistic peculiarities.
21 * Automatic staff changes::
22 * Manual staff switches::
24 * Staff switch lines::
30 Dynamics are not centered, but workarounds do exist. See the
31 @q{piano centered dynamics} template in @rlearning{Piano templates}.
33 @cindex cross staff stem
34 @cindex stem, cross staff
35 @cindex distance between staves in piano music
38 @node Automatic staff changes
39 @unnumberedsubsubsec Automatic staff changes
40 @cindex Automatic staff changes
42 Voices can be made to switch automatically between the top and the bottom
43 staff. The syntax for this is
47 \autochange @dots{}@var{music}@dots{}
52 This will create two staves inside the current PianoStaff, called
53 @code{up} and @code{down}. The lower staff will be in bass clef by
56 A @code{\relative} section that is outside of @code{\autochange} has
57 no effect on the pitches of @var{music}, so, if necessary, put
58 @code{\relative} inside @code{\autochange} like
62 \autochange \relative @dots{} @dots{}
67 The autochanger switches on basis of the pitch (middle C is the turning
68 point), and it looks ahead skipping over rests to switch in
69 advance. Here is a practical example
71 @lilypond[quote,verbatim,ragged-right]
73 \autochange \relative c'
82 In this manual: @ref{Manual staff switches}.
84 Program reference: @internalsref{AutoChangeMusic}.
90 The staff switches may not end up in optimal places. For high
91 quality output, staff switches should be specified manually.
94 @code{\autochange} cannot be inside @code{\times}.
97 @node Manual staff switches
98 @unnumberedsubsubsec Manual staff switches
100 @cindex manual staff switches
101 @cindex staff switch, manual
103 Voices can be switched between staves manually, using the command
105 \change Staff = @var{staffname} @var{music}
109 The string @var{staffname} is the name of the staff. It switches the
110 current voice from its current staff to the Staff called
111 @var{staffname}. Typically @var{staffname} is @code{"up"} or
112 @code{"down"}. The @context{Staff} referred to must already exist, so
113 usually the setup for a score will start with a setup of the staves,
118 \skip 1 * 10 % @emph{keep staff alive}
120 \new Staff = "down" @{
121 \skip 1 * 10 % @emph{idem}
127 and the @context{Voice} is inserted afterwards
130 \context Staff = down
131 \new Voice @{ @dots{} \change Staff = up @dots{} @}
136 @unnumberedsubsubsec Pedals
139 Pianos have pedals that alter the way sound is produced. Generally, a
140 piano has three pedals, sustain, una corda, and sostenuto.
143 Piano pedal instruction can be expressed by attaching
144 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
145 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
148 @lilypond[quote,ragged-right,fragment,verbatim]
149 c'4\sustainDown c'4\sustainUp
152 What is printed can be modified by setting @code{pedal@var{X}Strings},
153 where @var{X} is one of the pedal types: @code{Sustain},
154 @code{Sostenuto} or @code{UnaCorda}. Refer to
155 @internalsref{SustainPedal} in the program reference for more
158 Pedals can also be indicated by a sequence of brackets, by setting the
159 @code{pedalSustainStyle} property to bracket objects
161 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
162 \set Staff.pedalSustainStyle = #'bracket
164 b\sustainUp\sustainDown
165 b g \sustainUp a \sustainDown \bar "|."
168 A third style of pedal notation is a mixture of text and brackets,
169 obtained by setting the @code{pedalSustainStyle} property to
172 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
173 \set Staff.pedalSustainStyle = #'mixed
175 b\sustainUp\sustainDown
176 b g \sustainUp a \sustainDown \bar "|."
179 The default @q{*Ped.} style for sustain and damper pedals corresponds to
180 style @code{#'text}. The sostenuto pedal uses @code{mixed} style by
183 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
184 c\sostenutoDown d e c, f g a\sostenutoUp
187 For fine-tuning the appearance of a pedal bracket, the properties
188 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
189 @code{PianoPedalBracket} objects (see
190 @internalsref{PianoPedalBracket} in the Program reference) can be
191 modified. For example, the bracket may be extended to the right edge
194 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
195 \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0)
196 c\sostenutoDown d e c, f g a\sostenutoUp
201 In this manual: @ref{Laissez vibrer ties}.
203 @node Staff switch lines
204 @unnumberedsubsubsec Staff switch lines
208 @cindex staff switching
211 @funindex followVoice
213 Whenever a voice switches to another staff, a line connecting the notes
214 can be printed automatically. This is switched on by setting
215 @code{followVoice} to true
217 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
220 \set followVoice = ##t
225 \new Staff="two" { \clef bass \skip 1*2 }
231 Program reference: @internalsref{VoiceFollower}.
235 @funindex \showStaffSwitch
236 @code{\showStaffSwitch},
237 @funindex \hideStaffSwitch
238 @code{\hideStaffSwitch}.
241 @node Cross staff stems
242 @unnumberedsubsubsec Cross staff stems
244 Chords that cross staves may be produced by increasing the length
245 of the stem in the lower staff, so it reaches the stem in the upper
246 staff, or vice versa.
248 @lilypond[ragged-right,verbatim,quote]
250 \once \override Stem #'length = #10
251 \once \override Stem #'cross-staff = ##t
253 noFlag = \once \override Stem #'flag-style = #'no-flag
256 \stemDown \stemExtend