Skip to content

Commit

Permalink
Tweak DC Bias range and process Level Detective even if output is not…
Browse files Browse the repository at this point in the history
… connected
  • Loading branch information
jatinchowdhury18 committed Jul 30, 2023
1 parent c5f9f4c commit 231ec64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/processors/chain/ProcessorChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,14 @@ void ProcessorChain::runProcessor (BaseProcessor* proc, AudioBuffer<float>& buff

int nextNumProcs = 0;
const int numOutputs = proc->getNumOutputs();
int numAudioOutputs = 0;
for (int i = 0; i < numOutputs; ++i)
{
const int numOutProcs = proc->getNumOutputConnections (i);
for (int j = 0; j < numOutProcs; ++j)
nextNumProcs += 1;

numAudioOutputs += proc->getOutputPortType (i) == PortType::audio ? 1 : 0;
}

if (proc == &outputProcessor) // we've reached the output processor, so we're done!
Expand All @@ -115,7 +118,7 @@ void ProcessorChain::runProcessor (BaseProcessor* proc, AudioBuffer<float>& buff
return;
}

if (nextNumProcs == 0) // the output of this processor is connected to nothing, so let's not waste our processing...
if (nextNumProcs == 0 && numAudioOutputs > 0) // the output of this processor is connected to nothing, so let's not waste our processing...
{
if (proc == &inputProcessor)
inputProcessor.resetLevels();
Expand Down
2 changes: 1 addition & 1 deletion src/processors/utility/DCBias.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DCBias : public BaseProcessor
{
using namespace ParameterHelpers;
auto params = createBaseParams();
emplace_param<chowdsp::FloatParameter> (params, "bias", "Bias", NormalisableRange { -0.25f, 0.25f }, 0.0f, &floatValToString, &stringToFloatVal);
emplace_param<chowdsp::FloatParameter> (params, "bias", "Bias", NormalisableRange { -1.0f, 1.0f }, 0.0f, &floatValToString, &stringToFloatVal);

return { params.begin(), params.end() };
}
Expand Down

0 comments on commit 231ec64

Please sign in to comment.