We have a problem with JUCE 4.2-based VST2 plugin not making any sound in Cubase (tested on both 8.5.0 and 8.5.15 on Windows and OS X) after the setLatencySamples() is called.
Thing is, if we call the setLatencySamples() from the constructor of our AudioProcessor, it works fine. But our plugin doesn’t know the real latency until later. So it is reported by the message thread a couple of seconds after plugin startup. But after this call, there’s no longer any audio output!
This is easy to reproduce in the MultiOutSynth plugin example. If I do this:
MultiOutSynth()
{
// The base class constructor will already add a main stereo output bus
// If you want to add your own main channel then simply call clear the
// output buses (busArrangement.outputBuses.clear()) and then add your own
// Add additional output buses but disable these by default
for (int busNr = 1; busNr < maxMidiChannel; ++busNr)
busArrangement.outputBuses.add (AudioProcessorBus (String ("Output #") += String (busNr + 1), AudioChannelSet::disabled()));
// initialize other stuff (not related to buses)
formatManager.registerBasicFormats();
for (int midiChannel = 0; midiChannel < maxMidiChannel; ++midiChannel)
{
synth.add (new Synthesiser());
for (int i = 0; i < maxNumberOfVoices; ++i)
synth[midiChannel]->addVoice (new SamplerVoice());
}
loadNewSample (BinaryData::singing_ogg, BinaryData::singing_oggSize);
startTimer(3000); // <-- ADDED
}
void timerCallback() override
{
setLatencySamples(1000); // <-- now the plugin no longer produced sound in Cubase
stopTimer();
}