Hi all! I’m having some trouble with using effects and live loops. I want to be able to put live loops inside of effects and control them externally, but am running into some problems. I’ll try to articulate each of my specific issues as clearly as possible.
In my first example, when I run the code it starts with the default values for the reverb, as I have not specified any opts. When I make a change in the second thread using the control command, it will make the change the first time I re-run. However, if I try to change it again, it doesn’t work.
use_bpm 100 in_thread do with_fx :reverb do |f| set :f, f live_loop :sample do sample :loop_amen, beat_stretch: 4 sleep 4 end end end in_thread do fx = get[:f] control fx, room: 0.4, mix: 0 end
I solved this problem by naming the thread with the effects:
use_bpm 100 in_thread(name: :effect) do with_fx :reverb do |f| set :f, f live_loop :sample do sample :loop_amen, beat_stretch: 4 sleep 4 end end end in_thread do fx = get[:f] control fx, room: 0.4, mix: 0 end
I can now change the control values to my heart’s content. However, now that I’ve done this, I am unable to update the live loop inside the effect. Any change I make, for example, to the rate of the sample does not take effect when I re-run.
I want the live loop to be inside the effects for two reasons. First, I want to conserve as much processor power as I can. Second, and more importantly, if the effect is inside the live loop I can no longer use the external thread to control its parameters, because the effect resets to its initial parameters every loop.
Can someone offer some insight into why I lose the ability to update the live loop inside of a named thread? Possible solutions?