help needed: controllable master fx in Sonic Pi?

hi All,

given this code, how can I make the cutoff actually changeable without stopping:

use_bpm 120
with_fx :hpf, cutoff: 100 do
  live_loop :drums do
    sample :bd_haus
    sleep 1
    sample :bd_haus
    sleep 1
  end
end

if set cutoff to 20 and press alt-R, i don’t see any changes in the sound. Only if I stop it (Alt-s) and restart (Alt-r) do I hear the changes.

Thanks for any suggestions!

P.S. I know that I can put with_fx inside live_loop, but, according to docs, it’s wrong since it creates an fx instance on every iteration.

have a look at this Question About 'control' Keyword - #2 by robin.newman

Thanks Robin! This works but so far I haven’t found any way to achieve this witout this commenting out. Any ideas?

A while ago, I wrote a library of useful functions. One of them is an lfo function, and another is an envelope function. Both can be used with effects.

There’s lots of other cool stuff in there too. Check it out.

2 Likes

thanks! will definitely try it.

lfo and env are the most immediately useful to you. There should be example code in the docs on github.

Have fun!

I have an update to this library coming soon. I’m busy moving and retiring, but once I have some time I should get the new version out. Has tons of cool new features – playing multisamples with articulations, velocity and round robins; granular synth/effect; step effects a la Infiltrator; whistle and slidewhistle pseudo-synths; looping arpeggiator a la Harmony Bloom; and much more.

Looking forward to getting it out the door. It’s been in testing and debugging for a while, but I’ve been busy with other things.

1 Like