# Drum Maschine in single line

**URL:** <https://in-thread.sonic-pi.net/t/drum-maschine-in-single-line/1724>\
**Category:** Creations & Ideas\
**Created:** [November 21, 2018, 10:24pm UTC](https://in-thread.sonic-pi.net/t/drum-maschine-in-single-line/1724 "2018-11-21T22:24:44Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Eli](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/eli/32/116_2.png) [@Eli](https://in-thread.sonic-pi.net/u/Eli)\
**Post date:** [January 28, 2019, 9:41pm UTC](https://in-thread.sonic-pi.net/t/drum-maschine-in-single-line/1724/6 "2019-01-28T21:41:03Z")

</div>

Hmmm… you know…

@notinflight posted a nice little snippet in this post…

> [@Adding FX to Synths](http://in-thread.sonic-pi.net/t/adding-fx-to-synths/1961/2):
>
> Hi mate, When you type ‘with\_fx’, make the next character a space, and it should bring up a list of the FX’s… then choose the one you want. So your code should look like this, and it’s quite an interesting sound too. Eli… loop do use\_synth :growl with\_fx :wobble do with\_fx :compressor do play :Gs3, attack: 0.25, sustain: 0.1, decay: 0.1, release: 0.1 sleep 0.25 play :Fs3, attack: 0.25, sustain: 0.1, decay: 0.1, release: 0.1 sleep 0.25 play :A3, attack:…

If you jazz it up a little and trigger it off the drums, you’ve  
got the basics of a dance track…

```ruby
use_bpm 120
cycle = (ring 2, 4, 6,8)

live_loop :drums do
  tick
  sample :bd_tek if 5[look%4] >0
  sample :bd_klub if 3[look%5] >0
  sample :bd_boom if cycle.look[look%4] >0
  sample :elec_cymbal, rate: 3 if 10[look%4] >0
  sleep 0.5
  
  
  live_loop :looper do
    sync :drums
    use_synth [:hoover, :blade, :piano].choose
    if rand() > 0.65 then
      with_fx :ixi_techno do
        with_fx :wobble do
          play :Gs3, attack: 0.25, sustain: 0.1, decay: 0.1, release: 0.1
          sleep 0.25
          play :Fs3, attack: 0.25, sustain: 0.1, decay: 0.1, release: 0.1
          sleep 0.25
          play :A3, attack: 0.25, sustain: 0.1, decay: 0.1, release: 0.1
          sleep 0.25
          play :B3, attack: 0.25, sustain: 0.1, decay: 0.1, release: 0.1
          sleep 0.5
        end
      end
    end
  end
end

```

---

_[View the full topic](https://in-thread.sonic-pi.net/t/drum-maschine-in-single-line/1724)._
