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