diff --git a/src/sfizz/Effects.cpp b/src/sfizz/Effects.cpp index 81cc3d00..2ca5b8a4 100644 --- a/src/sfizz/Effects.cpp +++ b/src/sfizz/Effects.cpp @@ -119,8 +119,6 @@ void EffectBus::addToInputs(const float* const addInput[], float addGain, unsign if (addGain == 0) return; - _hasSignal = true; - for (unsigned c = 0; c < EffectChannels; ++c) { absl::Span addIn { addInput[c], nframes }; sfz::multiplyAdd1(addGain, addIn, _inputs.getSpan(c).first(nframes)); @@ -165,8 +163,6 @@ void EffectBus::process(unsigned nframes) fx::Nothing().process( AudioSpan(_inputs), AudioSpan(_outputs), nframes); } - - _hasSignal = false; } void EffectBus::mixOutputsTo(float* const mainOutput[], float* const mixOutput[], unsigned nframes) @@ -185,6 +181,7 @@ size_t EffectBus::numEffects() const noexcept { return _effects.size(); } + void EffectBus::setSamplesPerBlock(int samplesPerBlock) noexcept { _inputs.resize(samplesPerBlock); diff --git a/src/sfizz/Effects.h b/src/sfizz/Effects.h index 25ce96e5..804bc4ad 100644 --- a/src/sfizz/Effects.h +++ b/src/sfizz/Effects.h @@ -109,7 +109,7 @@ public: /** @brief Checks whether this bus can produce output. */ - bool hasNonZeroOutput() const { return _hasSignal && (_gainToMain != 0 || _gainToMix != 0); } + bool hasNonZeroOutput() const { return (_gainToMain != 0 || _gainToMix != 0); } /** @brief Sets the amount of effect output going to the main. @@ -189,7 +189,6 @@ private: AudioBuffer _outputs { EffectChannels, config::defaultSamplesPerBlock }; float _gainToMain { Default::effect }; float _gainToMix { Default::effect }; - bool _hasSignal { false }; }; } // namespace sfz