]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/keyboards.itely
Test patch 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 @node Keyboard instruments
12 @section Keyboard instruments
13
14 TODO
15 My suggestion is this: in section 7.1.1 and/or 7.1.2 of the
16 manual,
17 about staff switching, add a sentence or two plus a simple example
18 showing how the beams are handled automatically if you enter notes
19 that
20 require beaming (i.e. 8ths or shorter).  Anyone coming from Finale
21 will
22 be looking for "cross-staff beaming" instead of staff switching.
23 If I
24 had seen an example of notes switching staves, beamed together
25 like
26 that, I would have known immediately that that was what I was
27 looking for.
28
29
30 @menu
31 * Common notation for keyboards::
32 * Piano::
33 * Accordion::
34 @end menu
35
36 @node Common notation for keyboards
37 @subsection Common notation for keyboards
38
39 @menu
40 * References for keyboards::
41 * The piano staff::
42 * Changing staff manually::
43 * Changing staff automatically::
44 * Staff-change lines::
45 * Cross-staff stems::
46 @end menu
47
48 @node References for keyboards
49 @subsubsection References for keyboards
50
51 @c TODO add refs
52 TBC
53
54 @node The piano staff
55 @subsubsection The piano staff
56
57 Keyboard instruments are usually notated with Piano staves.
58 These are two or more normal staves coupled with a brace.  The staves
59 are largely independent, but sometimes voices can cross between the
60 two staves.  The same notation is also used for harps and other key
61 instruments.  The @internalsref{PianoStaff} is especially built to
62 handle this cross-staffing behavior.  In this section we discuss the
63 @internalsref{PianoStaff} and some other pianistic peculiarities.
64
65 @knownissues
66
67 Dynamics are not centered, but workarounds do exist.  See the
68 @q{piano centered dynamics} template in @rlearning{Piano templates}.
69
70 @cindex cross staff stem
71 @cindex stem, cross staff
72 @cindex distance between staves in piano music
73
74 @node Changing staff manually
75 @subsubsection Changing staff manually
76
77 @cindex manual staff switches
78 @cindex staff switch, manual
79
80 Voices can be switched between staves manually, using the command
81 @example
82 \change Staff = @var{staffname} @var{music}
83 @end example
84
85 @noindent
86 The string @var{staffname} is the name of the staff.  It switches the
87 current voice from its current staff to the Staff called
88 @var{staffname}.  Typically @var{staffname} is @code{"up"} or
89 @code{"down"}.  The @code{Staff} referred to must already exist, so
90 usually the setup for a score will start with a setup of the staves,
91
92 @example
93 <<
94   \new Staff = "up" @{
95     \skip 1 * 10  % @emph{keep staff alive}
96     @}
97   \new Staff = "down" @{
98     \skip 1 * 10  % @emph{idem}
99     @}
100 >>
101 @end example
102
103
104 and the @code{Voice} is inserted afterwards
105
106 @example
107 \context Staff = down
108   \new Voice @{ @dots{} \change Staff = up @dots{} @}
109 @end example
110
111
112 @node Changing staff automatically
113 @subsubsection Changing staff automatically
114 @cindex Automatic staff changes
115
116 Voices can be made to switch automatically between the top and the bottom
117 staff.  The syntax for this is
118
119 @quotation
120 @example
121 \autochange @dots{}@var{music}@dots{}
122 @end example
123 @end quotation
124
125 @noindent
126 This will create two staves inside the current PianoStaff, called
127 @code{up} and @code{down}.  The lower staff will be in bass clef by
128 default.
129
130 A @code{\relative} section that is outside of @code{\autochange} has
131 no effect on the pitches of @var{music}, so, if necessary, put
132 @code{\relative} inside @code{\autochange} like
133
134 @quotation
135 @example
136 \autochange \relative @dots{} @dots{}
137 @end example
138 @end quotation
139
140
141 The autochanger switches on basis of the pitch (middle C is the turning
142 point), and it looks ahead skipping over rests to switch in
143 advance.  Here is a practical example
144
145 @lilypond[quote,verbatim,ragged-right]
146 \new PianoStaff
147   \autochange \relative c'
148   {
149     g4 a b c d r4 a g
150   }
151 @end lilypond
152
153
154 @seealso
155
156 @c Notation Reference: @ref{Manual staff switches}.
157
158 Internals Reference: @internalsref{AutoChangeMusic}.
159
160
161
162 @knownissues
163
164 The staff switches may not end up in optimal places.  For high
165 quality output, staff switches should be specified manually.
166
167
168 @code{\autochange} cannot be inside @code{\times}.
169
170 @node Staff-change lines
171 @subsubsection Staff-change lines
172
173
174 @cindex follow voice
175 @cindex staff switching
176 @cindex cross staff
177
178 @funindex followVoice
179
180 Whenever a voice switches to another staff, a line connecting the notes
181 can be printed automatically.  This is switched on by setting
182 @code{followVoice} to true
183
184 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
185 \new PianoStaff <<
186   \new Staff="one" {
187     \set followVoice = ##t
188     c1
189     \change Staff=two
190     b2 a
191   }
192   \new Staff="two" { \clef bass \skip 1*2 }
193 >>
194 @end lilypond
195
196 @seealso
197
198 Internals Reference: @internalsref{VoiceFollower}.
199
200 @predefined
201
202 @funindex \showStaffSwitch
203 @code{\showStaffSwitch},
204 @funindex \hideStaffSwitch
205 @code{\hideStaffSwitch}.
206
207 @node Cross-staff stems
208 @subsubsection Cross-staff stems
209
210 Chords that cross staves may be produced by increasing the length
211 of the stem in the lower staff, so it reaches the stem in the upper
212 staff, or vice versa.
213
214 @lilypond[ragged-right,verbatim,quote]
215 stemExtend = {
216   \once \override Stem #'length = #10
217   \once \override Stem #'cross-staff = ##t
218 }
219 noFlag = \once \override Stem #'flag-style = #'no-flag
220 \new PianoStaff <<
221   \new Staff {
222     \stemDown \stemExtend
223     f'4
224     \stemExtend \noFlag
225     f'8
226   }
227   \new Staff {
228     \clef bass
229     a4 a8
230   }
231 >>
232 @end lilypond
233
234 @node Piano
235 @subsection Piano
236
237 @menu
238 * Piano pedals::
239 @end menu
240
241 @node Piano pedals
242 @subsubsection Piano pedals
243 @cindex Pedals
244
245 Pianos have pedals that alter the way sound is produced.  Generally, a
246 piano has three pedals, sustain, una corda, and sostenuto.
247
248
249 Piano pedal instruction can be expressed by attaching
250 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
251 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
252 note or chord
253
254 @lilypond[quote,ragged-right,fragment,verbatim]
255 c'4\sustainDown c'4\sustainUp
256 @end lilypond
257
258 What is printed can be modified by setting @code{pedal@var{X}Strings},
259 where @var{X} is one of the pedal types: @code{Sustain},
260 @code{Sostenuto} or @code{UnaCorda}.  Refer to
261 @internalsref{SustainPedal} in the program reference for more
262 information.
263
264 Pedals can also be indicated by a sequence of brackets, by setting the
265 @code{pedalSustainStyle} property to bracket objects
266
267 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
268 \set Staff.pedalSustainStyle = #'bracket
269 c\sustainDown d e
270 b\sustainUp\sustainDown
271 b g \sustainUp a \sustainDown \bar "|."
272 @end lilypond
273
274 A third style of pedal notation is a mixture of text and brackets,
275 obtained by setting the @code{pedalSustainStyle} property to
276 @code{mixed}
277
278 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
279 \set Staff.pedalSustainStyle = #'mixed
280 c\sustainDown d e
281 b\sustainUp\sustainDown
282 b g \sustainUp a \sustainDown \bar "|."
283 @end lilypond
284
285 The default @q{*Ped.} style for sustain and damper pedals corresponds to
286 style @code{#'text}.  The sostenuto pedal uses @code{mixed} style by
287 default.
288
289 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
290 c\sostenutoDown d e c, f g a\sostenutoUp
291 @end lilypond
292
293 For fine-tuning the appearance of a pedal bracket, the properties
294 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
295 @code{PianoPedalBracket} objects (see
296 @internalsref{PianoPedalBracket} in the Internals Reference) can be
297 modified.  For example, the bracket may be extended to the right edge
298 of the note head
299
300 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
301 \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0)
302 c\sostenutoDown d e c, f g a\sostenutoUp
303 @end lilypond
304
305 @noindent
306 Note that overrides must be placed before the note at which the 
307 pedal bracket starts.
308
309 @c TODO Check relative positions of the sustain pedal and
310 @c      dynamics are correct (they collided in 2.11.44).
311 @c      Give example showing this.
312
313 @seealso
314
315 Notation Reference: @ref{Ties} (laissez vibrer).
316
317 @node Accordion
318 @subsection Accordion
319
320 @menu
321 * Discant symbols::
322 @end menu
323
324 @node Discant symbols
325 @subsubsection Discant symbols
326
327 @c TODO Add text from -user and lsr 194
328 TBC
329
330
331
332
333