MCPcopy Create free account
hub / github.com/jerryuhoo/Fire / applyGlobalEffects

Method applyGlobalEffects

Source/PluginProcessor.cpp:1996–2039  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1994}
1995
1996void FireAudioProcessor::applyGlobalEffects(juce::AudioBuffer<float>& buffer, const juce::AudioBuffer<float>& lfoOutputs, double sampleRate)
1997{
1998 // ==============================================================================
1999 // 1. Global Filter Processing (Block-based)
2000 // ==============================================================================
2001 if (*treeState.getRawParameterValue(FILTER_BYPASS_ID) > 0.5f)
2002 {
2003 updateGlobalFilters(sampleRate);
2004 auto block = juce::dsp::AudioBlock<float>(buffer);
2005
2006 auto leftBlock = block.getSingleChannelBlock(0);
2007 leftChain.process(juce::dsp::ProcessContextReplacing<float>(leftBlock));
2008
2009 if (buffer.getNumChannels() > 1)
2010 {
2011 auto rightBlock = block.getSingleChannelBlock(1);
2012 rightChain.process(juce::dsp::ProcessContextReplacing<float>(rightBlock));
2013 }
2014 }
2015
2016 // ==============================================================================
2017 // 2. Global Gain Processing
2018 // ==============================================================================
2019
2020 // a. Prepare the "recipe" for the global output gain.
2021 ModulatedValueProvider globalGainProvider;
2022 auto* param = treeState.getParameter(OUTPUT_ID);
2023 if (! param)
2024 return;
2025
2026 globalGainProvider.baseValue = *treeState.getRawParameterValue(OUTPUT_ID);
2027 globalGainProvider.range = param->getNormalisableRange();
2028
2029 auto modInfo = getModulationInfoForParameter(OUTPUT_ID);
2030 if (modInfo.isModulated && ! modInfo.isBypassed)
2031 {
2032 globalGainProvider.lfoSignal = lfoOutputs.getReadPointer(modInfo.sourceLfoIndex - 1);
2033 globalGainProvider.modulationDepth = modInfo.depth;
2034 globalGainProvider.isBipolar = modInfo.isBipolar;
2035 }
2036
2037 // b. Apply the gain using our new, clean helper function.
2038 applyGain(buffer, globalGainProvider);
2039}
2040
2041void FireAudioProcessor::applyDownsamplingEffect(juce::AudioBuffer<float>& buffer, const juce::AudioBuffer<float>& lfoOutputs)
2042{

Callers

nothing calls this directly

Calls 2

applyGainFunction · 0.85
processMethod · 0.45

Tested by

no test coverage detected