Control the pan of a sample with the values of a sin-wave.
This would be simple in Overtone but I'm not sure such a facility exists in Sonic-pi.
sample :amib_choir :pan sine_wave
Simple and powerful way to vary a parameter overtime.
While experimenting it occurred to me this is possible using, you know Ruby :)
n = 0
loop{
with_fx :pan, pan: Math.sin(n) do
sample :ambi_choir
end
n+=1
}
True, but that loop would crap out on the RP. Of course, you could put the with_fx outside of the loop, but then you'd be sending loads of control messages which is also expensive on the RP. Would be nice to have all this in server land.
One way of achieving this is using Ruby like @josephwilk suggested. However taking advantage of threads can make it not affect the current composition:
with_fx :pan, pan: -1 do |fx|
sample :foo
at do
reset
loop do
control fx, pan: Math.sin(tick)
sleep 0.125
end
end
end
However, we need to have a nice way of killing the thread when the FX synth is no longer playing, so more work is needed to be able to first achieve it and then make it simple syntactically.
Most helpful comment
One way of achieving this is using Ruby like @josephwilk suggested. However taking advantage of threads can make it not affect the current composition:
However, we need to have a nice way of killing the thread when the FX synth is no longer playing, so more work is needed to be able to first achieve it and then make it simple syntactically.