I’m trying to change a random seed number within a live_loop, and while I can change the seed live in the sonic-pi editor, the same doesn’t work when sending seed number changes over osc message. See my below piece:
live_loop :taps, auto_cue: false do |idx|
use_random_seed 2
# I would love replace the above line with the below line
#use_random_seed sync "/osc:192.168.8.95:33840/taps/seed"
use_synth :dsaw
use_real_time
with_fx :reverb, room: 1 do
32.times do
ns = (scale :a1, :minor, num_octaves: 2)
play ns.choose, release: 0.1, amp: 2, amp: rand + 0.5, cutoff: rrand(60, 90)
sleep 0.125
end
end
end
Hoping someone could point me in the right direction. Thanks!
EDIT: just to clarify, what’s currently happening is that nothing happens when sending the appropriate osc message, ie
You may have to access the value you want via an array as in this Robin piece if code.
live_loop :n1 do
use_real_time
b = sync "/osc/sync"
#set time_warp to delay note to match greatest latency. use rt so time not affected by bpm
time_warp rt(0.18) do
use_bpm b[0)
play scale(:e4,:minor_pentatonic).tick,release: 0.25
end
end