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