FrequencyModulation on Sampler

hello everybody, I hope you are all safe :slight_smile:I am still pretty new to Juce (but I love it :)) but sometimes I am a little bit confused.
In a VST plugin,
I would like to apply FM modulation to the sound of a sampler, that I coded using Synthesiszer/SamplerSound.

If I want to apply FM (with a fixed pitch sine wave, for example), can I apply it to this class or do I have to use something else?
do I need to create a dsp::ProcessSpec ?

thanks.
d

You need to make a custom sampler voice implementation from scratch. The Juce one doesn’t really allow custom features.

thanks Xenakios, from which base class should I start?

You should inherit from Juce’s SynthesiserVoice. You can look at the Juce SamplerVoice for inspiration on the implementation. (Note that it’s doing a very basic linear interpolation for the resampling, though. If you want higher quality results for extreme frequency modulation effects etc, you need to do something else.)

cool. I am taking a look and I am slowly getting it.
what is not clear yer if I do need a processorChan to implement an LFO which modulates the parameters of my Sampler (for example pitch, or pan) or if everything can be done in the same processorBlock…