Plugins behave differently on Windows and MacOs


i built a plugin of a guitar distortion effect and i compile it both for Windows (VST3) and for MacOs (VST3 and AU), sharing only source files and the file .jucer. All worked fine until i decided to control the parameters with the AudioProcessorValueTreeState to enable the automation and the saving through xml file, following what is written here: .
When i made this passage i deleted my method ‘sliderValueChanged’ and i connected the sliders with the parameters by using the SliderAttachment.
In macOs my plugin (indifferently VST3 or AU) behaves correctly.
In Windows (VST3) strange things happen when I move the sliders, generating incoherent output audio. Sometimes when i move the sliders, i have no output.

Could someone help me, please? I don’t know why there are these differences in the two OS while the plugin have the same source code

Ok - so #1 thing to look for are uninitialized member variables.

On app startup, I think, Windows memory is filled with garbage, and the Mac zeros out your RAM.

Try the static analyzer built into Xcode as a first way of spotting them.

1 Like

Another thing to watch out (which may be as well host dependent): did you code to allow variable AudioBuffer sizes in your processBlock() method?
That might be the value you got from prepareToPlay, but it can change at any point for various reasons.

Thank you very much man!
I found the error by using the static analyzer! :slight_smile:

1 Like


Take care to initialise all your member variables … after a while you’ll stop making the mistake.