In_thread unison drift?

I was expecting this to be unison but the pattern drift apart and find together again?


use_bpm 70

live_loop :met do
  sleep 1
end


live_loop :bass, sync: :met do
  use_synth :saw
  use_random_seed 3
  
  in_thread do
    16.times do
      play scale(:c4, :minor_pentatonic).take(3).tick(:a), release: 0.25
      sleep 0.25
    end
  end
  
  16.times do
    play scale(:c2, :minor_pentatonic).take(3).tick(:a), release: 0.25
    sleep 0.25
  end
end

hmm… try this?

use_bpm 70

live_loop :met do
  sleep 1
end

$foo = 0
live_loop :bass, sync: :met do
  use_synth :saw
  use_random_seed 3
  
  in_thread do
    16.times do
      play scale(:c4, :minor_pentatonic).take(3)[$foo], release: 0.25
      $foo += 1
      sleep 0.25
    end
  end
  
  16.times do
    play scale(:c2, :minor_pentatonic).take(3)[$foo], release: 0.25
    sleep 0.25
  end
end


1 Like

Ty that works :smiley:
Kind regards
Relaxnow

use_bpm 70

live_loop :met do
  sleep 1
end

$foo = 0  # starts cycle on the first note
#$foo = 1  # starts cycle on the second note
#$foo = 2  # starts cycle on the third note

live_loop :bass, sync: :met do
  use_synth :saw
  use_random_seed 3
  
  in_thread do
    16.times do
      play scale(:c4, :minor_pentatonic).take(3)[$foo], release: 0.25
      $foo += 1
      sleep 0.25
    end
  end
  
  16.times do
    play scale(:c2, :minor_pentatonic).take(3)[$foo], release: 0.25
    sleep 0.25
  end
end