Why is it that this works fine:
use_bpm 120
live_loop :syn do
use_synth :noise
sn = with_fx :rlpf, res: 0.9 do
play 60, sustain: 8
end
16.times do
sleep 0.5
control sn, cutoff: rrand( 50, 110 )
end
end
But, this doesn’t work. The first time I try to control the synth, it crashes with an error.
use_bpm 120
sn = with_fx :rlpf, res: 0.3, cutoff: 130, cutoff_slide: 4 do
live_loop :drums do
at [0, 1.5, 2 ] do
sample :bd_haus
end
at [ 1, 3 ] do
sample :sn_dolf
end
at [ 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 3.75 ] do
sample :drum_cymbal_closed
end
sleep 4
end
end
sleep 4
control sn, cutoff: rand_i( 130 )
The error I get is:
Runtime Error: [buffer 2, line 24] - RuntimeError
Thread death!
Unable to normalise argument with key #<Thread:0x00007fe67b075990@/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/runtime.rb:934 sleep> and value {:cutoff=>97}