]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/keyboards.itely
indent fix.
[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.51"
10
11 @node Keyboard instruments
12 @section Keyboard instruments
13
14 @lilypondfile[quote]{keyboard-headword.ly}
15
16 This section discusses several aspects of music notation that are unique
17 to keyboard instruments.
18
19 @menu
20 * Common notation for keyboards::
21 * Piano::
22 * Accordion::
23 @end menu
24
25 @node Common notation for keyboards
26 @subsection Common notation for keyboards
27
28 This section discusses notation issues that may arise for most keyboard
29 instruments.
30
31 @menu
32 * References for keyboards::
33 * Changing staff manually::
34 * Changing staff automatically::
35 * Staff-change lines::
36 * Cross-staff stems::
37 @end menu
38
39 @node References for keyboards
40 @unnumberedsubsubsec References for keyboards
41
42 Keyboard instruments are usually notated with Piano staves.  These
43 are two or more normal staves coupled with a brace.  The same
44 notation is also used for other keyed instruments.
45 Organ music is normally written with two staves inside a
46 @code{PianoStaff} group and third, normal staff for the pedals.
47
48 The staves in keyboard music are largely independent, but
49 sometimes voices can cross between the two staves.  This
50 section discusses notation techniques particular to keyboard
51 music.
52
53 Several common issues in keyboard music are covered elsewhere:
54
55 @itemize
56 @item Keyboard music usually contains multiple voices and the
57 number of voices may change regularly; this is described in
58 @ref{Collision resolution}.
59
60 @item Keyboard music can be written in parallel, as described in
61 @ref{Writing music in parallel}.
62
63 @item Fingerings are indicated with @ref{Fingering instructions}.
64
65 @item Organ pedal indications are inserted as articulations, see
66 @ref{List of articulations}.
67
68 @item Vertical grid lines can be shown with @ref{Grid lines}.
69
70 @item Keyboard music often contains @notation{Laissez vibrer} ties
71 as well as ties on arpeggios and tremolos, described in
72 @ref{Ties}.
73
74 @item Placing arpeggios across multiple voices and staves is
75 covered in @ref{Arpeggio}.
76
77 @item Tremolo marks are described in @ref{Tremolo repeats}.
78
79 @item Several of the tweaks that can occur in keyboard music are
80 demonstrated in @rlearning{Real music example}.
81
82 @item Hidden notes can be used to produce ties that cross voices,
83 as shown in @rlearning{Other uses for tweaks}.
84
85 @end itemize
86
87 @seealso
88
89 Learning Manual:
90 @rlearning{Real music example},
91 @rlearning{Other uses for tweaks}.
92
93 Notation Reference:
94 @ref{Grouping staves},
95 @ref{Instrument names},
96 @ref{Collision resolution},
97 @ref{Writing music in parallel},
98 @ref{Fingering instructions},
99 @ref{List of articulations},
100 @ref{Grid lines},
101 @ref{Ties},
102 @ref{Arpeggio},
103 @ref{Tremolo repeats}.
104
105 Internals Reference:
106 @rinternals{PianoStaff}.
107
108 Snippets:
109 @rlsr{Keyboards}.
110
111 @knownissues
112
113 Dynamics are not automatically centered, but workarounds do exist.  One
114 option is the @q{piano centered dynamics} template under
115 @rlearning{Piano templates}; another option is to increase the
116 @code{staff-padding} of dynamics as discussed in @rlearning{Moving
117 objects}.
118
119 @node Changing staff manually
120 @unnumberedsubsubsec Changing staff manually
121
122 @cindex changing staff manually
123 @cindex manual staff changes
124 @cindex staff changes, manual
125 @cindex cross-staff notes
126 @cindex notes, cross-staff
127 @cindex cross-staff beams
128 @cindex beams, cross-staff
129 @funindex \change
130
131 Voices can be switched between staves manually, using the command
132
133 @example
134 \change Staff = @var{staffname}
135 @end example
136
137 @noindent
138 The string @var{staffname} is the name of the staff.  It switches
139 the current voice from its current staff to the staff called
140 @var{staffname}.  Typical values for @var{staffname} are
141 @code{"up"} and @code{"down"}, or @code{"RH"} and @code{"LH"}.
142
143 Cross-staff notes are beamed automatically:
144
145 @lilypond[verbatim,quote]
146 \new PianoStaff <<
147   \new Staff = "up" {
148     <e' c'>8
149     \change Staff = "down"
150     g8 fis g
151     \change Staff = "up"
152     <g'' c''>8
153     \change Staff = "down"
154     e8 dis e
155     \change Staff = "up"
156   }
157   \new Staff = "down" {
158     \clef bass
159     % keep staff alive
160     s1
161   }
162 >>
163 @end lilypond
164
165 If the beaming needs to be tweaked, make any changes to the stem
166 directions first.  The beam positions are then measured from the
167 center of the staff that is closest to the beam.  For a simple
168 example of beam tweaking, see @rlearning{Fixing overlapping
169 notation}.
170
171 @seealso
172
173 Learning Manual:
174 @rlearning{Fixing overlapping notation}.
175
176 Notation Reference:
177 @ruser{Stems},
178 @ruser{Automatic beams}.
179
180 Snippets:
181 @rlsr{Keyboards}.
182
183 Internals Reference:
184 @rinternals{Beam},
185 @rinternals{ContextChange}.
186
187
188 @node Changing staff automatically
189 @unnumberedsubsubsec Changing staff automatically
190
191 @cindex changing staff automatically
192 @cindex automatic staff changes
193 @cindex staff changes, automatic
194 @funindex \autochange
195
196 Voices can be made to switch automatically between the top and the
197 bottom staff.  The syntax for this is
198
199 @example
200 \autochange @dots{}@var{music}@dots{}
201 @end example
202
203 @noindent
204 This will create two staves inside the current staff group
205 (usually a @code{PianoStaff}), called @code{"up"} and
206 @code{"down"}.  The lower staff will be in the bass clef by default.
207 The autochanger switches on the basis of the pitch (middle@tie{}C is the
208 turning point), and it looks ahead skipping over rests to switch
209 in advance.
210
211 @lilypond[quote,verbatim]
212 \new PianoStaff {
213   \autochange {
214     g4 a b c'
215     d'4 r a g
216   }
217 }
218 @end lilypond
219
220 A @code{\relative} section that is outside of @code{\autochange}
221 has no effect on the pitches of the music, so if necessary, put
222 @code{\relative} inside @code{\autochange}.
223
224 If additional control is needed over the individual staves, they
225 can be created manually with the names @code{"up"} and
226 @code{"down"}.  The @code{\autochange} command will then switch
227 its voice between the existing staves.  For example, this is
228 necessary to place a key signature in the lower staff:
229
230 @lilypond[quote,verbatim]
231 \new PianoStaff <<
232   \new Staff = "up" {
233     \new Voice = "melOne" {
234       \key g \major
235       \autochange \relative c' {
236         g8 b a c b d c e
237         d8 r fis, g a2
238       }
239     }
240   }
241   \new Staff = "down" {
242     \key g \major
243     \clef bass
244   }
245 >>
246 @end lilypond
247
248 @seealso
249
250 Notation Reference:
251 @ref{Changing staff manually}.
252
253 Snippets:
254 @rlsr{Keyboards}.
255
256 Internals Reference:
257 @rinternals{AutoChangeMusic}.
258
259 @knownissues
260
261 The staff switches may not end up in optimal places.  For high
262 quality output, staff switches should be specified manually.
263
264 Chords will not be split across the staves; they will be assigned to a
265 staff based on the first note named in the chord construct.
266
267 @node Staff-change lines
268 @unnumberedsubsubsec Staff-change lines
269
270 @cindex staff-change lines
271 @cindex cross-staff lines
272 @cindex lines, staff-change follower
273 @cindex follow voice
274 @cindex staff switching
275 @cindex cross-staff
276 @funindex followVoice
277
278 Whenever a voice switches to another staff, a line connecting the
279 notes can be printed automatically:
280
281 @lilypond[quote,verbatim,relative=1]
282 \new PianoStaff <<
283   \new Staff = "one" {
284     \showStaffSwitch
285     c1
286     \change Staff = "two"
287     b2 a
288   }
289   \new Staff = "two" {
290     \clef bass
291     s1*2
292   }
293 >>
294 @end lilypond
295
296 @predefined
297
298 @funindex \showStaffSwitch
299 @funindex \hideStaffSwitch
300 @code{\showStaffSwitch}, @code{\hideStaffSwitch}.
301
302 @seealso
303
304 Snippets:
305 @rlsr{Keyboards}.
306
307 Internals Reference:
308 @rinternals{Note_head_line_engraver},
309 @rinternals{VoiceFollower}.
310
311
312 @node Cross-staff stems
313 @unnumberedsubsubsec Cross-staff stems
314
315 @cindex cross-staff notes
316 @cindex notes, cross-staff
317 @cindex cross-staff stems
318 @cindex stems, cross-staff
319
320 Chords that cross staves may be produced:
321
322 @lilypond[verbatim,quote]
323 \new PianoStaff <<
324   \new Staff {
325     \relative c' {
326       f8 e4 d8 <f bes,>2
327     }
328   }
329   \new Staff {
330     \relative c' {
331       << {
332         \clef bass
333         % stems may overlap the other staff
334         \override Stem #'cross-staff = ##t
335         % extend the stems to reach other other staff
336         \override Stem #'length = #12
337         % do not print extra flags
338         \override Stem #'flag-style = #'no-flag
339         a8 g4 f8
340       }
341       \\
342       {
343         f,2 d'
344       } >>
345     }
346   }
347 >>
348 @end lilypond
349
350 @snippets
351 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
352 {indicating-cross-staff-chords-with-arpeggio-bracket.ly}
353
354 @seealso
355
356 Snippets:
357 @rlsr{Keyboards}.
358
359 Internals Reference:
360 @rinternals{Stem}.
361
362 @node Piano
363 @subsection Piano
364
365 This section discusses notation issues that relate most directly to the
366 piano.
367
368 @menu
369 * Piano pedals::
370 @end menu
371
372 @node Piano pedals
373 @unnumberedsubsubsec Piano pedals
374 @cindex piano pedals
375 @cindex pedals, piano
376 @cindex sustain pedal
377 @cindex sostenuto pedal
378 @cindex una corda
379 @cindex tre corde
380 @funindex \sustainOn
381 @funindex \sustainOff
382 @funindex \sostenutoOn
383 @funindex \sostenutoOff
384 @funindex \unaCorda
385 @funindex \treCorde
386
387 Pianos generally have three pedals that alter the way sound is
388 produced: @notation{sustain}, @notation{sostenuto}
389 (@notation{sos.}), and @notation{una corda} (@notation{U.C.}).
390 Sustain pedals are also found on vibraphones and celestas.
391
392 @lilypond[quote,verbatim,relative=2]
393 c4\sustainOn d e g
394 <c, f a>1\sustainOff
395 c4\sostenutoOn e g c,
396 <bes d f>1\sostenutoOff
397 c4\unaCorda d e g
398 <d fis a>1\treCorde
399 @end lilypond
400
401 There are three styles of pedal indications: text, bracket, and mixed.
402 The sustain pedal and the una corda pedal use the text style by default
403 while the sostenuto pedal uses mixed by default.
404
405 @lilypond[quote,verbatim,relative=2]
406 c4\sustainOn g c2\sustainOff
407 \set Staff.pedalSustainStyle = #'mixed
408 c4\sustainOn g c d
409 d\sustainOff\sustainOn g, c2\sustainOff
410 \set Staff.pedalSustainStyle = #'bracket
411 c4\sustainOn g c d
412 d\sustainOff\sustainOn g, c2
413 \bar "|."
414 @end lilypond
415
416 The placement of the pedal commands matches the physical movement of the
417 sustain pedal during piano performance.  Pedalling to the final bar line
418 is indicated by omitting the final pedal up command.
419
420 @seealso
421
422 Notation Reference:
423 @ref{Ties}.
424
425 Snippets:
426 @rlsr{Keyboards}.
427
428 Internals Reference:
429 @rinternals{SustainPedal},
430 @rinternals{SustainPedalLineSpanner},
431 @rinternals{SustainEvent},
432 @rinternals{SostenutoPedal},
433 @rinternals{SostenutoPedalLineSpanner},
434 @rinternals{SostenutoEvent},
435 @rinternals{UnaCordaPedal},
436 @rinternals{UnaCordaPedalLineSpanner},
437 @rinternals{UnaCordaEvent},
438 @rinternals{PianoPedalBracket},
439 @rinternals{Piano_pedal_engraver}.
440
441 @node Accordion
442 @subsection Accordion
443
444 This section discusses notation that is unique to the accordion.
445
446 @menu
447 * Discant symbols::
448 @end menu
449
450 @node Discant symbols
451 @unnumberedsubsubsec Discant symbols
452 @cindex accordion discant symbols
453 @cindex discant symbols, accordion
454 @cindex accordion shifts
455
456 Accordions are often built with more than one set of reeds that may be
457 in unison with, an octave above, or an octave below the written pitch.
458 Each accordion maker has different names for the @notation{shifts} that
459 select the various reed combinations, such as @notation{oboe},
460 @notation{musette}, or @notation{bandonium}, so a system of symbols has
461 come into use to simplify the performance instructions.
462
463 @snippets
464
465 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
466 {accordion-discant-symbols.ly}
467
468 @seealso
469
470 Snippets:
471 @rlsr{Keyboards}.