# DJ Got Us Fallin' In Love - Usher ft. Pitbull using tb303

**URL:** <https://in-thread.sonic-pi.net/t/dj-got-us-fallin-in-love-usher-ft-pitbull-using-tb303/2662>\
**Category:** Creations & Ideas\
**Created:** [August 25, 2019, 12:49pm UTC](https://in-thread.sonic-pi.net/t/dj-got-us-fallin-in-love-usher-ft-pitbull-using-tb303/2662 "2019-08-25T12:49:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thirdrow](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/thirdrow/32/878_2.png) [@thirdrow](https://in-thread.sonic-pi.net/u/thirdrow)\
**Post date:** [August 25, 2019, 12:49pm UTC](https://in-thread.sonic-pi.net/t/dj-got-us-fallin-in-love-usher-ft-pitbull-using-tb303/2662/1 "2019-08-25T12:49:46Z")

</div>

I started using Sonic Pi a long while back but couldn’t keep focus on learning and left it midway a few times now. However in my latest attempt at learning from the tutorials, I stumbled upon a tb303 loop and it instantly reminded me of this song. So here’s my rendition of it

```ruby
use_bpm 120
define :my_sound do |n,l|
  use_synth :tb303
  play n , release: 0.4
  play n+16, release: 0.4, amp: 0.8
  sleep l
end

define :my_sound1 do |n,l|
  use_synth :tb303
  play n , release: 0.4
  play n+15, release: 0.4, amp: 0.8
  sleep l
end

define :my_sound2 do |n,l|
  use_synth :tb303
  play n , release: 0.4, amp: 0.55
  play n+15, release: 0.4, amp: 0.55
  sleep l
end

define :my_sound3 do |n,l|
  use_synth :tb303
  play n , release: 0.4, amp: 0.55
  play n+16, release: 0.4, amp: 0.55
  sleep l
end

1.times do
  my_sound1 43,1
  my_sound1 43,1
  my_sound1 43,0.75
  my_sound 46,0.75
  my_sound 46,0.5
  
  my_sound 41,1
  my_sound 41,1
  my_sound 41,0.75
  my_sound 46,0.75
  my_sound 46,0.5
  
  2.times do
    my_sound 39,1
    my_sound 39,1
    my_sound 39,0.75
    my_sound 46,0.75
    my_sound 46,0.5
  end
end

in_thread(name: :looper) do
  loop do
    my_sound2 43,1
    my_sound2 43,1
    my_sound2 43,0.75
    my_sound3 46,0.75
    my_sound3 46,0.5
    
    my_sound3 41,1
    my_sound3 41,1
    my_sound3 41,0.75
    my_sound3 46,0.75
    my_sound3 46,0.5
    
    2.times do
      my_sound3 39,1
      my_sound3 39,1
      my_sound3 39,0.75
      my_sound3 46,0.75
      my_sound3 46,0.5
    end
  end
end

loop do
  4.times do
    7.times do
      sample :drum_heavy_kick, amp: 3
      sleep 1
    end
    sample :drum_heavy_kick
    sleep 0.25
    sample :elec_flip, amp: 2
    sleep 0.25
    sample :elec_flip, amp: 2
    sleep 0.25
    sample :elec_flip, amp: 2
    sleep 0.25
  end
  
  loop do
    sample :drum_heavy_kick, amp: 3
    sleep 1
    sample :elec_hi_snare , amp: 2, release: 0.3
    sample :drum_heavy_kick, amp: 3
    sleep 1
    
  end
  sample :drum_heavy_kick
  sleep 0.25
  sample :elec_flip, amp: 2
  sleep 0.25
  sample :elec_flip, amp: 2
  sleep 0.25
  sample :elec_flip, amp: 2
  sleep 0.25
end

```

---

<div class="post-metadata">

**Author:** ![thirdrow](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/thirdrow/32/878_2.png) [@thirdrow](https://in-thread.sonic-pi.net/u/thirdrow)\
**Post date:** [August 25, 2019, 12:51pm UTC](https://in-thread.sonic-pi.net/t/dj-got-us-fallin-in-love-usher-ft-pitbull-using-tb303/2662/2 "2019-08-25T12:51:11Z")

</div>

I would really appreciate it if someone could write a shorter version of this code or a more efficient version of it.
