# Autonomous loops attempt

**URL:** <https://in-thread.sonic-pi.net/t/autonomous-loops-attempt/460>\
**Category:** Creations & Ideas\
**Created:** [November 26, 2017, 1:59pm UTC](https://in-thread.sonic-pi.net/t/autonomous-loops-attempt/460 "2017-11-26T13:59:10Z")\
**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:** [November 30, 2017, 12:07am UTC](https://in-thread.sonic-pi.net/t/autonomous-loops-attempt/460/6 "2017-11-30T00:07:19Z")

</div>

I’ve been looking at some code that Tonny posted over in this thread:

> [@When you get bored, and can't sleep](http://in-thread.sonic-pi.net/t/when-you-get-bored-and-cant-sleep/335):
>
> Grab a bunch of code from the SP Tutorial windows, mix it all together, and hope for something musical: Eli…

The cleaned up version (I knocked out a couple synths and changed some  
release times, is all) is pretty cool…

[https://www.dropbox.com/s/pen6y0o6pzf40qn/Game%20of...%20Darts.wav?dl=1](https://www.dropbox.com/s/pen6y0o6pzf40qn/Game%20of...%20Darts.wav?dl=1)

Eli…

```ruby
live_loop :melody do
  with_fx [:compressor, :echo, :reverb].choose, mix: rrand(0.3,0.6) do
    use_synth [:hollow, :dark_ambience, :blade].choose
    r = [1,2].choose
    play (chord :c, :minor).choose, attack: -0.25+r, release: r, amp: rrand(0.2, 0.8)
    sleep r+0.25
  end
end

live_loop :keys do
  use_synth :blade
  with_fx :ixi_techno, mix: rrand(0.2, 0.6) do
    play chord(:c, :minor), amp: rrand(0.2,0.6)
    sleep 0.5
  end
end

live_loop :bass do
  with_fx [:compressor, :echo, :reverb].choose, mix: rrand(0.4,0.7) do
    use_synth [:hollow].choose
    n = (chord :c2, :minor).tick
    7.times do
      play n, amp: rrand(0.8, 3.6)
      sleep [0.5, 1].choose
    end
    play n
    sleep 0.5
    play (chord :c2, :minor).tick, amp: rrand(0.8, 1.8)
    sleep 0.5
  end
end
```

---

_[View the full topic](https://in-thread.sonic-pi.net/t/autonomous-loops-attempt/460)._
