]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/percussion.itely
Merge branch 'master' of git://git.sv.gnu.org/lilypond.git into td-lily
[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.38"
10
11 @node Percussion
12 @section Percussion
13
14 @menu
15 * Percussion sections::         
16 @end menu
17
18 @node Percussion sections
19 @subsection Percussion sections
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 * Showing melody rhythms::      
26 * Entering percussion::         
27 * Percussion staves::           
28 * Ghost notes::                 
29 @end menu
30
31
32 @node Showing melody rhythms
33 @subsubsection Showing melody rhythms
34
35 Sometimes you might want to show only the rhythm of a melody.  This
36 can be done with the rhythmic staff.  All pitches of notes on such a
37 staff are squashed, and the staff itself has a single line
38
39 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
40 \new RhythmicStaff {
41   \time 4/4
42   c4 e8 f g2 | r4 g r2 | g1:32 | r1 |
43 }
44 @end lilypond
45
46 @seealso
47
48 Internals Reference: @internalsref{RhythmicStaff}.
49
50
51 @node Entering percussion
52 @subsubsection Entering percussion
53
54 @cindex percussion
55 @cindex drums
56
57
58 Percussion notes may be entered in @code{\drummode} mode, which is
59 similar to the standard mode for entering notes.  Each piece of
60 percussion has a full name and an abbreviated name, and both can be used
61 in input files
62
63 @lilypond[quote,ragged-right,verbatim]
64 \drums {
65   hihat hh bassdrum bd
66 }
67 @end lilypond
68
69 The complete list of drum names is in the init file
70 @file{ly/@/drumpitch@/-init@/.ly}.
71 @c TODO: properly document this.
72
73 @seealso
74
75 Internals Reference: @internalsref{note-event}.
76
77 @node Percussion staves
78 @subsubsection Percussion staves
79 @cindex percussion
80 @cindex drums
81
82 A percussion part for more than one instrument typically uses a
83 multiline staff where each position in the staff refers to one piece
84 of percussion.
85
86
87 To typeset the music, the notes must be interpreted in a
88 @internalsref{DrumStaff} and @internalsref{DrumVoice} contexts
89
90 @lilypond[quote,ragged-right,verbatim]
91 up = \drummode { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
92 down = \drummode { bassdrum4 snare8 bd r bd sn4 }
93   \new DrumStaff <<
94     \new DrumVoice { \voiceOne \up }
95     \new DrumVoice { \voiceTwo \down }
96   >>
97 @end lilypond
98
99 The above example shows verbose polyphonic notation.  The short
100 polyphonic notation, described in @rlearning{I'm seeing Voices},
101 can also be used if the @internalsref{DrumVoice}s are instantiated
102 by hand first.  For example,
103
104 @lilypond[quote,ragged-right,fragment,verbatim]
105 \new DrumStaff <<
106   \new DrumVoice = "1" { s1 *2 }
107   \new DrumVoice = "2" { s1 *2 }
108   \drummode {
109     bd4 sn4 bd4 sn4
110     <<
111       { \repeat unfold 16 hh16 }
112       \\
113       { bd4 sn4 bd4 sn4 }
114     >>
115   }
116 >>
117 @end lilypond
118
119
120 There are also other layout possibilities.  To use these, set the
121 property @code{drumStyleTable} in context @internalsref{DrumVoice}.
122 The following variables have been predefined
123
124 @table @code
125 @item drums-style
126 This is the default.  It typesets a typical drum kit on a five-line staff
127
128 @lilypond[quote,line-width=10.0\cm]
129 nam = \lyricmode {
130   cymc cyms cymr hh hhc hho hhho hhp
131   cb hc bd sn ss tomh tommh tomml toml tomfh tomfl }
132 mus = \drummode {
133   cymc cyms cymr hh hhc hho hhho hhp \break
134   cb hc bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
135 \score {
136   << \new DrumStaff \with {
137        \remove Bar_engraver
138        \remove Time_signature_engraver
139        \override Stem #'transparent = ##t
140        \override Stem #'Y-extent-callback = ##f
141        \override VerticalAxisGroup #'minimum-Y-extent = #'(-4.0 . 5.0)
142      } \mus
143      \new Lyrics \nam
144   >>
145   \layout {
146     \context {
147       \Score
148       \override LyricText #'font-family = #'typewriter
149       \override BarNumber #'transparent =##T
150     }
151   }
152 }
153 @end lilypond
154
155 The drum scheme supports six different toms.  When there are fewer toms,
156 simply select the toms that produce the desired result, i.e., to get toms
157 on the three middle lines you use @code{tommh}, @code{tomml}, and
158 @code{tomfh}.
159
160 @item timbales-style
161 This typesets timbales on a two line staff
162
163 @lilypond[quote,ragged-right]
164 nam = \lyricmode { timh ssh timl ssl cb }
165 mus = \drummode { timh ssh timl ssl cb s16 }
166
167 <<
168   \new DrumStaff \with {
169     \remove Bar_engraver
170     \remove Time_signature_engraver
171     \override Stem #'transparent = ##t
172     \override Stem #'Y-extent-callback = ##f
173     \override StaffSymbol #'line-count = #2
174     \override StaffSymbol #'staff-space = #2
175     \override VerticalAxisGroup #'minimum-Y-extent = #'(-3.0 . 4.0)
176     drumStyleTable = #timbales-style
177   } \mus
178   \new Lyrics {
179     \override LyricText #'font-family = #'typewriter
180     \nam
181   }
182 >>
183 @end lilypond
184
185 @item congas-style
186 This typesets congas on a two line staff
187
188 @lilypond[quote,ragged-right]
189 nam = \lyricmode { cgh cgho cghm ssh cgl cglo cglm ssl }
190 mus = \drummode { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
191
192 <<
193   \new DrumStaff \with {
194     \remove Bar_engraver
195     \remove Time_signature_engraver
196     drumStyleTable = #congas-style
197     \override StaffSymbol #'line-count = #2
198
199     %% this sucks; it will lengthen stems.
200     \override StaffSymbol #'staff-space = #2
201     \override Stem #'transparent = ##t
202     \override Stem #'Y-extent-callback = ##f
203   } \mus
204   \new Lyrics {
205     \override LyricText #'font-family = #'typewriter
206     \nam
207   }
208 >>
209 @end lilypond
210
211 @item bongos-style
212 This typesets bongos on a two line staff
213
214 @lilypond[quote,ragged-right]
215 nam = \lyricmode { boh boho bohm ssh bol bolo bolm ssl }
216 mus = \drummode { boh boho bohm ssh bol bolo bolm ssl s16 }
217
218 <<
219   \new DrumStaff \with {
220     \remove Bar_engraver
221     \remove Time_signature_engraver
222     \override StaffSymbol #'line-count = #2
223     drumStyleTable = #bongos-style
224
225     %% this sucks; it will lengthen stems.
226     \override StaffSymbol #'staff-space = #2
227     \override Stem #'transparent = ##t
228     \override Stem #'Y-extent-callback = ##f
229   } \mus
230   \new Lyrics {
231     \override LyricText #'font-family = #'typewriter
232     \nam
233   }
234 >>
235 @end lilypond
236
237 @item percussion-style
238 To typeset all kinds of simple percussion on one line staves.
239
240 @lilypond[quote,ragged-right]
241 nam = \lyricmode { tri trio trim gui guis guil cb cl tamb cab mar hc }
242 mus = \drummode { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
243
244 <<
245   \new DrumStaff \with{
246     \remove Bar_engraver
247     drumStyleTable = #percussion-style
248     \override StaffSymbol #'line-count = #1
249     \remove Time_signature_engraver
250     \override Stem #'transparent = ##t
251     \override Stem #'Y-extent-callback = ##f
252   } \mus
253   \new Lyrics {
254     \override LyricText #'font-family = #'typewriter
255     \nam
256   }
257 >>
258 @end lilypond
259 @end table
260
261 If you do not like any of the predefined lists you can define your own
262 list at the top of your file
263
264 @lilypond[quote,ragged-right,verbatim]
265 #(define mydrums '(
266          (bassdrum     default   #f         -1)
267          (snare        default   #f         0)
268          (hihat        cross     #f         1)
269          (pedalhihat   xcircle   "stopped"  2)
270          (lowtom       diamond   #f         3)))
271 up = \drummode { hh8 hh hh hh hhp4 hhp }
272 down = \drummode { bd4 sn bd toml8 toml }
273
274 \new DrumStaff <<
275   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
276   \new DrumVoice { \voiceOne \up }
277   \new DrumVoice { \voiceTwo \down }
278 >>
279 @end lilypond
280
281
282 @seealso
283
284 Init files: @file{ly/@/drumpitch@/-init@/.ly}.
285
286 Internals Reference: @internalsref{DrumStaff}, @internalsref{DrumVoice}.
287
288 @knownissues
289
290 Because general MIDI does not contain rim shots, the sidestick is used
291 for this purpose instead.
292
293
294 @c TODO: check name -gp
295 @node Ghost notes
296 @subsubsection Ghost notes
297
298 Ghost notes for drums and percussion may be created using the
299 @code{\parenthesize} command detailed in @ref{Parentheses}.  However,
300 the default @code{\drummode} does
301 not include the @code{Parenthesis_engraver} plugin which allows
302 this.  You
303 must add the plugin explicitly in the context definition as
304 detailed in @ref{Changing context properties on the fly}.
305
306 @lilypond[quote,ragged-right,verbatim,fragment]
307 \new DrumStaff \with {
308   \consists "Parenthesis_engraver"
309 } <<
310   \context DrumVoice  = "1"  { s1 *2 }
311   \context DrumVoice  = "2" { s1 *2 }
312   \drummode {
313     <<
314       {
315         hh8[ hh] <hh sn> hh16
316         < \parenthesize sn > hh < \parenthesize
317         sn > hh8 <hh sn> hh
318       } \\ {
319         bd4 r4 bd8 bd r8 bd
320       }
321     >>
322   }
323 >>
324 @end lilypond
325
326 @noindent
327 Also note that you must add chords (@code{< >} brackets)
328 around each @code{\parenthesize} statement.
329
330
331