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