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