]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/piano.itely
Merge commit 'ce4b499'
[lilypond.git] / Documentation / user / piano.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @ignore
3     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
4
5     When revising a translation, copy the HEAD committish of the
6     version that you are working on.  See TRANSLATION for details.
7 @end ignore
8
9 @node Piano music
10 @section Piano music
11
12 @menu
13 * Piano sections::              
14 @end menu
15
16 @node Piano sections
17 @subsection Piano sections
18
19 Piano staves are two normal staves coupled with a brace.  The staves
20 are largely independent, but sometimes voices can cross between the
21 two staves.  The same notation is also used for harps and other key
22 instruments.  The @internalsref{PianoStaff} is especially built to
23 handle this cross-staffing behavior.  In this section we discuss the
24 @internalsref{PianoStaff} and some other pianistic peculiarities.
25
26 @menu
27 * Automatic staff changes::     
28 * Manual staff switches::       
29 * Pedals::                      
30 * Staff switch lines::          
31 * Cross staff stems::           
32 @end menu
33
34 @refbugs
35
36 Dynamics are not centered, but workarounds do exist.  See the
37 @q{piano centered dynamics} template in @rlearning{Piano templates}.
38
39 @cindex cross staff stem
40 @cindex stem, cross staff
41 @cindex distance between staves in piano music
42
43
44 @node Automatic staff changes
45 @subsubsection Automatic staff changes
46 @cindex Automatic staff changes
47
48 Voices can be made to switch automatically between the top and the bottom
49 staff.  The syntax for this is
50
51 @quotation
52 @example
53 \autochange @dots{}@var{music}@dots{}
54 @end example
55 @end quotation
56
57 @noindent
58 This will create two staves inside the current PianoStaff, called
59 @code{up} and @code{down}.  The lower staff will be in bass clef by
60 default.
61
62 A @code{\relative} section that is outside of @code{\autochange} has
63 no effect on the pitches of @var{music}, so, if necessary, put
64 @code{\relative} inside @code{\autochange} like
65
66 @quotation
67 @example
68 \autochange \relative @dots{} @dots{}
69 @end example
70 @end quotation
71
72
73 The autochanger switches on basis of the pitch (middle C is the turning
74 point), and it looks ahead skipping over rests to switch in
75 advance.  Here is a practical example
76
77 @lilypond[quote,verbatim,ragged-right]
78 \new PianoStaff
79   \autochange \relative c'
80   {
81     g4 a b c d r4 a g
82   }
83 @end lilypond
84
85
86 @seealso
87
88 Notation Reference: @ref{Manual staff switches}.
89
90 Internals Reference: @internalsref{AutoChangeMusic}.
91
92
93
94 @refbugs
95
96 The staff switches may not end up in optimal places.  For high
97 quality output, staff switches should be specified manually.
98
99
100 @code{\autochange} cannot be inside @code{\times}.
101
102
103 @node Manual staff switches
104 @subsubsection Manual staff switches
105
106 @cindex manual staff switches
107 @cindex staff switch, manual
108
109 Voices can be switched between staves manually, using the command
110 @example
111 \change Staff = @var{staffname} @var{music}
112 @end example
113
114 @noindent
115 The string @var{staffname} is the name of the staff.  It switches the
116 current voice from its current staff to the Staff called
117 @var{staffname}.  Typically @var{staffname} is @code{"up"} or
118 @code{"down"}.  The @code{Staff} referred to must already exist, so
119 usually the setup for a score will start with a setup of the staves,
120
121 @example
122 <<
123   \new Staff = "up" @{
124     \skip 1 * 10  % @emph{keep staff alive}
125     @}
126   \new Staff = "down" @{
127     \skip 1 * 10  % @emph{idem}
128     @}
129 >>
130 @end example
131
132
133 and the @code{Voice} is inserted afterwards
134
135 @example
136 \context Staff = down
137   \new Voice @{ @dots{} \change Staff = up @dots{} @}
138 @end example
139
140
141 @node Pedals
142 @subsubsection Pedals
143 @cindex Pedals
144
145 Pianos have pedals that alter the way sound is produced.  Generally, a
146 piano has three pedals, sustain, una corda, and sostenuto.
147
148
149 Piano pedal instruction can be expressed by attaching
150 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
151 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
152 note or chord
153
154 @lilypond[quote,ragged-right,fragment,verbatim]
155 c'4\sustainDown c'4\sustainUp
156 @end lilypond
157
158 What is printed can be modified by setting @code{pedal@var{X}Strings},
159 where @var{X} is one of the pedal types: @code{Sustain},
160 @code{Sostenuto} or @code{UnaCorda}.  Refer to
161 @internalsref{SustainPedal} in the program reference for more
162 information.
163
164 Pedals can also be indicated by a sequence of brackets, by setting the
165 @code{pedalSustainStyle} property to bracket objects
166
167 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
168 \set Staff.pedalSustainStyle = #'bracket
169 c\sustainDown d e
170 b\sustainUp\sustainDown
171 b g \sustainUp a \sustainDown \bar "|."
172 @end lilypond
173
174 A third style of pedal notation is a mixture of text and brackets,
175 obtained by setting the @code{pedalSustainStyle} property to
176 @code{mixed}
177
178 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
179 \set Staff.pedalSustainStyle = #'mixed
180 c\sustainDown d e
181 b\sustainUp\sustainDown
182 b g \sustainUp a \sustainDown \bar "|."
183 @end lilypond
184
185 The default @q{*Ped.} style for sustain and damper pedals corresponds to
186 style @code{#'text}.  The sostenuto pedal uses @code{mixed} style by
187 default.
188
189 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
190 c\sostenutoDown d e c, f g a\sostenutoUp
191 @end lilypond
192
193 For fine-tuning the appearance of a pedal bracket, the properties
194 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
195 @code{PianoPedalBracket} objects (see
196 @internalsref{PianoPedalBracket} in the Internals Reference) can be
197 modified.  For example, the bracket may be extended to the right edge
198 of the note head
199
200 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
201 \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0)
202 c\sostenutoDown d e c, f g a\sostenutoUp
203 @end lilypond
204
205 @seealso
206
207 Notation Reference: @ref{Ties} (laissez vibrer).
208
209 @node Staff switch lines
210 @subsubsection Staff switch lines
211
212
213 @cindex follow voice
214 @cindex staff switching
215 @cindex cross staff
216
217 @funindex followVoice
218
219 Whenever a voice switches to another staff, a line connecting the notes
220 can be printed automatically.  This is switched on by setting
221 @code{followVoice} to true
222
223 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
224 \new PianoStaff <<
225   \new Staff="one" {
226     \set followVoice = ##t
227     c1
228     \change Staff=two
229     b2 a
230   }
231   \new Staff="two" { \clef bass \skip 1*2 }
232 >>
233 @end lilypond
234
235 @seealso
236
237 Internals Reference: @internalsref{VoiceFollower}.
238
239 @refcommands
240
241 @funindex \showStaffSwitch
242 @code{\showStaffSwitch},
243 @funindex \hideStaffSwitch
244 @code{\hideStaffSwitch}.
245
246
247 @node Cross staff stems
248 @subsubsection Cross staff stems
249
250 Chords that cross staves may be produced by increasing the length
251 of the stem in the lower staff, so it reaches the stem in the upper
252 staff, or vice versa.
253
254 @lilypond[ragged-right,verbatim,quote]
255 stemExtend = {
256   \once \override Stem #'length = #10
257   \once \override Stem #'cross-staff = ##t
258 }
259 noFlag = \once \override Stem #'flag-style = #'no-flag
260 \new PianoStaff <<
261   \new Staff {
262     \stemDown \stemExtend
263     f'4
264     \stemExtend \noFlag
265     f'8
266   }
267   \new Staff {
268     \clef bass
269     a4 a8
270   }
271 >>
272 @end lilypond
273
274
275
276