Repeating Random Loops?

Hi there,

perhaps combining iteration (n.times) with use_random_seed might help you here?

For example:

live_loop :sampleslicer, sync: :met1 do
  use_random_seed 3000
  4.times do
    am = 2
    c = 130
    r = [0.8, 0.4].choose
    slice = rand_i(8*2)
    slice_size = 0.125/2
    s = slice * slice_size
    f = s + slice_size
    sample :ambi_choir, start: s, finish: f, amp: am, cutoff: c, rate: r, pan: [-0.5, 0.5].choose
    sleep 0.5
  end
end

You can then play around with changing the value passed to use_random_seed either in production time or live during a performance. This is a technique I use a lot.

Also, whilst slicing a sample manually like you’re doing clearly works and gives you a lot of control, it’s often simpler to use the slice: opt along with num_slices: which will define how many equally lengthen slices you’d like your sample divided into. There’s also the onset: opt which will do automatic feature detection on the sample and extract the 'percussive` elements of the sample and let you index those with a simple number.

Let me know if this helps or if you have any further questions!

1 Like