Patching LFO amplitude conversion

Greetings all. So I’m working on a program that allows me to patch a few different instruments together dynamically at runtime, essentially a semi-modular synth. Initially I had input attenuators on my filter instrument which would take an a-rate input signal and multiply it based on an attenuator knob. When patching an LFO that was outputting an a-rate signal with an amplitude of 1 (keeping it within audio level) I found that the program would crash when I attempted to scale up the a-rate output of the LFO a large degree (I was just multiplying it by the current k-rate attenuation value which is allowed in the range of 0.001-10k. Essentially my question is, is it better to determine and adjust the amplitude of a signal before calling the opcode on the LFO itself, or is there a way to scale the signal once it is received? Essentially the issue I’m trying to figure out is how to handle an instrument that can operate both as an audio source and modulator and whether or not it’s better to adjust the output on the outputting module or to adjust it on the input module once received.

Any insights, tips, etc are greatly appreciated. Sorry if that was poorly worded, feel free to ask for any clarification if I was horrendously unlear.

Thanks in advance!

1 Like

I think I understand what you’re asking :laughing: And I’d say that both approaches should work fine. I can’t see why scaling the amplitude of an LFO would cause any crashes, unless you are using it to drive a filter, in which case negative values might be problematic. I had issues sending negative values to the moogladder filter opcode. In fact, this might be the problem. Can the LFO destination handle negative values? If not, use abs() or make sure that the LFO mode is unipolar.