Just copy if gain is null
This commit is contained in:
parent
3a9fd31a0f
commit
498eee2dfc
1 changed files with 10 additions and 1 deletions
|
|
@ -30,9 +30,13 @@ void sfz::EQHolder::setup(const EQDescription& description, unsigned numChannels
|
|||
|
||||
void sfz::EQHolder::process(const float** inputs, float** outputs, unsigned numFrames)
|
||||
{
|
||||
if (description == nullptr) {
|
||||
auto justCopy = [&]() {
|
||||
for (unsigned channelIdx = 0; channelIdx < eq.channels(); channelIdx++)
|
||||
copy<float>({ inputs[channelIdx], numFrames }, { outputs[channelIdx], numFrames });
|
||||
};
|
||||
|
||||
if (description == nullptr) {
|
||||
justCopy();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -56,6 +60,11 @@ void sfz::EQHolder::process(const float** inputs, float** outputs, unsigned numF
|
|||
}
|
||||
lastGain = Default::eqGainRange.clamp(lastGain);
|
||||
|
||||
if (lastGain == 0.0f) {
|
||||
justCopy();
|
||||
return;
|
||||
}
|
||||
|
||||
eq.process(inputs, outputs, lastFrequency, lastBandwidth, lastGain, numFrames);
|
||||
}
|
||||
float sfz::EQHolder::getLastFrequency() const
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue