More real randomization

Oooo… my turn, my turn!!!

(for added fun, replace ‘blade’ in foo2 with ‘supersaw’. :wink: )

use_random_seed Random.rand(1..10000)

notes = (scale :e5, :minor_pentatonic).shuffle
notes1 = (scale :e3, :minor_pentatonic).shuffle
notes2 = (scale :e4, :minor_pentatonic).shuffle


with_fx :flanger do
  with_fx :reverb do
    live_loop :foo do
      use_synth :tri
      play (ring :c2, :a1,:e3).choose, amp: 0.25
      play notes.look, amp: 0.25
      sleep 0.5
      #sleep [0.5,0.25,0.75].choose
      tick
    end
    
    live_loop :foo1 do
      use_synth :piano
      play (ring :e3, :c2, :a1).choose, amp: 0.25
      play notes1.look, amp: 0.25
      #sleep 0.5
      sleep [0.5,0.25,0.75].choose
      tick
    end
  end
end

with_fx :reverb, reps: 4, room: 1 do
  live_loop :foo2 do
    use_synth :blade
    co = (line 76, 130, steps: 8).tick(:cutoff)
    play (octs [:e2,:c3,:a4].choose, 3).look, cutoff: co, amp: 0.5
    play notes2.look, amp: 1
    # sleep 0.5
    sleep [0.5,0.25,0.75].choose
    tick
  end
end

Hi Jorsch,

Sam often reminds us that putting FX’s -outside- of live loops
can sometimes clean things up… this is apparently because every
time the loop runs, another copy of the FX is created (I think).

If you look at my code above, I’ve done it that way, because
my initial version went all wobbly when playing…

Eli…

So, I just noticed a problem with this code:

live_loop :ambient do
  use_octave -2
  t = Time.now.to_i + rrand_i(-1000000000000000000000000000000000000, 1000000000000000000000000000000000000)
  use_random_seed t
  puts "Time: #{t}"
  z = [58,60,63,66,68,70,72,74].choose
  n = ((chord :c, :m7) + [z]).sort
  v = (line 0.25, 1).reflect
  p = (line -0.85, 0.85, steps: 150).reflect
  with_fx :reverb, room: 0.75, mix: rrand(0,1) do
    s = synth :prophet, note: n.tick(:n), attack: [0,0,0,0,2].choose, release: [0.5,0.5,0.5,2].choose, amp: v.tick, pan: p.look, cutoff: rrand(70, 120)
    s = synth :dark_ambience, note: n.tick(:n), attack: [0, 0.125, 0.25, 0.5, 0.625, 0.75, 0.825, 1].choose, release: [0.5,0.5,0.5,2].choose, amp: 1, pan: p.look, cutoff: 128, noise: [0,1,2,3,4].choose, ring: [rrand(0.1, 50), rrand(0.1, 50), rrand(0.1, 50)].choose
    control s, amp: v.tick, amp_slide: [0.0625, 0.25].choose, pan: p.look, pan_slide: 0.25, depth: 2, depth_slide: 1.5
  end
  sleep 0.25
end

There should actually be two control lines with two different variables for the synths, since with the above code it’ll just play the :dark_ambiance synth.

live_loop :ambient do
  use_octave -2
  t = Time.now.to_i + rrand_i(-1000000000000000000000000000000000000, 1000000000000000000000000000000000000)
  use_random_seed t
  puts "Time: #{t}"
  z = [58,60,63,66,68,70,72,74].choose
  n = ((chord :c, :m7) + [z]).sort
  v = (line 0.25, 1).reflect
  p = (line -0.85, 0.85, steps: 150).reflect
  with_fx :reverb, room: 0.75, mix: rrand(0,1) do
    s1 = synth :prophet, note: n.tick(:n), attack: [0,0,0,0,2].choose, release: [0.5,0.5,0.5,2].choose, amp: v.tick, pan: p.look, cutoff: rrand(70, 120)
    s2 = synth :dark_ambience, note: n.tick(:n), attack: [0, 0.125, 0.25, 0.5, 0.625, 0.75, 0.825, 1].choose, release: [0.5,0.5,0.5,2].choose, amp: 1, pan: p.look, cutoff: 128, noise: [0,1,2,3,4].choose, ring: [rrand(0.1, 50), rrand(0.1, 50), rrand(0.1, 50)].choose
    control s1, amp: v.tick, amp_slide: [0.0625, 0.25].choose, pan: p.look, pan_slide: 0.25, depth: 2, depth_slide: 1.5
control s2, amp: v.tick, amp_slide: [0.0625, 0.25].choose, pan: p.look, pan_slide: 0.25, depth: 2, depth_slide: 1.5
  end
  sleep 0.25
end