]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/adding-drum-parts.ly
Snippets: Replace \set Staff.instrumentName
[lilypond.git] / Documentation / snippets / new / adding-drum-parts.ly
1 \version "2.19.56"
2
3 \header {
4   lsrtags = "percussion, preparing-parts, really-simple, rhythms, specific-notation"
5
6   texidoc = "
7 Using the powerful pre-configured tools such as the @code{\\drummode}
8 function and the @code{DrumStaff} context, inputting drum parts is
9 quite easy: drums are placed at their own staff positions (with a
10 special clef symbol) and have note heads according to the drum.
11 Attaching an extra symbol to the drum or restricting the number of
12 lines is possible.
13
14 "
15   doctitle = "Adding drum parts"
16 } % begin verbatim
17
18 drh = \drummode {
19         cymc4.^"crash" hhc16^"h.h." hh hhc8 hho hhc8 hh16 hh
20         hhc4 r4 r2
21       }
22 drl = \drummode {
23         bd4 sn8 bd bd4 << bd ss >>
24         bd8 tommh tommh bd toml toml bd tomfh16 tomfh
25       }
26 timb = \drummode {
27          timh4 ssh timl8 ssh r timh r4
28          ssh8 timl r4 cb8 cb
29        }
30
31 \score {
32   <<
33     \new DrumStaff \with {
34       instrumentName = #"timbales"
35       drumStyleTable = #timbales-style
36       \override StaffSymbol.line-count = #2
37       \override BarLine.bar-extent = #'(-1 . 1)
38     }
39     <<
40       \timb
41     >>
42     \new DrumStaff \with { instrumentName = #"drums" }
43     <<
44       \new DrumVoice { \stemUp \drh }
45       \new DrumVoice { \stemDown \drl }
46     >>
47   >>
48   \layout { }
49   \midi { \tempo 4 = 120 }
50 }