Hey All,
I'm a longtime 3rd party developer for Kontakt, now making my own sampler. I'm a little bit stuck as to how I'm supposed to implement insert FX for the Sampler.
My sampler needs to have the ability to have different FX on different sample groups. I've managed to get playback working well using the SamplerSound, SamplerVoice, and Synthesiser types, but whenever I try to plug in the basic IIR filter, I get a bunch of glitches/distortion in the sound.
In my AudioSource's getNextAudioBlock() function, I've attempted to apply the filter like so:
for (int i=0; i<bufferToFill.buffer->getNumChannels(); i++){
filter.processSamples(bufferToFill.buffer->getWritePointer(i), bufferToFill.buffer->getNumSamples());
}
I did see in the documentation that one shouldn't do a bunch of processing in this function, and that doing so will cause glitches. Then where do I apply my processing? I tried subclassing SamplerVoice and implementing it in its renderNextBlock() function, but seeing as how this function is called from the getNextAudioBlock's thread, I am getting the same glitches.
I was looking into the AudioProcessor API, but I don't understand how I'm supposed to connect my SamplerSounds with the AudioProcessor.
Would anyone care to share some insight?