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

Method updateLfoChain

Source/Panels/SpectrogramPanel/FilterControl.cpp:451–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451void FilterControl::updateLfoChain(const ModulatedFilterValues& modulatedValues)
452{
453 // Create a temporary ChainSettings struct and populate it with the
454 // modulated values received from the audio thread.
455 ChainSettings settings;
456 settings.lowCutFreq = modulatedValues.lowCutFreq;
457 settings.lowCutGainInDecibels = modulatedValues.lowCutGain;
458 settings.lowCutQuality = modulatedValues.lowCutQ;
459 settings.highCutFreq = modulatedValues.highCutFreq;
460 settings.highCutGainInDecibels = modulatedValues.highCutGain;
461 settings.highCutQuality = modulatedValues.highCutQ;
462 settings.peakFreq = modulatedValues.peakFreq;
463 settings.peakGainInDecibels = modulatedValues.peakGain;
464 settings.peakQuality = modulatedValues.peakQ;
465
466 // Get non-modulated settings directly from the processor's state tree.
467 auto& apvts = processor.treeState;
468 settings.lowCutSlope = static_cast<Slope>(apvts.getRawParameterValue(LOWCUT_SLOPE_ID)->load());
469 settings.highCutSlope = static_cast<Slope>(apvts.getRawParameterValue(HIGHCUT_SLOPE_ID)->load());
470 settings.lowCutBypassed = apvts.getRawParameterValue(LOWCUT_BYPASSED_ID)->load() > 0.5f;
471 settings.peakBypassed = apvts.getRawParameterValue(PEAK_BYPASSED_ID)->load() > 0.5f;
472 settings.highCutBypassed = apvts.getRawParameterValue(HIGHCUT_BYPASSED_ID)->load() > 0.5f;
473
474 auto sampleRate = processor.getSampleRate();
475 if (sampleRate <= 0)
476 return;
477
478 // The rest of this logic is identical to updateChain, but for lfoMonoChain.
479 auto peakCoefficients = makePeakFilter(settings, sampleRate);
480 updateCoefficients(lfoMonoChain.get<ChainPositions::Peak>().coefficients, peakCoefficients);
481
482 auto lowCutCoefficients = makeLowCutFilter(settings, sampleRate);
483 auto highCutCoefficients = makeHighCutFilter(settings, sampleRate);
484
485 auto lowCutQCoefficients = makeLowcutQFilter(settings, sampleRate);
486 updateCoefficients(lfoMonoChain.get<ChainPositions::LowCutQ>().coefficients, lowCutQCoefficients);
487 auto highCutQCoefficients = makeHighcutQFilter(settings, sampleRate);
488 updateCoefficients(lfoMonoChain.get<ChainPositions::HighCutQ>().coefficients, highCutQCoefficients);
489
490 updateCutFilter(lfoMonoChain.get<ChainPositions::LowCut>(), lowCutCoefficients, settings.lowCutSlope);
491 updateCutFilter(lfoMonoChain.get<ChainPositions::HighCut>(), highCutCoefficients, settings.highCutSlope);
492}
493
494void FilterControl::updateLfoResponseCurve()
495{

Callers

nothing calls this directly

Calls 7

makePeakFilterFunction · 0.85
updateCoefficientsFunction · 0.85
makeLowCutFilterFunction · 0.85
makeHighCutFilterFunction · 0.85
makeLowcutQFilterFunction · 0.85
makeHighcutQFilterFunction · 0.85
updateCutFilterFunction · 0.85

Tested by

no test coverage detected