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