yokemura / Magical8bitPlug2

GNU General Public License v3.0
301 stars 19 forks source link

Clear the buffer passed to processBlock #41

Closed driftveil closed 6 months ago

driftveil commented 7 months ago

The JUCE docs say that:

Note that if you have more outputs than inputs, then only those channels that correspond to an input channel are guaranteed to contain sensible data - e.g. in the case of 2 inputs and 4 outputs, the first two channels contain the input, but the last two channels may contain garbage, so you should be careful not to let this pass through without being overwritten or cleared.

So because renderNextBlock adds to the values in the buffer instead of overwriting them, I think the output buffer should be zeroed before calling renderNextBlock.

This seems to fix the issues on Linux that @Exagone313 mentioned.