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