Skip to content

Commit

Permalink
wip: make the chorus a phaser to see if it sounds better. It kinda do…
Browse files Browse the repository at this point in the history
…es? TODO: logic to cross-fade between more than 2 effects
  • Loading branch information
vberthiaume committed Dec 8, 2024
1 parent 5311986 commit dfeb300
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions source/DSP/PhatEffectsProcessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum class EffectType
{
verb = 0,
chorus,
// phaser,
transitioning
};

Expand Down Expand Up @@ -159,7 +160,10 @@ class EffectsProcessor
verbWrapper = std::make_unique<EffectProcessorWrapper<PhatVerbProcessor<T>, T>>();
verbWrapper->processor.setParameters (reverbParams);

chorusWrapper = std::make_unique<EffectProcessorWrapper<juce::dsp::Chorus<T>, T>>();
// chorusWrapper = std::make_unique<EffectProcessorWrapper<juce::dsp::Chorus<T>, T>>();

phaserWrapper = std::make_unique<EffectProcessorWrapper<juce::dsp::Phaser<T>, T>>();
chorusWrapper = std::make_unique<EffectProcessorWrapper<juce::dsp::Phaser<T>, T>>();
}

void prepare (const juce::dsp::ProcessSpec& spec)
Expand All @@ -170,6 +174,7 @@ class EffectsProcessor

verbWrapper->prepare (spec);
chorusWrapper->prepare (spec);
phaserWrapper->prepare (spec);
effectCrossFader.prepare (spec);
}

Expand Down Expand Up @@ -224,6 +229,7 @@ class EffectsProcessor
//make the individual blocks and process
auto audioBlock1 { juce::dsp::AudioBlock<T> (fade_buffer1).getSubBlock ((size_t) startSample, (size_t) numSamples) };
auto context1 { juce::dsp::ProcessContextReplacing<T> (audioBlock1) };
//TODO: this needs to use the current and the next effect
verbWrapper->process (context1);

auto audioBlock2 { juce::dsp::AudioBlock<T> (fade_buffer2).getSubBlock ((size_t) startSample, (size_t) numSamples) };
Expand All @@ -248,7 +254,10 @@ class EffectsProcessor
}

private:
std::unique_ptr<EffectProcessorWrapper<juce::dsp::Chorus<T>, T>> chorusWrapper;
// std::unique_ptr<EffectProcessorWrapper<juce::dsp::Chorus<T>, T>> chorusWrapper;
std::unique_ptr<EffectProcessorWrapper<juce::dsp::Phaser<T>, T>> chorusWrapper;

std::unique_ptr<EffectProcessorWrapper<juce::dsp::Phaser<T>, T>> phaserWrapper;

std::unique_ptr<EffectProcessorWrapper<PhatVerbProcessor<T>, T>> verbWrapper;
PhatVerbParameters reverbParams {
Expand Down
2 changes: 1 addition & 1 deletion source/DSP/PhatVerb.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class PhatVerb
};

template <std::floating_point T>
class PhatVerbProcessor //: PhatProcessorBase<T>
class PhatVerbProcessor
{
public:
/** Creates an uninitialised Reverb processor. Call prepare() before first use. */
Expand Down

0 comments on commit dfeb300

Please sign in to comment.