Lägg till inbyggd stämapparat i DownTune

This commit is contained in:
crille committed 2026-11-26 11:45:52 +01:00
1 parent aa94048f53
commit 53f9515ac9
5 files changed
+257 -120

No files matched your search

+18 -1
View File
@@ -27,6 +27,11 @@ juce::AudioProcessorValueTreeState::ParameterLayout CrilleBassStripAudioProcesso
"DownTune",
false));
p.add(std::make_unique<juce::AudioParameterBool>(
pid("tunerOn"),
"Tuner On",
false));
p.add(std::make_unique<juce::AudioParameterBool>(
pid("gateOn"),
"Gate On",
@@ -492,13 +497,25 @@ void CrilleBassStripAudioProcessor::processBlock(
const bool eqEnabled =
apvts.getRawParameterValue("eqOn")->load() > 0.5f;
if (buffer.getNumChannels() > 0)
const bool tunerEnabled =
apvts.getRawParameterValue("tunerOn")->load() > 0.5f;
if (tunerEnabled && buffer.getNumChannels() > 0)
{
updatePitchDetector(
buffer.getReadPointer(0),
numSamples
);
}
else
{
detectedFrequencyHz.store(
0.0f,
std::memory_order_relaxed);
pitchSamplesCollected = 0;
pitchAnalysisCounter = 0;
}
// Clear output channels that do not contain input data.
for (int c = getTotalNumInputChannels();