I’m having a problem correctly implementing a Juce Synthesiser plug-in.
I can get my synth to function how I want it to, producing sin waves in response to midi-on messages and allowing the sound to tail off after the note is released. However, I noticed that, when releasing the midi key, there is often a “pop” in the audio output.
I have spent a few days trying to figure this out. To simplify things for troubleshooting, I started a brand new plug-in in the projucer, and made the most basic SynthesiserVoice and SynthesiserSound subclasses possible. The sound automatically plays on all channels and notes. The voice’s startNote and stopNote functions are empty. The voice “renderNextBlock” function returns “0.25” for all samples of all channels.
When I open the plugin in the Juce host, there is an expected pop as the speaker adjusts to the 0.25 position. And when I start pressing midi keys, there is a click for each on and off message. If i adjust the “renderNextBlock” function to return 0.0 instead of 0.25, there is no click when pressing keys.
The “renderNextBlock” function should be filling the buffer with a consistent value. It seems like midi on-off messages are zeroing some of the buffer outside the “renderNextBlock” function. I don’t know how to debug where/how this is happening.
Any help would be much appreciated. I feel like the answer must be incredibly simple, but I just can’t find it.