Skip to content

Commit

Permalink
Fixing headless and small delay rhythm parameter cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Nov 8, 2023
1 parent c8d2343 commit ec3674b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/headless/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 2 additions & 23 deletions src/processors/other/Delay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,24 +246,8 @@ void DelayModule::processAudio (AudioBuffer<float>& 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<float> (delayInSeconds) * fs;
delaySmooth.setTargetValue (delayInSamples);
}
freqSmooth.setTargetValue (*freqParam);
Expand Down Expand Up @@ -309,11 +293,6 @@ void DelayModule::processAudioBypassed (AudioBuffer<float>& buffer)
outputBuffers.getReference (0) = &buffer;
}

float DelayModule::calculateTempoSyncDelayTime (const double timeInSeconds, const double sampleRate)
{
return static_cast<float> (timeInSeconds * sampleRate);
}

bool DelayModule::getCustomComponents (OwnedArray<Component>& customComps, chowdsp::HostContextProvider& hcp)
{
using namespace chowdsp::ParamUtils;
Expand Down
1 change: 0 additions & 1 deletion src/processors/other/Delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class DelayModule : public BaseProcessor
void releaseMemory() override;
void processAudio (AudioBuffer<float>& buffer) override;
void processAudioBypassed (AudioBuffer<float>& buffer) override;
static float calculateTempoSyncDelayTime (const double timeInSeconds, const double sampleRate);

private:
template <typename DelayType>
Expand Down

0 comments on commit ec3674b

Please sign in to comment.