# Custom drum beats

**URL:** <https://in-thread.sonic-pi.net/t/custom-drum-beats/6244>\
**Category:** Support, Help & Resources\
**Created:** [December 18, 2021, 7:58pm UTC](https://in-thread.sonic-pi.net/t/custom-drum-beats/6244 "2021-12-18T19:58:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alb85](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Alb85](https://in-thread.sonic-pi.net/u/Alb85)\
**Post date:** [December 18, 2021, 7:58pm UTC](https://in-thread.sonic-pi.net/t/custom-drum-beats/6244/1 "2021-12-18T19:58:04Z")

</div>

Hi,

Using [this chart](https://i.pinimg.com/564x/ce/88/2d/ce882d5895319a9b8cfde0bb5b834b7b.jpg) as reference, I created this simple drum beats:

```ruby
uk_garage = ["k","r","c","c",
             "l","t","c","r",
             "","","ck","t",
             "l","r","c","c",
             "k","","c","",
             "l","t","c","r",
             "","","ck","t",
             "l","r","c",""]

dubstep = ["k","c","c","",
           "o","","c","",
           "s","","k","c",
           "","o","c","",
           "k","c","c","k",
           "o","","ck","",
           "s","","k","c",
           "","o","c",""]

footwork = ["rk","r","rc","rk",
            "r","r","rk","r",
            "rk","r","rc","rk",
            "rl","r","rk","r",
            "rl","r","rc","rk",
            "r","r","rkc","rc",
            "rk","r","rc","rk",
            "rl","r","rkc","r"]

trap = ["ck","","c","",
        "c","","ck","",
        "cs","","c","",
        "ck","","c","",
        "c","","ck","",
        "ck","","c","",
        "cs","","c","",
        "c","","c",""]

drum_n_bass = ["koc","","c","",
               "cs","","ck","",
               "c","","cs","",
               "cs","","c","",
               "kc","","c","",
               "cs","","c","",
               "c","","ck","",
               "cs","","c",""]

jungle = ["ock","","ck","",
          "cs","","c","s",
          "c","s","ck","",
          "c","","cs","",
          "c","sk","ck","",
          "cs","","c","s",
          "c","s","ck","",
          "c","","cs",""]

deep_house = ["k","c","o","",
              "lk","","o","c",
              "k","c","o","",
              "lk","","o",""]

hip_hop = ["ck","","ck","",
           "cs","","c","",
           "c","","ck","k",
           "cs","","c","k"]

patterns = [uk_garage,dubstep,footwork,trap,drum_n_bass,jungle,deep_house,hip_hop]

live_loop :drum do
  currPattern = patterns[0].tick #change the id of patterns
  sample :drum_heavy_kick if currPattern.include?("k")
  sample :drum_snare_hard if currPattern.include?("s")
  sample :drum_cymbal_closed if currPattern.include?("c")
  sample ::drum_cymbal_open if currPattern.include?("o")
  sample :drum_tom_lo_hard if currPattern.include?("t")
  #sample * if currPattern.include?("l")
  #sample * if currPattern.include?("r")  
  sleep 0.25
end

```

Do you have any feedback to improve it?  
Do you know which samples should I use to emulate the clap and the rim?

Thanks!

---

<div class="post-metadata">

**Author:** ![Hussein](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/hussein/32/1972_2.png) [@Hussein](https://in-thread.sonic-pi.net/u/Hussein)\
**Post date:** [December 19, 2021, 4:12pm UTC](https://in-thread.sonic-pi.net/t/custom-drum-beats/6244/2 "2021-12-19T16:12:01Z")

</div>

Hi there

your footwork pattern works really well.  
Perhaps you might want to vary the bpm so that it matches the tempo for these different styles. Look up `use_bpm`.  
There’s a little error in your code where you’ve used two colons:  
`sample ::drum_cymbal_open if currPattern.include?("o")`

Look at the` :elec` samples as these might have something for you. Of course you can also import samples rather than use SPi’s built in library. Using the right samples helps to reinforce the style’s characteristics.

The single drum voice at a time approach is known as Linear Drumming. I’ve got a few videos on this using the Monosequencer in Ableton. Here are the links, hope these are helpful:  
[Vid 1](https://youtu.be/ta_vC-U_UiE)  
[Vid 2](https://youtu.be/8c9A1HJHIBE)  
[Vid 3](https://youtu.be/b_DSXLYmZ5Q)

Thanks for sharing.
