Hi @eugarps,
I think it's normal for a VST host to instantiate a plugin several times, from what I recall.
The getPatchProcessor() call is static and relies on a juce:ThreadLocalValue to be set. Which it should be!
There's some startup code which sets a default patch in the StompBoxAudioProcessor()
constructor. Perhaps this is not called, or called from a different thread than calls prepareToPlay()
?
What you could do try is adding this line to prepareToPlay()
, line 168:
void StompBoxAudioProcessor::prepareToPlay(double sampleRate, int samplesPerBlock){
// Use this method as the place to do any pre-playback
// initialisation that you need..
instance = this; // add this line
patchprocessor->setPatch(patches.create(currentPatchName));
}
If that doesn't work, check that patchprocessor
is not null at this point.
ps apologies for the terrible naming, of classes and files, in the OwlSim project - it's something that we meant to but never got around to clearing up!