Don't bypass effects without inputs

It's not really a great idea if you have long tails..
This commit is contained in:
Paul Fd 2021-12-06 23:58:26 +01:00
parent f8ffb5294c
commit a74bd5eee0
2 changed files with 2 additions and 6 deletions

View file

@ -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<const float> 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<float>(_inputs), AudioSpan<float>(_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);

View file

@ -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<float> _outputs { EffectChannels, config::defaultSamplesPerBlock };
float _gainToMain { Default::effect };
float _gainToMix { Default::effect };
bool _hasSignal { false };
};
} // namespace sfz