]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/percussion.itely
Move fundamental voices stuff into Fundamental.
[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 @rlearning{I'm seeing Voices},
93 can also be used if the @internalsref{DrumVoice}s are instantiated
94 by hand first.  For example,
95
96 @lilypond[quote,ragged-right,fragment,verbatim]
97 \new DrumStaff <<
98   \new DrumVoice = "1" { s1 *2 }
99   \new DrumVoice = "2" { s1 *2 }
100   \drummode {
101     bd4 sn4 bd4 sn4
102     <<
103       { \repeat unfold 16 hh16 }
104       \\
105       { bd4 sn4 bd4 sn4 }
106     >>
107   }
108 >>
109 @end lilypond
110
111
112 There are also other layout possibilities.  To use these, set the
113 property @code{drumStyleTable} in context @internalsref{DrumVoice}.
114 The following variables have been predefined
115
116 @table @code
117 @item drums-style
118 This is the default.  It typesets a typical drum kit on a five-line staff
119
120 @lilypond[quote,line-width=10.0\cm]
121 nam = \lyricmode {
122   cymc cyms cymr hh hhc hho hhho hhp
123   cb hc bd sn ss tomh tommh tomml toml tomfh tomfl }
124 mus = \drummode {
125   cymc cyms cymr hh hhc hho hhho hhp \break
126   cb hc bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
127 \score {
128   << \new DrumStaff \with {
129        \remove Bar_engraver
130        \remove Time_signature_engraver
131        \override Stem #'transparent = ##t
132        \override Stem #'Y-extent-callback = ##f
133        \override VerticalAxisGroup #'minimum-Y-extent = #'(-4.0 . 5.0)
134      } \mus
135      \new Lyrics \nam
136   >>
137   \layout {
138     \context {
139       \Score
140       \override LyricText #'font-family = #'typewriter
141       \override BarNumber #'transparent =##T
142     }
143   }
144 }
145 @end lilypond
146
147 The drum scheme supports six different toms.  When there are fewer toms,
148 simply select the toms that produce the desired result, i.e., to get toms
149 on the three middle lines you use @code{tommh}, @code{tomml}, and
150 @code{tomfh}.
151
152 @item timbales-style
153 This typesets timbales on a two line staff
154
155 @lilypond[quote,ragged-right]
156 nam = \lyricmode { timh ssh timl ssl cb }
157 mus = \drummode { timh ssh timl ssl cb s16 }
158
159 <<
160   \new DrumStaff \with {
161     \remove Bar_engraver
162     \remove Time_signature_engraver
163     \override Stem #'transparent = ##t
164     \override Stem #'Y-extent-callback = ##f
165     \override StaffSymbol #'line-count = #2
166     \override StaffSymbol #'staff-space = #2
167     \override VerticalAxisGroup #'minimum-Y-extent = #'(-3.0 . 4.0)
168     drumStyleTable = #timbales-style
169   } \mus
170   \new Lyrics {
171     \override LyricText #'font-family = #'typewriter
172     \nam
173   }
174 >>
175 @end lilypond
176
177 @item congas-style
178 This typesets congas on a two line staff
179
180 @lilypond[quote,ragged-right]
181 nam = \lyricmode { cgh cgho cghm ssh cgl cglo cglm ssl }
182 mus = \drummode { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
183
184 <<
185   \new DrumStaff \with {
186     \remove Bar_engraver
187     \remove Time_signature_engraver
188     drumStyleTable = #congas-style
189     \override StaffSymbol #'line-count = #2
190
191     %% this sucks; it will lengthen stems.
192     \override StaffSymbol #'staff-space = #2
193     \override Stem #'transparent = ##t
194     \override Stem #'Y-extent-callback = ##f
195   } \mus
196   \new Lyrics {
197     \override LyricText #'font-family = #'typewriter
198     \nam
199   }
200 >>
201 @end lilypond
202
203 @item bongos-style
204 This typesets bongos on a two line staff
205
206 @lilypond[quote,ragged-right]
207 nam = \lyricmode { boh boho bohm ssh bol bolo bolm ssl }
208 mus = \drummode { boh boho bohm ssh bol bolo bolm ssl s16 }
209
210 <<
211   \new DrumStaff \with {
212     \remove Bar_engraver
213     \remove Time_signature_engraver
214     \override StaffSymbol #'line-count = #2
215     drumStyleTable = #bongos-style
216
217     %% this sucks; it will lengthen stems.
218     \override StaffSymbol #'staff-space = #2
219     \override Stem #'transparent = ##t
220     \override Stem #'Y-extent-callback = ##f
221   } \mus
222   \new Lyrics {
223     \override LyricText #'font-family = #'typewriter
224     \nam
225   }
226 >>
227 @end lilypond
228
229 @item percussion-style
230 To typeset all kinds of simple percussion on one line staves.
231
232 @lilypond[quote,ragged-right]
233 nam = \lyricmode { tri trio trim gui guis guil cb cl tamb cab mar hc }
234 mus = \drummode { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
235
236 <<
237   \new DrumStaff \with{
238     \remove Bar_engraver
239     drumStyleTable = #percussion-style
240     \override StaffSymbol #'line-count = #1
241     \remove Time_signature_engraver
242     \override Stem #'transparent = ##t
243     \override Stem #'Y-extent-callback = ##f
244   } \mus
245   \new Lyrics {
246     \override LyricText #'font-family = #'typewriter
247     \nam
248   }
249 >>
250 @end lilypond
251 @end table
252
253 If you do not like any of the predefined lists you can define your own
254 list at the top of your file
255
256 @lilypond[quote,ragged-right,verbatim]
257 #(define mydrums '(
258          (bassdrum     default   #f         -1)
259          (snare        default   #f         0)
260          (hihat        cross     #f         1)
261          (pedalhihat   xcircle   "stopped"  2)
262          (lowtom       diamond   #f         3)))
263 up = \drummode { hh8 hh hh hh hhp4 hhp }
264 down = \drummode { bd4 sn bd toml8 toml }
265
266 \new DrumStaff <<
267   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
268   \new DrumVoice { \voiceOne \up }
269   \new DrumVoice { \voiceTwo \down }
270 >>
271 @end lilypond
272
273
274 @seealso
275
276 Init files: @file{ly/@/drumpitch@/-init@/.ly}.
277
278 Program reference: @internalsref{DrumStaff}, @internalsref{DrumVoice}.
279
280 @refbugs
281
282 Because general MIDI does not contain rim shots, the sidestick is used
283 for this purpose instead.
284
285
286 @c FIXME: check name -gp
287 @node Ghost notes
288 @unnumberedsubsubsec Ghost notes
289
290 Ghost notes for drums and percussion may be created using the
291 @code{\parenthesize} command detailed in @ref{Parentheses}.  However,
292 the default @code{\drummode} does
293 not include the @code{Parenthesis_engraver} plugin which allows
294 this.  You
295 must add the plugin explicitly in the context definition as
296 detailed in @ref{Changing context properties on the fly}.
297
298 @lilypond[quote,ragged-right,verbatim,fragment]
299 \new DrumStaff \with {
300   \consists "Parenthesis_engraver"
301 } <<
302   \context DrumVoice  = "1"  { s1 *2 }
303   \context DrumVoice  = "2" { s1 *2 }
304   \drummode {
305     <<
306       {
307         hh8[ hh] <hh sn> hh16
308         < \parenthesize sn > hh < \parenthesize
309         sn > hh8 <hh sn> hh
310       } \\ {
311         bd4 r4 bd8 bd r8 bd
312       }
313     >>
314   }
315 >>
316 @end lilypond
317
318 @noindent
319 Also note that you must add chords (@code{< >} brackets)
320 around each @code{\parenthesize} statement.
321
322
323