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