Adding LFOs and Modulators

Hi all,

I am building a simple plug-in, its a simple delay with feedback and a filter - first time getting into it, and I was wonder how should I approach the modulators...
For example, I want to have a couple of LFOs or Random generators that can controll any of the plugins "main" parameters.

I've have the main part of the plugin working, but as for the extra modulators I have yet to wrap my head around it, practically no idea how to proceed!

Should I create a class that holds the LFOs gui and dsp? How do I "connect" the LFO with a parameter and where should I advance the LFO?

Any advice, pointer to examples or tutorials would be very much appreciated!





If you wanna build a superdooper lfo like the dubstep people use, with sequenced sections and lots of waveform choices, then setting it up as a class would make sense. But if you’re just after a bog standard oldschool lfo, with up to 3 or 4 waveforms, then i would just include that in the main dsp code of the effect.
That’s just personal choice of course, and i’m sure others would make a separate class even for a simple lfo.

I calculate my modulations once per block, and then just use those variables in my main dsp loop. For things that need to be completely step-free and smooth, i interpolate between the current block value and the next block value during the dsp loop. But for most stuff it’s more than good enough just to recalculate the modulation once a block.

Then in your dsp loop it’s a simple as something like:
delayTime += delayModulation;

For start I am going to implement a basic simple lfo, but "hardcoding" it in the DSP doesn't seem very convinient as I want to be able to map any of the LFOs (and other modulators eventually) to any of the plugin parameters.

That is my main concern, how would I go about doing the a dynamic mapping?

sorry, i thought maybe somebody with more experience would help you.  

i have never coded a totally dynamic system, and actually i doubt that many people here have done that either.  So, my suggestion is that you may want to think about your priorities.  If having a totally dynamic system with every modulation available to every parameter is your goal, then you probably need to program some wrapper around your paramters that allows for that....i don't full know the juce library, but so far i have not seen such a thing. 

But if you just want to send 4 or 5 or even 10 modulations to 4 or 5 or even 10 parameters, then honestly, i still think hard coding with a few switch statements to route your paramters is still the simplest way to go. 

hopefully someone will come and tell me i'm being stupid and offer a better solution, and then we can both learn?  sorry, would love to help more, 


No worries! Yes I agree that few modulators to few parameters is probably better to be hard coded, but the plug in I do is more of a practice one so I want to cover a full dynamic mapping…
Thank you again for the tips!