]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/keyboards.itely
lilypond-book robustness: ensure EOL at the end of @verbatim
[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.12.0"
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 keyboard 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 @c @snippets
103 @c @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
104 @c {forcing-visibility-of-systems-with-multi-bar-rests-when-using-\RemoveEmptyStaffContext.ly}
105 @c http://lsr.dsi.unimi.it/LSR/Item?u=1&id=312
106
107 @seealso
108 Learning Manual:
109 @rlearning{Real music example},
110 @rlearning{Other uses for tweaks}.
111
112 Notation Reference:
113 @ref{Grouping staves},
114 @ref{Instrument names},
115 @ref{Collision resolution},
116 @ref{Writing music in parallel},
117 @ref{Fingering instructions},
118 @ref{List of articulations},
119 @ref{Grid lines},
120 @ref{Ties},
121 @ref{Arpeggio},
122 @ref{Tremolo repeats}.
123
124 Internals Reference:
125 @rinternals{PianoStaff}.
126
127 Snippets:
128 @rlsr{Keyboards}.
129
130
131 @knownissues
132
133 @cindex keyboard music, centering dynamics
134 @cindex dynamics, centered in keyboard music
135 @cindex piano music, centering dynamics
136 @cindex centered dynamics in piano music
137 @funindex staff-padding
138
139 Dynamics are not automatically centered, but workarounds do exist.  One
140 option is the @q{piano centered dynamics} template under
141 @rlearning{Piano templates}; another option is to increase the
142 @code{staff-padding} of dynamics as discussed in @rlearning{Moving
143 objects}.
144
145 @node Changing staff manually
146 @unnumberedsubsubsec Changing staff manually
147
148 @cindex changing staff manually
149 @cindex manual staff changes
150 @cindex staff changes, manual
151 @cindex cross-staff notes
152 @cindex notes, cross-staff
153 @cindex cross-staff beams
154 @cindex beams, cross-staff
155
156 @funindex \change
157 @funindex change
158
159 Voices can be switched between staves manually, using the command
160
161 @example
162 \change Staff = @var{staffname}
163 @end example
164
165 @noindent
166 The string @var{staffname} is the name of the staff.  It switches
167 the current voice from its current staff to the staff called
168 @var{staffname}.  Typical values for @var{staffname} are
169 @code{"up"} and @code{"down"}, or @code{"RH"} and @code{"LH"}.
170
171 The staff to which the voice is being switched must exist at the
172 time of the switch.  If necessary, staves should be @qq{kept alive},
173 see @ref{Keeping contexts alive}.
174
175 Cross-staff notes are beamed automatically:
176
177 @lilypond[verbatim,quote]
178 \new PianoStaff <<
179   \new Staff = "up" {
180     <e' c'>8
181     \change Staff = "down"
182     g8 fis g
183     \change Staff = "up"
184     <g'' c''>8
185     \change Staff = "down"
186     e8 dis e
187     \change Staff = "up"
188   }
189   \new Staff = "down" {
190     \clef bass
191     % keep staff alive
192     s1
193   }
194 >>
195 @end lilypond
196
197 If the beaming needs to be tweaked, make any changes to the stem
198 directions first.  The beam positions are then measured from the
199 center of the staff that is closest to the beam.  For a simple
200 example of beam tweaking, see @rlearning{Fixing overlapping
201 notation}.
202
203
204 @seealso
205 Learning Manual:
206 @rlearning{Fixing overlapping notation}.
207
208 Notation Reference:
209 @ref{Stems},
210 @ref{Automatic beams},
211 @ref{Keeping contexts alive}.
212
213 Snippets:
214 @rlsr{Keyboards}.
215
216 Internals Reference:
217 @rinternals{Beam},
218 @rinternals{ContextChange}.
219
220
221 @node Changing staff automatically
222 @unnumberedsubsubsec Changing staff automatically
223
224 @cindex changing staff automatically
225 @cindex automatic staff changes
226 @cindex staff changes, automatic
227
228 @funindex \autochange
229 @funindex autochange
230 @funindex PianoStaff
231
232 Voices can be made to switch automatically between the top and the
233 bottom staff.  The syntax for this is
234
235 @example
236 \autochange @dots{}@var{music}@dots{}
237 @end example
238
239 @noindent
240 This will create two staves inside the current staff group
241 (usually a @code{PianoStaff}), called @code{"up"} and
242 @code{"down"}.  The lower staff will be in the bass clef by default.
243 The autochanger switches on the basis of the pitch (middle@tie{}C is the
244 turning point), and it looks ahead skipping over rests to switch
245 in advance.
246
247 @lilypond[quote,verbatim]
248 \new PianoStaff {
249   \autochange {
250     g4 a b c'
251     d'4 r a g
252   }
253 }
254 @end lilypond
255
256 @cindex relative music and autochange
257 @cindex autochange and relative music
258
259 @funindex \relative
260 @funindex relative
261
262 A @code{\relative} section that is outside of @code{\autochange}
263 has no effect on the pitches of the music, so if necessary, put
264 @code{\relative} inside @code{\autochange}.
265
266 If additional control is needed over the individual staves, they
267 can be created manually with the names @code{"up"} and
268 @code{"down"}.  The @code{\autochange} command will then switch
269 its voice between the existing staves.  
270
271 @warning{If staves are created manually, they @emph{must} be named
272 @code{"up"} and @code{"down"}.}
273
274 For example, staves must be created manually in order to place a
275 key signature in the lower staff:
276
277 @lilypond[quote,verbatim]
278 \new PianoStaff <<
279   \new Staff = "up" {
280     \new Voice = "melOne" {
281       \key g \major
282       \autochange \relative c' {
283         g8 b a c b d c e
284         d8 r fis, g a2
285       }
286     }
287   }
288   \new Staff = "down" {
289     \key g \major
290     \clef bass
291   }
292 >>
293 @end lilypond
294
295
296 @seealso
297 Notation Reference:
298 @ref{Changing staff manually}.
299
300 Snippets:
301 @rlsr{Keyboards}.
302
303 Internals Reference:
304 @rinternals{AutoChangeMusic}.
305
306
307 @knownissues
308
309 @cindex chords, splitting across staves with \autochange
310
311 The staff switches may not end up in optimal places.  For high
312 quality output, staff switches should be specified manually.
313
314 Chords will not be split across the staves; they will be assigned to a
315 staff based on the first note named in the chord construct.
316
317 @node Staff-change lines
318 @unnumberedsubsubsec Staff-change lines
319
320 @cindex staff-change line
321 @cindex staff change line
322 @cindex cross-staff line
323 @cindex cross staff line
324 @cindex line, staff-change follower
325 @cindex line, cross-staff
326 @cindex line, staff-change
327 @cindex follow voice
328 @cindex voice, following
329 @cindex staff switching
330 @cindex cross-staff
331
332 @funindex followVoice
333 @funindex \showStaffSwitch
334 @funindex showStaffSwitch
335 @funindex \hideStaffSwitch
336 @funindex hideStaffSwitch
337
338 Whenever a voice switches to another staff, a line connecting the
339 notes can be printed automatically:
340
341 @lilypond[quote,verbatim,relative=1]
342 \new PianoStaff <<
343   \new Staff = "one" {
344     \showStaffSwitch
345     c1
346     \change Staff = "two"
347     b2 a
348   }
349   \new Staff = "two" {
350     \clef bass
351     s1*2
352   }
353 >>
354 @end lilypond
355
356
357 @predefined
358 @code{\showStaffSwitch},
359 @code{\hideStaffSwitch}.
360 @endpredefined
361
362
363 @seealso
364 Snippets:
365 @rlsr{Keyboards}.
366
367 Internals Reference:
368 @rinternals{Note_head_line_engraver},
369 @rinternals{VoiceFollower}.
370
371
372 @node Cross-staff stems
373 @unnumberedsubsubsec Cross-staff stems
374
375 @cindex cross-staff notes
376 @cindex cross staff notes
377 @cindex notes, cross-staff
378 @cindex cross-staff stems
379 @cindex cross staff stems
380 @cindex stems, cross-staff
381 @cindex chords, cross-staff
382 @cindex cross-staff chords
383 @cindex cross staff chords
384
385 @funindex Stem
386 @funindex cross-staff
387 @funindex length
388 @funindex flag-style
389
390 Chords that cross staves may be produced:
391
392 @lilypond[verbatim,quote]
393 \new PianoStaff <<
394   \new Staff {
395     \relative c' {
396       f8 e4 d8 d f e4
397     }
398   }
399   \new Staff {
400     \relative c' {
401       << {
402         \clef bass
403         % stems may overlap the other staff
404         \override Stem #'cross-staff = ##t
405         % extend the stems to reach other other staff
406         \override Stem #'length = #12
407         % do not print extra flags
408         \override Stem #'flag-style = #'no-flag
409         % prevent beaming as needed
410         a8 g4 f8 f bes\noBeam g4
411       }
412       \\
413       {
414         f,2 bes4 c
415       } >>
416     }
417   }
418 >>
419 @end lilypond
420
421 @snippets
422 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
423 {indicating-cross-staff-chords-with-arpeggio-bracket.ly}
424
425
426 @seealso
427 Snippets:
428 @rlsr{Keyboards}.
429
430 Internals Reference:
431 @rinternals{Stem}.
432
433
434 @node Piano
435 @subsection Piano
436
437 This section discusses notation issues that relate most directly to the
438 piano.
439
440 @menu
441 * Piano pedals::
442 @end menu
443
444 @node Piano pedals
445 @unnumberedsubsubsec Piano pedals
446
447 @cindex piano pedals
448 @cindex pedals, piano
449 @cindex sustain pedal
450 @cindex pedal, sustain
451 @cindex sostenuto pedal
452 @cindex pedal, sostenuto
453 @cindex una corda
454 @cindex tre corde
455 @cindex sos.
456 @cindex U.C.
457
458 @funindex \sustainOn
459 @funindex sustainOn
460 @funindex \sustainOff
461 @funindex sustainOff
462 @funindex \sostenutoOn
463 @funindex sostenutoOn
464 @funindex \sostenutoOff
465 @funindex sostenutoOff
466 @funindex \unaCorda
467 @funindex unaCorda
468 @funindex \treCorde
469 @funindex treCorde
470
471 Pianos generally have three pedals that alter the way sound is
472 produced: @notation{sustain}, @notation{sostenuto}
473 (@notation{sos.}), and @notation{una corda} (@notation{U.C.}).
474 Sustain pedals are also found on vibraphones and celestas.
475
476 @lilypond[quote,verbatim,relative=2]
477 c4\sustainOn d e g
478 <c, f a>1\sustainOff
479 c4\sostenutoOn e g c,
480 <bes d f>1\sostenutoOff
481 c4\unaCorda d e g
482 <d fis a>1\treCorde
483 @end lilypond
484
485 @cindex pedal indication styles
486 @cindex pedal indication, text
487 @cindex pedal indication, bracket
488 @cindex pedal indication, mixed
489 @cindex pedal sustain style
490 @cindex sustain pedal style
491
492 @funindex pedalSustainStyle
493 @funindex mixed
494 @funindex bracket
495 @funindex text
496
497 There are three styles of pedal indications: text, bracket, and mixed.
498 The sustain pedal and the una corda pedal use the text style by default
499 while the sostenuto pedal uses mixed by default.
500
501 @lilypond[quote,verbatim,relative=2]
502 c4\sustainOn g c2\sustainOff
503 \set Staff.pedalSustainStyle = #'mixed
504 c4\sustainOn g c d
505 d\sustainOff\sustainOn g, c2\sustainOff
506 \set Staff.pedalSustainStyle = #'bracket
507 c4\sustainOn g c d
508 d\sustainOff\sustainOn g, c2
509 \bar "|."
510 @end lilypond
511
512 The placement of the pedal commands matches the physical movement of the
513 sustain pedal during piano performance.  Pedalling to the final bar line
514 is indicated by omitting the final pedal off command.
515
516
517 @seealso
518 Notation Reference:
519 @ref{Ties}.
520
521 Snippets:
522 @rlsr{Keyboards}.
523
524 Internals Reference:
525 @rinternals{SustainPedal},
526 @rinternals{SustainPedalLineSpanner},
527 @rinternals{SustainEvent},
528 @rinternals{SostenutoPedal},
529 @rinternals{SostenutoPedalLineSpanner},
530 @rinternals{SostenutoEvent},
531 @rinternals{UnaCordaPedal},
532 @rinternals{UnaCordaPedalLineSpanner},
533 @rinternals{UnaCordaEvent},
534 @rinternals{PianoPedalBracket},
535 @rinternals{Piano_pedal_engraver}.
536
537
538 @node Accordion
539 @subsection Accordion
540
541 @cindex accordion
542
543 This section discusses notation that is unique to the accordion.
544
545 @menu
546 * Discant symbols::
547 @end menu
548
549 @node Discant symbols
550 @unnumberedsubsubsec Discant symbols
551
552 @cindex accordion discant symbols
553 @cindex discant symbols, accordion
554 @cindex accordion shifts
555 @cindex accordion shift symbols
556
557 Accordions are often built with more than one set of reeds that may be
558 in unison with, an octave above, or an octave below the written pitch.
559 Each accordion maker has different names for the @notation{shifts} that
560 select the various reed combinations, such as @notation{oboe},
561 @notation{musette}, or @notation{bandonium}, so a system of symbols has
562 come into use to simplify the performance instructions.
563
564 @snippets
565
566 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
567 {accordion-discant-symbols.ly}
568
569
570 @seealso
571 Snippets:
572 @rlsr{Keyboards}.
573
574
575 @node Harp
576 @subsection Harp
577
578 This section discusses notation issues that are unique to the harp.
579
580 @menu
581 * References for harps::
582 * Harp pedals::
583 @end menu
584
585 @node References for harps
586 @unnumberedsubsubsec References for harps
587 @cindex harps
588 @cindex bisbiglando
589
590 Some common characteristics of harp music are covered elsewhere:
591
592 @itemize
593
594 @item The glissando is the most characterisic harp technique,
595 @ref{Glissando}.
596
597 @item A @notation{bisbigliando} is written as a tremelo @ref{Tremolo
598 repeats}
599
600 @item Natural harmonics are covered under @ref{Harmonics}.
601
602 @item For directional arpeggios and non-arpeggios, see @ref{Arpeggio}.
603
604 @end itemize
605
606 @seealso
607 Notation Reference:
608 @ref{Tremolo repeats}
609 @ref{Glissando}
610 @ref{Arpeggio}
611 @ref{Harmonics}
612
613 @node Harp pedals
614 @unnumberedsubsubsec Harp pedals
615
616 @cindex harp pedals
617 @cindex harp pedal diagrams
618 @cindex pedals, harp
619 @cindex pedal diagrams, harp
620
621 Harps have seven strings per octave that may be sounded at the natural,
622 flattened, or sharpened pitch. In lever harps, each string is adjusted
623 individually, but in pedal harps every string with the same pitch name
624 is controlled by a single pedal. From the player's left to right, the
625 pedals are D, C, and B on the left and E, F, G, and A on the right.
626 The position of the pedals may be indicated with text marks:
627
628 @lilypond[quote,verbatim,relative=2]
629 \textLengthOn
630 cis1_\markup \concat \vcenter { [D \flat C \sharp B|E \sharp F \sharp G A \flat] }
631 c!1_\markup \concat \vcenter {[ C \natural ]}
632 @end lilypond
633
634 or pedal diagrams:
635
636 @lilypond[quote,verbatim,relative=2]
637 \textLengthOn
638 cis1_\markup { \harp-pedal #"^v-|vv-^" }
639 c!1_\markup { \harp-pedal #"^o--|vv-^" }
640 @end lilypond
641
642 The @code{\harp-pedal} command accepts a string of characters, where
643 @code{^} is the highest pedal position (flattened pitch), @code{-} is
644 the middle pedal postion (natural pitch), @code{v} is the lowest pedal
645 position (sharpened pitch), and @code{|} is the divider. A prefixed
646 @code{o} will circle the following pedal symbol.
647
648 @seealso
649 Notation Reference:
650 @ref{Text scripts}
651 @ref{Instrument Specific Markup}