diff --git a/src/headless/CMakeLists.txt b/src/headless/CMakeLists.txt index 9bee559b..64722963 100644 --- a/src/headless/CMakeLists.txt +++ b/src/headless/CMakeLists.txt @@ -42,6 +42,7 @@ target_include_directories(BYOD_headless ../../modules/chowdsp_utils/modules/gui ../../modules/chowdsp_utils/modules/plugin ../../modules/chowdsp_utils/modules/common + ../../modules/chowdsp_utils/modules/music ../../modules/JUCE/modules ../../modules/chowdsp_wdf/include ../../modules/ea_variant diff --git a/src/processors/other/Delay.cpp b/src/processors/other/Delay.cpp index ef7ecb61..7955baee 100644 --- a/src/processors/other/Delay.cpp +++ b/src/processors/other/Delay.cpp @@ -246,24 +246,8 @@ void DelayModule::processAudio (AudioBuffer& buffer) } else { - float delayInSamples = fs * 200 * 0.001f; - auto noteDivision = (int) *delayTimeRhythmParam; - if (noteDivision == 0) - { - delayInSamples = calculateTempoSyncDelayTime (HALF.getTimeSeconds (tempo), fs); - } - else if (noteDivision == 1) - { - delayInSamples = calculateTempoSyncDelayTime (QUARTER.getTimeSeconds (tempo), fs); - } - else if (noteDivision == 2) - { - delayInSamples = calculateTempoSyncDelayTime (EIGHTH.getTimeSeconds (tempo), fs); - } - else if (noteDivision == 3) - { - delayInSamples = calculateTempoSyncDelayTime (EIGHTH_DOT.getTimeSeconds (tempo), fs); - } + const auto delayInSeconds = delayTimeRhythmParam->getRhythmTimeSeconds (tempo); + const auto delayInSamples = static_cast (delayInSeconds) * fs; delaySmooth.setTargetValue (delayInSamples); } freqSmooth.setTargetValue (*freqParam); @@ -309,11 +293,6 @@ void DelayModule::processAudioBypassed (AudioBuffer& buffer) outputBuffers.getReference (0) = &buffer; } -float DelayModule::calculateTempoSyncDelayTime (const double timeInSeconds, const double sampleRate) -{ - return static_cast (timeInSeconds * sampleRate); -} - bool DelayModule::getCustomComponents (OwnedArray& customComps, chowdsp::HostContextProvider& hcp) { using namespace chowdsp::ParamUtils; diff --git a/src/processors/other/Delay.h b/src/processors/other/Delay.h index c12e8b74..03e0513d 100644 --- a/src/processors/other/Delay.h +++ b/src/processors/other/Delay.h @@ -15,7 +15,6 @@ class DelayModule : public BaseProcessor void releaseMemory() override; void processAudio (AudioBuffer& buffer) override; void processAudioBypassed (AudioBuffer& buffer) override; - static float calculateTempoSyncDelayTime (const double timeInSeconds, const double sampleRate); private: template