]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/keyboards.itely
Split WWW target in two stages WWW-1 and WWW-2
[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 @c Andrew's TODO List
12 @c references - first pass complete
13 @c manual changes - first pass complete
14 @c automatic changes - first pass complete
15 @c staff-change lines - first pass complete
16 @c cross-staff stems - first pass complete
17 @c pedals - first pass complete
18 @c accordian discant symbols
19
20 @node Keyboard instruments
21 @section Keyboard instruments
22
23 @menu
24 * Common notation for keyboards::
25 * Piano::
26 * Accordion::
27 @end menu
28
29 @node Common notation for keyboards
30 @subsection Common notation for keyboards
31
32 @menu
33 * References for keyboards::
34 * Changing staff manually::
35 * Changing staff automatically::
36 * Staff-change lines::
37 * Cross-staff stems::
38 @end menu
39
40 @node References for keyboards
41 @subsubsection References for keyboards
42
43 Keyboard instruments are usually notated with Piano staves.  These
44 are two or more normal staves coupled with a brace.  The same
45 notation is also used for harps and other keyed instruments.
46 Organ music is normally written with two staves inside a
47 @code{PianoStaff} group and third, normal staff for the pedals.
48
49 The staves in keyboard music are largely independent, but
50 sometimes voices can cross between the two staves.  In this
51 section we discuss some notation techniques particular to keyboard
52 music.
53
54 Several common issues in keyboard music are covered elsewhere:
55
56 @itemize
57 @item Keyboard music usually contains multiple voices and the
58 number of voices may change regularly; this is described in
59 @ref{Collision resolution}.
60
61 @item Keyboard music can be written in parallel, as described in
62 @ref{Writing music in parallel}.
63
64 @item Fingerings are indicated with @ref{Fingering instructions}.
65
66 @item Organ pedal indications are inserted as articulations, see
67 @ref{List of articulations}.
68
69 @item Vertical grid lines can be shown with @ref{Grid lines}.
70
71 @item Keyboard music often contains @notation{Laissez vibrer} ties
72 as well as ties on arpeggios and tremelos, described in
73 @ref{Ties}.
74
75 @item Placing arpeggios across multiple voices and staves is
76 covered in @ref{Arpeggio}.
77
78 @item Tremolo marks are described in @ref{Tremolo repeats}.
79
80 @item Several of the tweaks that can occur in keyboard music are
81 demonstrated in @rlearning{Real music example}.
82
83 @item Hidden notes can be used to produce ties that cross voices,
84 as shown in @rlearning{Other uses for tweaks}.
85
86 @end itemize
87
88 @c @snippets
89 @c @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
90 @c {creating-slurs-across-voices.ly}
91
92 @seealso
93
94 Learning Manual:
95 @rlearning{Real music example},
96 @rlearning{Other uses for tweaks}.
97
98 Notation Reference:
99 @ref{Grouping staves},
100 @ref{Instrument names},
101 @ref{Writing music in parallel},
102 @ref{Fingering instructions},
103 @ref{Grid lines},
104 @ref{Ties},
105 @ref{Arpeggio},
106 @ref{Tremolo repeats},
107 @ref{List of articulations}.
108
109 Internals Reference:
110 @rinternals{PianoStaff}.
111
112 Snippets:
113 @rlsr{Keyboards}.
114
115 @knownissues
116
117 Dynamics are not centered, but workarounds do exist.  See the
118 @q{piano centered dynamics} template in @rlearning{Piano templates}.
119
120 @c TODO Find out status of the dynamics engravers
121
122 @node Changing staff manually
123 @subsubsection Changing staff manually
124
125 @cindex changing staff manually
126 @cindex manual staff changes
127 @cindex staff changes, manual
128 @cindex cross-staff notes
129 @cindex notes, cross-staff
130 @cindex cross-staff beams
131 @cindex beams, cross-staff
132 @funindex \change
133
134 Voices can be switched between staves manually, using the command
135
136 @example
137 \change Staff = @var{staffname}
138 @end example
139
140 @noindent
141 The string @var{staffname} is the name of the staff.  It switches
142 the current voice from its current staff to the Staff called
143 @var{staffname}.  Typical values for @var{staffname} are
144 @code{"up"} and @code{"down"}, or @code{"RH"} and @code{"LH"}.
145
146 Cross-staff notes are beamed automatically:
147
148 @lilypond[verbatim,quote,ragged-right]
149 \new PianoStaff <<
150   \new Staff = "up" {
151     <e' c'>8
152     \change Staff = down
153     g fis g
154     \change Staff = up
155     <g'' c''>8
156     \change Staff = down
157     e dis e
158     \change Staff = up
159   }
160   \new Staff = "down" {
161     \clef bass
162     s1 % keep staff alive
163   }
164 >>
165 @end lilypond
166
167 If the beaming needs to be tweaked, make any changes to the stem
168 directions first.  The beam positions are then measured from the
169 center of the staff that is closest to the beam.  For a simple
170 example of beam tweaking, see @rlearning{Fixing overlapping
171 notation}.
172
173 @seealso
174
175 Learning Manual:
176 @rlearning{Fixing overlapping notation}.
177
178 Notation Reference:
179 @ruser{Stems},
180 @ruser{Automatic beams}.
181
182 Snippets:
183 @rlsr{Keyboards}.
184
185 Internals Reference:
186 @rinternals{Beam}.
187
188
189 @node Changing staff automatically
190 @subsubsection Changing staff automatically
191
192 @cindex changing staff automatically
193 @cindex automatic staff changes
194 @cindex staff changes, automatic
195 @funindex \autochange
196
197 Voices can be made to switch automatically between the top and the
198 bottom staff.  The syntax for this is
199
200 @example
201 \autochange @dots{}@var{music}@dots{}
202 @end example
203
204 @noindent
205 This will create two staves inside the current staff group
206 (usually a @code{PianoStaff}), called @code{"up"} and
207 @code{"down"}.  The lower staff will be in bass clef by default.
208 The autochanger switches on basis of the pitch (middle C is the
209 turning point), and it looks ahead skipping over rests to switch
210 in advance.
211
212 @lilypond[quote,verbatim,ragged-right]
213 \new PianoStaff {
214   \autochange {
215     g4 a b c' d' r4 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,ragged-right]
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         d 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; the staff will be
265 chosen by the first note named in the chord.
266
267
268 @node Staff-change lines
269 @subsubsection Staff-change lines
270
271 @cindex staff-change lines
272 @cindex cross-staff lines
273 @cindex lines, staff-change follower
274 @cindex follow voice
275 @cindex staff switching
276 @cindex cross-staff
277 @funindex followVoice
278
279 Whenever a voice switches to another staff, a line connecting the
280 notes can be printed automatically:
281
282 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
283 \new PianoStaff <<
284   \new Staff = "one" {
285     \showStaffSwitch
286     c1
287     \change Staff=two
288     b2 a
289   }
290   \new Staff = "two" { \clef bass s1*2 }
291 >>
292 @end lilypond
293
294 @predefined
295
296 @funindex \showStaffSwitch
297 @funindex \hideStaffSwitch
298 @code{\showStaffSwitch}, @code{\hideStaffSwitch}.
299
300 @seealso
301
302 Snippets:
303 @rlsr{Keyboards}.
304
305 Internals Reference:
306 @rinternals{VoiceFollower}.
307
308
309 @node Cross-staff stems
310 @subsubsection Cross-staff stems
311
312 @cindex cross-staff notes
313 @cindex notes, cross-staff
314 @cindex cross-staff stems
315 @cindex stems, cross-staff
316
317 Chords that cross staves may be produced by increasing the length
318 of the stem in the lower staff, so it reaches the stem in the upper
319 staff, or vice versa.
320
321 @lilypond[ragged-right,verbatim,quote]
322 \new PianoStaff <<
323   \new Staff \relative c' {
324     f8 e4 d8 <f bes,>2
325   }
326   \new Staff \relative c' {
327     << {
328       \clef bass
329       \stemUp
330       \override Stem #'length = #12
331       \override Stem #'cross-staff = ##t
332       \override Stem #'flag-style = #'no-flag
333       a8 g4 f8
334     } \\
335     { f,2 d' }
336     >>
337   }
338 >>
339 @end lilypond
340
341 @snippets
342 @c @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
343 @c {indicating-cross-staff-chords-with-arpeggio-bracket.ly}
344
345
346 @seealso
347
348 Snippets:
349 @rlsr{Keyboards}.
350
351 Internals Reference:
352 @rinternals{Stem}
353
354 @node Piano
355 @subsection Piano
356
357 @menu
358 * Piano pedals::
359 @end menu
360
361 @node Piano pedals
362 @subsubsection Piano pedals
363 @cindex Pedals
364
365 Pianos have pedals that alter the way sound is produced.  Generally, a
366 piano has three pedals, sustain, una corda, and sostenuto.
367
368
369 Piano pedal instruction can be expressed by attaching
370 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
371 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
372 note or chord
373
374 @lilypond[quote,ragged-right,fragment,verbatim]
375 c'4\sustainDown c'4\sustainUp
376 @end lilypond
377
378 What is printed can be modified by setting @code{pedal@var{X}Strings},
379 where @var{X} is one of the pedal types: @code{Sustain},
380 @code{Sostenuto} or @code{UnaCorda}.  Refer to
381 @rinternals{SustainPedal} in the program reference for more
382 information.
383
384 Pedals can also be indicated by a sequence of brackets, by setting the
385 @code{pedalSustainStyle} property to bracket objects
386
387 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
388 \set Staff.pedalSustainStyle = #'bracket
389 c\sustainDown d e
390 b\sustainUp\sustainDown
391 b g \sustainUp a \sustainDown \bar "|."
392 @end lilypond
393
394 A third style of pedal notation is a mixture of text and brackets,
395 obtained by setting the @code{pedalSustainStyle} property to
396 @code{mixed}
397
398 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
399 \set Staff.pedalSustainStyle = #'mixed
400 c\sustainDown d e
401 b\sustainUp\sustainDown
402 b g \sustainUp a \sustainDown \bar "|."
403 @end lilypond
404
405 The default @q{*Ped.} style for sustain and damper pedals corresponds to
406 style @code{#'text}.  The sostenuto pedal uses @code{mixed} style by
407 default.
408
409 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
410 c\sostenutoDown d e c, f g a\sostenutoUp
411 @end lilypond
412
413 For fine-tuning the appearance of a pedal bracket, the properties
414 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
415 @code{PianoPedalBracket} objects (see
416 @rinternals{PianoPedalBracket} in the Internals Reference) can be
417 modified.  For example, the bracket may be extended to the right edge
418 of the note head
419
420 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
421 \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0)
422 c\sostenutoDown d e c, f g a\sostenutoUp
423 @end lilypond
424
425 @noindent
426 Note that overrides must be placed before the note at which the 
427 pedal bracket starts.
428
429 @c TODO Check relative positions of the sustain pedal and
430 @c      dynamics are correct (they collided in 2.11.44).
431 @c      Give example showing this.
432
433 @seealso
434
435 Notation Reference: @ref{Ties} (laissez vibrer).
436
437 @node Accordion
438 @subsection Accordion
439
440 @menu
441 * Discant symbols::
442 @end menu
443
444 @node Discant symbols
445 @subsubsection Discant symbols
446
447 @c TODO Add text from -user and lsr 194
448 TBC