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