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