Browse Source

VST3: Fixed an issue with parallel streams of parameter updates during playback

tags/2021-05-28
Tom Poole 7 years ago
parent
commit
2d92311116
2 changed files with 18 additions and 2 deletions
  1. +12
    -2
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  2. +6
    -0
      modules/juce_audio_processors/processors/juce_AudioProcessor.h

+ 12
- 2
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -241,7 +241,12 @@ public:
if (v != valueNormalized)
{
valueNormalized = v;
owner.setParameter (paramIndex, static_cast<float> (v));
// Only update the AudioProcessor here if we're not playing,
// otherwise we get parallel streams of parameter value updates
// during playback
if (owner.vst3IsPlaying.get() == 0)
owner.setParameter (paramIndex, static_cast<float> (v));
changed();
return true;
@@ -636,7 +641,6 @@ private:
#endif
Vst::ParamID bypassParamID;
//==============================================================================
void setupParameters()
{
@@ -2031,9 +2035,15 @@ public:
return kResultFalse;
if (data.processContext != nullptr)
{
processContext = *data.processContext;
pluginInstance->vst3IsPlaying = processContext.state & Vst::ProcessContext::kPlaying;
}
else
{
zerostruct (processContext);
pluginInstance->vst3IsPlaying = 0;
}
midiBuffer.clear();


+ 6
- 0
modules/juce_audio_processors/processors/juce_AudioProcessor.h View File

@@ -1606,6 +1606,12 @@ private:
template <typename floatType>
void processBypassed (AudioBuffer<floatType>&, MidiBuffer&);
#if JucePlugin_Build_VST3
friend class JuceVST3EditController;
friend class JuceVST3Component;
Atomic<int> vst3IsPlaying { 0 };
#endif
// This method is no longer used - you can delete it from your AudioProcessor classes.
JUCE_DEPRECATED_WITH_BODY (virtual bool silenceInProducesSilenceOut() const, { return false; })


Loading…
Cancel
Save