# How to create this Billie Jean drum pattern

**URL:** <https://in-thread.sonic-pi.net/t/how-to-create-this-billie-jean-drum-pattern/9017>\
**Category:** Support, Help & Resources\
**Created:** [July 7, 2024, 3:35am UTC](https://in-thread.sonic-pi.net/t/how-to-create-this-billie-jean-drum-pattern/9017 "2024-07-07T03:35:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinodv](https://avatars.discourse-cdn.com/v4/letter/v/97f17d/32.png) [@vinodv](https://in-thread.sonic-pi.net/u/vinodv)\
**Post date:** [July 7, 2024, 3:35am UTC](https://in-thread.sonic-pi.net/t/how-to-create-this-billie-jean-drum-pattern/9017/1 "2024-07-07T03:35:41Z")

</div>

Hello friends,  
I am trying to make drum pattern given here :

> **[Billie Jean Drum Tab by Michael Jackson | Songsterr Tabs with Rhythm](https://www.songsterr.com/a/wsa/michael-jackson-billie-jean-drum-tab-s10586)**
>
> Billie Jean Drum Tab by Michael Jackson. Free online tab player. One accurate version. Play along with original audio

 ![BillieJean](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/2X/d/dfd460f8f636efe8a3d3eef4fc4c0314ec2c9b7d.png)

How to code this in spi:

```ruby
use_bpm 117

live_loop :cymbal do
  4.times do
    sample :drum_cymbal_hard;
    sleep 0.5
  end
end

live_loop :kick do
  2.times do
    sample :drum_heavy_kick;
    sleep 2
  end
end

live_loop :snare do
  2.times do
    sleep 1
    sample :sn_dolf;
    sleep 2
  end
end

```

But it is not giving the intended sound.  
Can you please help me.

These are the samples I collected related to drum:

```ruby
sample :drum_roll
sample :drum_splash_hard
sample :drum_cymbal_open
sample :drum_splash_soft
sample :drum_cymbal_hard
sample :drum_cymbal_soft
sample :drum_tom_lo_hard
sample :drum_tom_mid_hard
sample :drum_tom_hi_hard
sample :drum_bass_hard
sample :drum_tom_lo_soft
sample :drum_snare_hard
sample :drum_tom_mid_soft
sample :drum_tom_hi_soft
sample :drum_bass_soft
sample :drum_snare_soft
sample :drum_cymbal_pedal
sample :drum_cymbal_closed
sample :drum_heavy_kick
sample :drum_cowbell

sample :bd_mehackit
sample :bd_boom
sample :bd_zome
sample :bd_sone
sample :bd_tek
sample :bd_klub
sample :bd_haus
sample :bd_808
sample :bd_gas
sample :bd_pure
sample :bd_zum
sample :bd_ada
sample :bd_fat

sample :sn_zome
sample :sn_generic
sample :sn_dolf
sample :sn_dub

```

---

<div class="post-metadata">

**Author:** ![brendanmac](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/brendanmac/32/2809_2.png) [@brendanmac](https://in-thread.sonic-pi.net/u/brendanmac)\
**Post date:** [July 7, 2024, 6:14am UTC](https://in-thread.sonic-pi.net/t/how-to-create-this-billie-jean-drum-pattern/9017/2 "2024-07-07T06:14:15Z")

</div>

Hi  
there would be several solutions, but the simplest is this:

```ruby

use_bpm 117

live_loop :kksn do
  sample :drum_bass_hard
  sleep 1
  sample :drum_snare_hard
  sleep 1
end

live_loop :hats do
  sample :drum_cymbal_closed
  sleep 0.5
end

```

Or to use just one loop:

```ruby

use_bpm 117

hh = [1,1,1,1]
kk = [1,0,0,0]
sn = [0,0,1,0]

live_loop :billie do
  tick
  
  sample :drum_cymbal_closed if hh.look == 1
  sample :drum_bass_hard if kk.look == 1
  sample :drum_snare_hard if sn.look == 1
  
  sleep 0.5
end

```

And I took the liberty of ‘correcting’ your example:

```ruby
use_bpm 117

live_loop :cymbal do
  sample :drum_cymbal_closed
  sleep 0.5
end

live_loop :kick do
  sample :drum_heavy_kick
  sleep 2
end

live_loop :snare do
  sleep 1
  sample :sn_dolf
  sleep 1
end

/
or make the snare loop wait one beat as follows:
live_loop :snare, delay: 1 do
  sample :sn_dolf;
  sleep 2
end
/

```

PD-Pi

---

<div class="post-metadata">

**Author:** ![vinodv](https://avatars.discourse-cdn.com/v4/letter/v/97f17d/32.png) [@vinodv](https://in-thread.sonic-pi.net/u/vinodv)\
**Post date:** [July 7, 2024, 2:00pm UTC](https://in-thread.sonic-pi.net/t/how-to-create-this-billie-jean-drum-pattern/9017/3 "2024-07-07T14:00:53Z")

</div>

Excellent solutions. Thanks for suggesting multiple ways and correcting my try.

---

<div class="post-metadata">

**Author:** ![brendanmac](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/brendanmac/32/2809_2.png) [@brendanmac](https://in-thread.sonic-pi.net/u/brendanmac)\
**Post date:** [July 7, 2024, 2:39pm UTC](https://in-thread.sonic-pi.net/t/how-to-create-this-billie-jean-drum-pattern/9017/4 "2024-07-07T14:39:56Z")

</div>

You’re very welcome, it’s what the forum’s for, and we all learn by sharing - win win 😉

---

<div class="post-metadata">

**Author:** ![Relaxnow](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/relaxnow/32/2172_2.png) [@Relaxnow](https://in-thread.sonic-pi.net/u/Relaxnow)\
**Post date:** [July 7, 2024, 9:31pm UTC](https://in-thread.sonic-pi.net/t/how-to-create-this-billie-jean-drum-pattern/9017/5 "2024-07-07T21:31:50Z")

</div>

I wondered how I would code it. Here you go.

```ruby

# Michael Jackson - Billie Jean (Official Video)
# https://www.youtube.com/watch?v=Zi_XLOBDo_Y

# Michael Jackson's Drummer Jonathan Moffett Performs "Billie Jean"
# https://www.youtube.com/watch?v=gFbZiIjFmz8

set_volume! 2

use_bpm 117
with_fx :reverb, room: 0.4 do
  
  live_loop :a1 do
    tick
    
    drum = knit(1,32,2,32).ramp.look
    case drum
    when 0
    when 1
      puts "Pattern 1" if spread(1,8).look
      sample :bd_fat, amp: 4 if spread(2,8).look
      sample :drum_snare_hard if spread(2,8).rotate(2).look
      sample :drum_cymbal_closed, amp: rrand(0.8,1.2)+0.2
    when 2
      puts "Pattern 2" if spread(1,8).look
      sample :bd_fat, amp: 4 if spread(2,8).look
      sample :drum_snare_hard if spread(2,8).rotate(2).look
      sample :drum_cymbal_closed, amp: rrand(0.8,1.2)
      
      /cymbal 2/
      sample :sn_zome, start: 0.35, finish: 0.5, amp: 2.5, attack: 0.025, release: 0.025
    end
    
    sleep 0.5
  end
  
end

```

---

<div class="post-metadata">

**Author:** ![vinodv](https://avatars.discourse-cdn.com/v4/letter/v/97f17d/32.png) [@vinodv](https://in-thread.sonic-pi.net/u/vinodv)\
**Post date:** [July 8, 2024, 12:53am UTC](https://in-thread.sonic-pi.net/t/how-to-create-this-billie-jean-drum-pattern/9017/6 "2024-07-08T00:53:19Z")

</div>

Nice.  
Can I ask you a question?  
Is it possible to code complete background (except the vocals) music of Billie Jean in sonic-pi.  
Or at least drums and guitar for the first 20 seconds or so.

---

<div class="post-metadata">

**Author:** ![brendanmac](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/brendanmac/32/2809_2.png) [@brendanmac](https://in-thread.sonic-pi.net/u/brendanmac)\
**Post date:** [July 8, 2024, 5:49am UTC](https://in-thread.sonic-pi.net/t/how-to-create-this-billie-jean-drum-pattern/9017/7 "2024-07-08T05:49:07Z")

</div>

Ok, I’ll start 😉  
This is just quick and dirty.

```ruby
use_bpm 117

hh = [1,1,1,1]
kk = [1,0,0,0]
sn = [0,0,1,0]

live_loop :billie do
  tick
  
  sample :hat_zap, attack: 0.1 if hh.look == 1
  sample :drum_bass_hard if kk.look == 1
  sample :drum_snare_hard if sn.look == 1
  
  sleep 0.5
end

use_synth :bass_foundation
use_synth_defaults cutoff: 70, release: 0.2

live_loop :bass do
  play_pattern_timed [:fs2, :cs2, :e2, :fs2, :e2, :cs2, :b1, :cs2], [0.5]
end

use_synth :dsaw
live_loop :billie1, delay: 16 do
  play [:a3, :cs4, :fs4], attack: 0.1, release: 0.4
  sleep 1.5
  
  play [:b3, :ds4, :gs4], attack: 0.1, release: 0.4
  sleep 2.5
  
  play [:cs4, :e4, :a4], attack: 0.1, release: 0.4
  sleep 1.5
  
  play [:b3, :ds4, :gs4], attack: 0.1, release: 0.4
  sleep 2.5
end

use_synth :blade
live_loop :billie2, delay: 16 do
  
  use_synth_defaults amp: 2
  play [:a3, :cs4, :fs4], attack: 0.1, release: 0.4
  sleep 1.5
  
  play [:b3, :ds4, :gs4], attack: 0.1, release: 0.4
  sleep 2.5
  
  play [:cs4, :e4, :a4], attack: 0.1, release: 0.4
  sleep 1.5
  
  play [:b3, :ds4, :gs4], attack: 0.1, release: 0.4
  sleep 2.5
end

```

PD-Pi
