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