]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/keyboards.itely
Update from Ralph.
[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 - started
16 @c cross-staff stems
17 @c pedals
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 @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
121 @node Changing staff manually
122 @subsubsection Changing staff manually
123
124 @cindex changing staff manually
125 @cindex manual staff changes
126 @cindex staff changes, manual
127 @cindex cross-staff notes
128 @cindex notes, cross-staff
129 @cindex cross-staff beams
130 @cindex beams, cross-staff
131 @funindex \change
132
133 Voices can be switched between staves manually, using the command
134
135 @example
136 \change Staff = @var{staffname}
137 @end example
138
139 @noindent
140 The string @var{staffname} is the name of the staff.  It switches
141 the current voice from its current staff to the Staff called
142 @var{staffname}.  Typical values for @var{staffname} are
143 @code{"up"} and @code{"down"}, or @code{"RH"} and @code{"LH"}.
144
145 Cross-staff notes are beamed automatically:
146
147 @lilypond[verbatim,quote,ragged-right]
148 \new PianoStaff <<
149   \new Staff = "up" {
150     <e' c'>8
151     \change Staff = down
152     g fis g
153     \change Staff = up
154     <g'' c''>8
155     \change Staff = down
156     e dis e
157     \change Staff = up
158   }
159   \new Staff = "down" {
160     \clef "bass"
161     s1 % keep staff alive
162   }
163 >>
164 @end lilypond
165
166 If the beaming needs to be tweaked, make any changes to the stem
167 directions first.  The beam positions are then measured from the
168 center of the staff that is closest to the beam.  For a simple
169 example of beam tweaking, see @rlearning{Fixing overlapping
170 notation}.
171
172 @seealso
173
174 Learning Manual:
175 @rlearning{Fixing overlapping notation}.
176
177 Notation Reference:
178 @ruser{Stems},
179 @ruser{Automatic beams}.
180
181 Snippets:
182 @rlsr{Keyboards}.
183
184 Internals Reference:
185 @rinternals{Beam}.
186
187
188 @node Changing staff automatically
189 @subsubsection 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 bass clef by default.
207 The autochanger switches on basis of the pitch (middle C is the
208 turning point), and it looks ahead skipping over rests to switch
209 in advance.
210
211 @lilypond[quote,verbatim,ragged-right]
212 \new PianoStaff {
213   \autochange {
214     g4 a b c' d' r4 a g
215   }
216 }
217 @end lilypond
218
219 A @code{\relative} section that is outside of @code{\autochange}
220 has no effect on the pitches of the music, so if necessary, put
221 @code{\relative} inside @code{\autochange}.
222
223 If additional control is needed over the individual staves, they
224 can be created manually with the names @code{"up"} and
225 @code{"down"}.  The @code{\autochange} command will then switch
226 its voice between the existing staves.  For example, this is
227 necessary to place a key signature in the lower staff:
228
229 @lilypond[quote,verbatim,ragged-right]
230 \new PianoStaff <<
231   \new Staff = "up" {
232     \new Voice = "melOne" {
233       \key g \major
234       \autochange \relative c' {
235         g8 b a c b d c e
236         d r fis, g a2
237       }
238     }
239   }
240   \new Staff = "down" {
241     \key g \major
242     \clef "bass"
243   }
244 >>
245 @end lilypond
246
247 @seealso
248
249 Notation Reference: @ref{Changing staff manually}.
250
251 Internals Reference: @rinternals{AutoChangeMusic}.
252
253 @knownissues
254
255 The staff switches may not end up in optimal places.  For high
256 quality output, staff switches should be specified manually.
257
258 Chords will not be split across the staves; the staff will be
259 chosen by the first note named in the chord.
260
261
262 @node Staff-change lines
263 @subsubsection Staff-change lines
264
265 @cindex staff-change lines
266 @cindex cross-staff lines
267 @cindex lines, staff-change follower
268 @cindex follow voice
269 @cindex staff switching
270 @cindex cross-staff
271 @funindex followVoice
272
273 Whenever a voice switches to another staff, a line connecting the
274 notes can be printed automatically.  This is switched on by
275 setting @code{followVoice} to true, or by the shorthand commands
276 @code{\showStaffSwitch} and @code{\hideStaffSwitch}.
277
278 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
279 \new PianoStaff <<
280   \new Staff="one" {
281     \showStaffSwitch
282     c1
283     \change Staff=two
284     b2 a
285   }
286   \new Staff="two" { \clef bass s1*2 }
287 >>
288 @end lilypond
289
290 @seealso
291
292 Internals Reference: @rinternals{VoiceFollower}.
293
294 @predefined
295
296 @funindex \showStaffSwitch
297 @code{\showStaffSwitch},
298 @funindex \hideStaffSwitch
299 @code{\hideStaffSwitch}.
300
301
302 @node Cross-staff stems
303 @subsubsection Cross-staff stems
304
305 Chords that cross staves may be produced by increasing the length
306 of the stem in the lower staff, so it reaches the stem in the upper
307 staff, or vice versa.
308
309 @lilypond[ragged-right,verbatim,quote]
310 stemExtend = {
311   \once \override Stem #'length = #10
312   \once \override Stem #'cross-staff = ##t
313 }
314 noFlag = \once \override Stem #'flag-style = #'no-flag
315 \new PianoStaff <<
316   \new Staff {
317     \stemDown \stemExtend
318     f'4
319     \stemExtend \noFlag
320     f'8
321   }
322   \new Staff {
323     \clef bass
324     a4 a8
325   }
326 >>
327 @end lilypond
328
329 @node Piano
330 @subsection Piano
331
332 @menu
333 * Piano pedals::
334 @end menu
335
336 @node Piano pedals
337 @subsubsection Piano pedals
338 @cindex Pedals
339
340 Pianos have pedals that alter the way sound is produced.  Generally, a
341 piano has three pedals, sustain, una corda, and sostenuto.
342
343
344 Piano pedal instruction can be expressed by attaching
345 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
346 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
347 note or chord
348
349 @lilypond[quote,ragged-right,fragment,verbatim]
350 c'4\sustainDown c'4\sustainUp
351 @end lilypond
352
353 What is printed can be modified by setting @code{pedal@var{X}Strings},
354 where @var{X} is one of the pedal types: @code{Sustain},
355 @code{Sostenuto} or @code{UnaCorda}.  Refer to
356 @rinternals{SustainPedal} in the program reference for more
357 information.
358
359 Pedals can also be indicated by a sequence of brackets, by setting the
360 @code{pedalSustainStyle} property to bracket objects
361
362 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
363 \set Staff.pedalSustainStyle = #'bracket
364 c\sustainDown d e
365 b\sustainUp\sustainDown
366 b g \sustainUp a \sustainDown \bar "|."
367 @end lilypond
368
369 A third style of pedal notation is a mixture of text and brackets,
370 obtained by setting the @code{pedalSustainStyle} property to
371 @code{mixed}
372
373 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
374 \set Staff.pedalSustainStyle = #'mixed
375 c\sustainDown d e
376 b\sustainUp\sustainDown
377 b g \sustainUp a \sustainDown \bar "|."
378 @end lilypond
379
380 The default @q{*Ped.} style for sustain and damper pedals corresponds to
381 style @code{#'text}.  The sostenuto pedal uses @code{mixed} style by
382 default.
383
384 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
385 c\sostenutoDown d e c, f g a\sostenutoUp
386 @end lilypond
387
388 For fine-tuning the appearance of a pedal bracket, the properties
389 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
390 @code{PianoPedalBracket} objects (see
391 @rinternals{PianoPedalBracket} in the Internals Reference) can be
392 modified.  For example, the bracket may be extended to the right edge
393 of the note head
394
395 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
396 \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0)
397 c\sostenutoDown d e c, f g a\sostenutoUp
398 @end lilypond
399
400 @noindent
401 Note that overrides must be placed before the note at which the 
402 pedal bracket starts.
403
404 @c TODO Check relative positions of the sustain pedal and
405 @c      dynamics are correct (they collided in 2.11.44).
406 @c      Give example showing this.
407
408 @seealso
409
410 Notation Reference: @ref{Ties} (laissez vibrer).
411
412 @node Accordion
413 @subsection Accordion
414
415 @menu
416 * Discant symbols::
417 @end menu
418
419 @node Discant symbols
420 @subsubsection Discant symbols
421
422 @c TODO Add text from -user and lsr 194
423 TBC