# My first creation

**URL:** <https://in-thread.sonic-pi.net/t/my-first-creation/2502>\
**Category:** Creations & Ideas\
**Created:** [June 19, 2019, 6:28pm UTC](https://in-thread.sonic-pi.net/t/my-first-creation/2502 "2019-06-19T18:28:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rimkat1](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/rimkat1/32/1004_2.png) [@rimkat1](https://in-thread.sonic-pi.net/u/rimkat1)\
**Post date:** [June 19, 2019, 6:28pm UTC](https://in-thread.sonic-pi.net/t/my-first-creation/2502/1 "2019-06-19T18:28:50Z")

</div>

```ruby
use_bpm 80

halte = 0

define :kick do
  in_thread do
    sample :drum_heavy_kick
    sleep 0.33
    sample :drum_heavy_kick
    sleep 0.67
    sample :drum_snare_hard
    sleep 1
    sample :drum_heavy_kick
    sleep 0.67
    sample :drum_heavy_kick
    sleep 0.33
    sample :drum_snare_hard
    sleep 1
  end
end

define :splach do
  in_thread do
    sample :drum_cymbal_hard
  end
end

define :shirley do
  in_thread do
    8.times do
      sample :drum_cymbal_closed
      sleep (ring 0.67,0.67,0.33,0.33,0.33,0.67,0.67,0.33).tick
    end
  end
end

define :breaq do |choix|
  in_thread do
    if choix == 1
      5.times do
        sample :drum_snare_hard
        sleep (ring 0.165,0.165,0.33,0.165,0.165).tick
      end
    else
      5.times do
        sample [:drum_tom_hi_hard, :drum_tom_mid_hard].choose
        sleep (ring 0.165,0.165,0.33,0.165,0.165).tick
      end
    end
  end
end

define :bass do
  in_thread do
    use_synth :tb303
    9.times do
      play (chord :eb2, :M7).choose, cutoff: rrand(60, 110), release: 0.1
      sleep (ring 0.67, 0.67,0.33,0.33,0.33,0.67,0.33,0.33, 0.33).tick
    end
  end
end

define :synthe do
  in_thread do
    7.times do
      play (scale :Eb6, :minor_pentatonic, num_octaves: 2).choose, release: 0.1
      sleep [0.67,0.33,0.165,0.165,0.165].choose
    end
  end
end

define :accords do
  in_thread do
    4.times do
      play_chord (ring chord(:eb4, :M),chord(:f4, :m7),chord(:bb4, :M7),chord(:bb4, :M7)).tick(:n)
      sleep (ring 1.67,0.67,1,0.66).tick(:r)
    end
  end
end

accords
sleep 4
accords
shirley
sleep 4
accords
shirley
sleep 3
breaq 2
sleep 1

live_loop :main do
  if halte == 0
    kick
    shirley
    synthe
    accords
    bass
    splach if one_in(4)
    sleep 3
    breaq [1, 2].choose if one_in(2)
    sleep 1
  else
    stop
  end
end

sleep 64
halte = 1
bass
accords
shirley
sleep 4
synthe
accords
sleep 4
accords

```
