# Algorithms 6: Another one

**URL:** <https://in-thread.sonic-pi.net/t/algorithms-6-another-one/2847>\
**Category:** Creations & Ideas\
**Created:** [October 25, 2019, 2:17pm UTC](https://in-thread.sonic-pi.net/t/algorithms-6-another-one/2847 "2019-10-25T14:17:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.krakou](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@chris.krakou](https://in-thread.sonic-pi.net/u/chris.krakou)\
**Post date:** [October 25, 2019, 2:17pm UTC](https://in-thread.sonic-pi.net/t/algorithms-6-another-one/2847/1 "2019-10-25T14:17:28Z")

</div>

So after moving to another home and getting settled at my new jobs, I finally got around to recording a new piece. Just a playful improv session that I think turned out okay.

---

<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:** [October 27, 2019, 6:13pm UTC](https://in-thread.sonic-pi.net/t/algorithms-6-another-one/2847/2 "2019-10-27T18:13:24Z")

</div>

I had so much fun with your code, and learnt some new tricks.

My thanks.

Eli…

```ruby
use_bpm 120

kicks =(spread 9,16).shuffle
hats =(spread 9,16).shuffle
trans = (ring -12,0,12,0)
rels = (ring 0.125, 0.25, 0.5, 0.75, 1.0, 0.75, 0.5, 0.25)
change = (ring :c3, :d3, :e3)

live_loop :main do
  with_fx :reverb do
    inversions = range(0,3,1).choose
    atk = [0.0, 0.125, 0.25].choose
    sound = [:perc_bell, :drum_splash_soft,:elec_chime].ring
    64.times do
      fin = line(0.05,0.5,steps:31, inclusive:true).mirror.ring.look
      
      tick
      synth :dsaw, note: (chord change.look, :minor, invert: range(-1,1,1).choose), sustain: 8 if (spread 1,32).look
      with_transpose trans.look do
        synth :pluck, note: (chord change.look, :minor), release: rels.look, amp: 0.4+(rels.look * 2)
      end
      with_fx :ixi_techno do
        sample sound.look, finish: fin, amp: 3, invert: inversions, pan: line(-1,1,steps:8, inclusive:true).mirror.look if (spread 15,16).look
      end
      
      sleep 0.25
    end
  end
end

```

---

<div class="post-metadata">

**Author:** ![chris.krakou](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@chris.krakou](https://in-thread.sonic-pi.net/u/chris.krakou)\
**Post date:** [October 28, 2019, 2:34pm UTC](https://in-thread.sonic-pi.net/t/algorithms-6-another-one/2847/3 "2019-10-28T14:34:52Z")

</div>

I’m glad you found it useful. The (spread) trick and a single tick has become my go-to technique for live coding, since it’s fast and flexible. It does get a bit heavy when you start laying on the effects, but another loop sync’d to the first usually solves that.
