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