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

Method processBlock

Source/PluginProcessor.cpp:724–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722}
723
724void FireAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
725{
726 if (isBypassed)
727 {
728 isBypassed = false;
729 }
730
731 if (needsReset.exchange(false))
732 {
733 performReset();
734 }
735
736 // report latency
737 if (*treeState.getRawParameterValue(HQ_ID))
738 {
739 totalLatency = bands[0]->oversampling->getLatencyInSamples();
740 }
741 setLatencySamples(juce::roundToInt(totalLatency));
742
743 juce::ScopedNoDenormals noDenormals;
744 auto totalNumInputChannels = getTotalNumInputChannels();
745 auto totalNumOutputChannels = getTotalNumOutputChannels();
746 auto sampleRate = getSampleRate();
747
748 if (sampleRate <= 0)
749 {
750 sampleRate = 48000;
751 }
752
753 juce::AudioBuffer<float> lfoOutputBuffer(4, buffer.getNumSamples());
754 lfoOutputBuffer.clear();
755
756 if (lfoManager->isModulationActive())
757 {
758 lfoManager->processBlock(lfoOutputBuffer, sampleRate, getPlayHead(), buffer.getNumSamples());
759 }
760
761 // In case we have more outputs than inputs, this code clears any output
762 // channels that didn't contain input data, (because these aren't
763 // guaranteed to be empty - they may contain garbage).
764 // This is here to avoid people getting screaming feedback
765 // when they first compile a plugin, but obviously you don't need to keep
766 // this code if your algorithm always overwrites all the output channels.
767 for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
768 buffer.clear(i, 0, buffer.getNumSamples());
769
770 updateParameters();
771
772 calculateAndStoreLevels(buffer, mInputLeftRMSGlobal, mInputRightRMSGlobal, mInputLeftPeakGlobal, mInputRightPeakGlobal);
773
774 // 1. GET PARAMETERS & SMOOTH FREQUENCIES
775 int numBands = static_cast<int>(*treeState.getRawParameterValue(NUM_BANDS_ID));
776 int lineNum = numBands - 1;
777
778 // Set target values for smoothers from APVTS
779 smoothedFreq1.setTargetValue(*treeState.getRawParameterValue(ParameterIDAndName::getIDString(FREQ_ID, 0)));
780 smoothedFreq2.setTargetValue(*treeState.getRawParameterValue(ParameterIDAndName::getIDString(FREQ_ID, 1)));
781 smoothedFreq3.setTargetValue(*treeState.getRawParameterValue(ParameterIDAndName::getIDString(FREQ_ID, 2)));

Callers

nothing calls this directly

Calls 5

getIDStringFunction · 0.85
getChainSettingsFunction · 0.85
isModulationActiveMethod · 0.80
getModulatedValueMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected