]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/percussion.itely
Merge master into nested-bookparts
[lilypond.git] / Documentation / user / percussion.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.61"
10
11 @node Percussion
12 @section Percussion
13
14 @menu
15 * Common notation for percussion::
16 @end menu
17
18 @node Common notation for percussion
19 @subsection Common notation for percussion
20
21 Rhythmic music is primarily used for percussion and drum notation, but it can
22 also be used to show the rhythms of melodies.
23
24 @menu
25 * References for percussion::
26 * Basic percussion notation::
27 * Drum rolls::
28 * Pitched percussion::
29 * Percussion staves::
30 * Custom percussion staves::
31 * Ghost notes::
32 @end menu
33
34 @node References for percussion
35 @unnumberedsubsubsec References for percussion
36
37 TODO add more.
38
39 @itemize
40
41 @item Some percussion may be notated on a rhythmic staff; this is
42 discussed in @ref{Showing melody rhythms}, and
43 @ref{Instantiating new staves}.
44
45 @item MIDI output is discussed in a separate section; please see
46 @ref{Percussion in MIDI}.
47
48 @end itemize
49
50 @seealso
51
52 Notation Reference:
53 @ref{Showing melody rhythms},
54 @ref{Instantiating new staves}.
55 @ref{Percussion in MIDI}.
56
57 Snippets: @rlsr{Percussion}.
58
59
60 @node Basic percussion notation
61 @unnumberedsubsubsec Basic percussion notation
62
63 @cindex percussion
64 @cindex drums
65
66 Percussion notes may be entered in @code{\drummode} mode, which is
67 similar to the standard mode for entering notes.  The simplest way
68 to enter percussion notes is to use the @code{\drums} command,
69 which creates the correct context and entry mode for percussion:
70
71 @lilypond[quote,verbatim]
72 \drums {
73   hihat4 hh bassdrum bd
74 }
75 @end lilypond
76
77 This is shorthand for:
78
79 @lilypond[quote,verbatim]
80 \new DrumStaff {
81   \drummode {
82     hihat4 hh bassdrum bd
83   }
84 }
85 @end lilypond
86
87 Each piece of percussion has a full name and an abbreviated name,
88 and both can be used in input files.  The full list of percussion
89 note names may be found in @ref{Percussion notes}.
90
91 Note that the normal notation of pitches (such as @code{cis4}) in
92 a @code{DrumStaff} context will cause an error message.
93 Percussion clefs are added automatically to a @code{DrumStaff}
94 contex, but other clefs may also be used.
95
96 There are a few issues concerning MIDI support for percussion
97 instruments; for details please see @ref{Percussion in MIDI}.
98
99 @seealso
100
101 Notation Reference: @ref{Percussion in MIDI}, @ref{Percussion notes}.
102
103 File: @file{ly/@/drumpitch@/-init@/.ly}
104
105 Snippets: @rlsr{Percussion}.
106
107
108 @node Drum rolls
109 @unnumberedsubsubsec Drum rolls
110
111 Drum rolls are indicated with three slashes across the stem.  For
112 quarter notes or longer the three slashes are shown explicitly,
113 eighth notes are shown with two slashes (the beam being the
114 third), and drum rolls shorter than eighths have one stem slash to
115 supplement the beams.  This is achieved with the tremolo notation,
116 @code{:32}, as described in @ref{Tremolo repeats}.  Here is an
117 example of some snare rolls:
118
119 @lilypond[quote,verbatim]
120 \drums {
121   \time 2/4
122   sn16 sn8 sn16 sn8 sn8:32 ~
123   sn8 sn8 sn4:32 ~
124   sn4 sn8 sn16 sn16
125   sn4 r4
126 }
127 @end lilypond
128
129 Sticking can be indicated by placing @code{^"R"} or @code{^"L"}
130 after the note.  The @code{staff-padding} property may be
131 overridden to achieve a pleasing baseline.
132
133 @lilypond[quote,verbatim]
134 \drums {
135   \repeat unfold 2 {
136     sn16 ^"L" sn^"R" sn^"L" sn^"L" sn^"R" sn^"L"  sn^"R" sn^"R"
137   }
138 }
139 @end lilypond
140
141 @seealso
142
143 Snippets: @rlsr{Percussion}.
144
145
146 @node Pitched percussion
147 @unnumberedsubsubsec Pitched percussion
148
149 Certain pitched percussion instruments (e.g. xylophone,
150 vibraphone, and timpani) are written using normal staves.
151 This is covered in other sections of the manual.
152
153 @seealso
154
155 @c TODO: possibly link to an alternate section of NR 3.5, if
156 @c "percussion in MIDI" gets a separate subsubsection for
157 @c pitched percussion sounds.  -gp
158 Notation Reference: @ref{Percussion in MIDI}.
159
160 Snippets: @rlsr{Percussion}.
161
162
163 @node Percussion staves
164 @unnumberedsubsubsec Percussion staves
165
166 @cindex percussion
167 @cindex drums
168
169 A percussion part for more than one instrument typically uses a
170 multiline staff where each position in the staff refers to one
171 piece of percussion.  To typeset the music, the notes must be
172 interpreted in @code{DrumStaff} and @code{DrumVoice} context.
173
174 @lilypond[quote,verbatim]
175 up = \drummode {
176   crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat
177 }
178 down = \drummode {
179   bassdrum4 snare8 bd r bd sn4
180 }
181 \new DrumStaff <<
182   \new DrumVoice { \voiceOne \up }
183   \new DrumVoice { \voiceTwo \down }
184 >>
185 @end lilypond
186
187 The above example shows verbose polyphonic notation.  The short
188 polyphonic notation, described in @rlearning{I'm hearing Voices},
189 can also be used if the voices are instantiated by hand first.
190 For example,
191
192 @lilypond[quote,verbatim]
193 \new DrumStaff <<
194   \new DrumVoice = "1" { s1*2 }
195   \new DrumVoice = "2" { s1*2 }
196   \drummode {
197     bd4 sn4 bd4 sn4
198     << {
199       \repeat unfold 16 hh16
200     } \\ {
201       bd4 sn4 bd4 sn4
202     } >>
203   }
204 >>
205 @end lilypond
206
207 There are also other layout possibilities.  To use these, set the
208 property @code{drumStyleTable} in context @code{DrumVoice}.  The
209 following variables have been predefined:
210
211 @c FIXME: decide what to do about this table.  (ie verbatim or not)
212 @table @code
213
214 @item drums-style
215 This is the default.  It typesets a typical drum kit on a
216 five-line staff:
217
218 @lilypond[quote,line-width=10.0\cm]
219 nam = \lyricmode {
220   cymc cyms cymr hh hhc hho hhho hhp
221   cb hc bd sn ss tomh tommh tomml toml tomfh tomfl }
222 mus = \drummode {
223   cymc cyms cymr hh hhc hho hhho hhp \break
224   cb hc bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
225 \score {
226   << \new DrumStaff \with {
227        \remove Bar_engraver
228        \remove Time_signature_engraver
229        \override Stem #'transparent = ##t
230        \override Stem #'Y-extent-callback = ##f
231        \override VerticalAxisGroup #'minimum-Y-extent = #'(-4.0 . 5.0)
232      } \mus
233      \new Lyrics \nam
234   >>
235   \layout {
236     \context {
237       \Score
238       \override LyricText #'font-family = #'typewriter
239       \override BarNumber #'transparent =##T
240     }
241   }
242 }
243 @end lilypond
244
245 The drum scheme supports six different toms.  When there are fewer
246 toms, simply select the toms that produce the desired result.  For
247 example, to get toms on the three middle lines you use
248 @code{tommh}, @code{tomml}, and @code{tomfh}.
249
250 @item timbales-style
251 This typesets timbales on a two line staff:
252
253 @lilypond[quote,ragged-right]
254 nam = \lyricmode { timh ssh timl ssl cb }
255 mus = \drummode { timh ssh timl ssl cb s16 }
256
257 <<
258   \new DrumStaff \with {
259     \remove Bar_engraver
260     \remove Time_signature_engraver
261     \override Stem #'transparent = ##t
262     \override Stem #'Y-extent-callback = ##f
263     \override StaffSymbol #'line-count = #2
264     \override StaffSymbol #'staff-space = #2
265     \override VerticalAxisGroup #'minimum-Y-extent = #'(-3.0 . 4.0)
266     drumStyleTable = #timbales-style
267   } \mus
268   \new Lyrics {
269     \override LyricText #'font-family = #'typewriter
270     \nam
271   }
272 >>
273 @end lilypond
274
275 @item congas-style
276 This typesets congas on a two line staff:
277
278 @lilypond[quote,ragged-right]
279 nam = \lyricmode { cgh cgho cghm ssh cgl cglo cglm ssl }
280 mus = \drummode { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
281
282 <<
283   \new DrumStaff \with {
284     \remove Bar_engraver
285     \remove Time_signature_engraver
286     drumStyleTable = #congas-style
287     \override StaffSymbol #'line-count = #2
288
289     %% this sucks; it will lengthen stems.
290     \override StaffSymbol #'staff-space = #2
291     \override Stem #'transparent = ##t
292     \override Stem #'Y-extent-callback = ##f
293   } \mus
294   \new Lyrics {
295     \override LyricText #'font-family = #'typewriter
296     \nam
297   }
298 >>
299 @end lilypond
300
301 @item bongos-style
302 This typesets bongos on a two line staff:
303
304 @lilypond[quote,ragged-right]
305 nam = \lyricmode { boh boho bohm ssh bol bolo bolm ssl }
306 mus = \drummode { boh boho bohm ssh bol bolo bolm ssl s16 }
307
308 <<
309   \new DrumStaff \with {
310     \remove Bar_engraver
311     \remove Time_signature_engraver
312     \override StaffSymbol #'line-count = #2
313     drumStyleTable = #bongos-style
314
315     %% this sucks; it will lengthen stems.
316     \override StaffSymbol #'staff-space = #2
317     \override Stem #'transparent = ##t
318     \override Stem #'Y-extent-callback = ##f
319   } \mus
320   \new Lyrics {
321     \override LyricText #'font-family = #'typewriter
322     \nam
323   }
324 >>
325 @end lilypond
326
327 @item percussion-style
328 To typeset all kinds of simple percussion on one line staves:
329
330 @lilypond[quote,ragged-right]
331 nam = \lyricmode { tri trio trim gui guis guil cb cl tamb cab mar hc }
332 mus = \drummode { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
333
334 <<
335   \new DrumStaff \with{
336     \remove Bar_engraver
337     drumStyleTable = #percussion-style
338     \override StaffSymbol #'line-count = #1
339     \remove Time_signature_engraver
340     \override Stem #'transparent = ##t
341     \override Stem #'Y-extent-callback = ##f
342   } \mus
343   \new Lyrics {
344     \override LyricText #'font-family = #'typewriter
345     \nam
346   }
347 >>
348 @end lilypond
349 @end table
350
351
352 @node Custom percussion staves
353 @unnumberedsubsubsec Custom percussion staves
354
355 If you do not like any of the predefined lists you can define your
356 own list at the top of your file.
357
358 @lilypond[quote,verbatim]
359 #(define mydrums '(
360          (bassdrum     default   #f         -1)
361          (snare        default   #f         0)
362          (hihat        cross     #f         1)
363          (pedalhihat   xcircle   "stopped"  2)
364          (lowtom       diamond   #f         3)))
365 up = \drummode { hh8 hh hh hh hhp4 hhp }
366 down = \drummode { bd4 sn bd toml8 toml }
367
368 \new DrumStaff <<
369   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
370   \new DrumVoice { \voiceOne \up }
371   \new DrumVoice { \voiceTwo \down }
372 >>
373 @end lilypond
374
375
376 @snippets
377
378 FIXME: MOVE ALL THESE TO LSR!  -gp
379
380 Here are some examples:
381
382 Two Woodblocks, entered with wbh (high woodblock) and wbl (low woodblock)
383
384 @lilypond[quote,verbatim]
385 % These lines define the position of the woodblocks in the stave;
386 % if you like, you can change it or you can use special note heads
387 % for the woodblocks.
388 #(define mydrums '((hiwoodblock default #t  3)
389                    (lowoodblock default #t -2)))
390
391 woodstaff = {
392   % This defines a staff with only two lines.
393   % It also defines the positions of the two lines.
394   \override Staff.StaffSymbol #'line-positions = #'(-2 3)
395
396   % This is neccessary; if not entered, the barline wuld be too short!
397   \override Staff.BarLine #'bar-size = #3
398 }
399
400 \new DrumStaff {
401   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
402
403   % with this you load your new drum style table
404   \woodstaff
405
406   \drummode {
407     \time 2/4
408     wbl8 wbl16 wbl wbh8-> wbl |
409     wbl8 wbl16 wbh-> ~ wbh wbl16 r8 |
410   }
411 }
412 @end lilypond
413
414 Note that in this special case the length of the barline must
415 altered with @code{\override Staff.BarLine #'bar-size #number}.
416 Otherwise it would be too short.  And you have also to define the
417 positions of the two stafflines.  For more information about these
418 delicate things have a look at @ref{Staff symbol}.
419
420 A tambourine, entered with @q{tamb}:
421
422 @lilypond[quote,verbatim]
423 tambustaff = {
424   \override Staff.StaffSymbol #'line-positions = #'( 0 )
425   \override Staff.BarLine #'bar-size = #3
426   \set DrumStaff.instrumentName = "Tambourine"
427 }
428
429 \new DrumStaff {
430   \tambustaff
431   % broken
432   % \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
433
434   \drummode {
435     \time 6/8
436     \repeat "unfold" 2 { tamb8. tamb16 tamb8 tamb tamb tamb | }
437     tamb4. tamb8 tamb tamb |
438     % the trick with the scaled duration and the shorter rest
439     % is neccessary for the correct ending of the trill-span!
440     tamb2.*5/6 \startTrillSpan s8 \stopTrillSpan |
441   }
442 }
443 @end lilypond
444
445 Music for Tam-Tam (entered with @q{tt}):
446
447 @lilypond[quote,verbatim]
448 #(define mydrums '((tamtam default #t 0)))
449
450 tamtamstaff = {
451   \override Staff.StaffSymbol #'line-positions = #'( 0 )
452   \override Staff.BarLine #'bar-size = #3
453   \set DrumStaff.instrumentName = "Tamtam"
454 }
455
456 \new DrumStaff {
457   \tamtamstaff
458   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
459
460   \drummode {
461     tt 1 \pp \laissezVibrer
462   }
463 }
464 @end lilypond
465
466 Two different bells, entered with @q{cb} (cowbell) and @q{rb} (ridebell)
467
468 @lilypond[quote,verbatim]
469 #(define mydrums '((ridebell default #t  3)
470                    (cowbell  default #t -2)))
471
472 bellstaff = {
473   \override DrumStaff.StaffSymbol #'line-positions = #'(-2 3)
474   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
475   \override Staff.BarLine #'bar-size = #3
476   \set DrumStaff.instrumentName = "Different Bells"
477 }
478
479 \new DrumStaff {
480   \bellstaff
481   \drummode {
482     \time 2/4
483     \repeat "unfold" 2 { rb8 rb cb cb16 rb-> ~ |
484                          rb16 rb8 rb16 cb8 cb | }
485   }
486 }
487 @end lilypond
488
489 Here an short example by maestro Stravinsky (from @q{L'histoire du Soldat})
490
491 @lilypond[quote,verbatim]
492 #(define mydrums '((bassdrum   default #t  4)
493                    (snare      default #t -4)
494                    (tambourine default #t  0)))
495
496 global = {
497   \time 3/8 s4.
498   \time 2/4 s2*2
499   \time 3/8 s4.
500   \time 2/4 s2
501 }
502
503 drumsA = {
504   \context DrumVoice <<
505     { \global }
506     { \drummode {
507         \autoBeamOff
508         \stemDown sn8 \stemUp tamb s8 |
509         sn4 \stemDown sn4 |
510         \stemUp tamb8 \stemDown sn8 \stemUp sn16 \stemDown sn \stemUp sn8 |
511         \stemDown sn8 \stemUp tamb s8 |
512         \stemUp sn4 s8 \stemUp tamb
513       }
514     }
515   >>
516 }
517
518 drumsB = {
519   \drummode {
520     s4 bd8 s2*2 s4 bd8 s4 bd8 s8
521   }
522 }
523
524 \layout {
525   indent = #40
526 }
527
528 \score {
529   \new StaffGroup <<
530     \new DrumStaff {
531       \set DrumStaff.instrumentName = \markup {
532         \column {
533           "Tambourine"
534           "et"
535           "caisse claire s. timbre"
536         }
537       }
538       \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
539       \drumsA
540     }
541
542    \new DrumStaff {
543      \set DrumStaff.instrumentName = "Grosse Caisse"
544      \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
545      \drumsB }
546   >>
547 }
548 @end lilypond
549
550 @seealso
551
552 Snippets: @rlsr{Percussion}.
553
554 Internals Reference: @rinternals{DrumStaff}, @rinternals{DrumVoice}.
555
556
557
558 @c TODO: check name -gp
559 @node Ghost notes
560 @unnumberedsubsubsec Ghost notes
561
562 Ghost notes for drums and percussion may be created using the
563 @code{\parenthesize} command detailed in @ref{Parentheses}.
564 However, the default @code{\drummode} does not include the
565 @code{Parenthesis_engraver} plugin which allows this.
566
567 @lilypond[quote,ragged-right,verbatim,fragment]
568 \new DrumStaff \with {
569   \consists "Parenthesis_engraver"
570 } <<
571   \context DrumVoice  = "1"  { s1 *2 }
572   \context DrumVoice  = "2" { s1 *2 }
573   \drummode {
574     <<
575       {
576         hh8[ hh] <hh sn> hh16
577         < \parenthesize sn > hh
578         < \parenthesize sn > hh8 <hh sn> hh
579       } \\ {
580         bd4 r4 bd8 bd r8 bd
581       }
582     >>
583   }
584 >>
585 @end lilypond
586
587 @noindent
588 Also note that you must add chords (@code{< >} brackets)
589 around each @code{\parenthesize} statement.
590
591 @seealso
592
593 Snippets: @rlsr{Percussion}.