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