CMLSChorus.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. ==============================================================================
  3. CMLSChorus.h
  4. Created: 1 May 2025 11:04:18pm
  5. Author: Luigi
  6. ==============================================================================
  7. */
  8. #pragma once
  9. #include <JuceHeader.h>
  10. #define DELAY_CENTER 0.015 // Center for delay in seconds
  11. #define LFO_MIN_FREQ 0.0f // Minimum frequency of the LFO
  12. #define LFO_MAX_FREQ 5.0f // Maximum frequency of the LFO
  13. #define LFO_FREQ_DELTA 0.3f // Frequency delta between the two LFOs
  14. #define LFO_MIN_DEPTH 0.0f // Minimum depth of the LFO
  15. #define LFO_MAX_DEPTH 5.0f // Maximum depth of the LFO
  16. class CMLSChorus : juce::dsp::ProcessorBase {
  17. public:
  18. CMLSChorus();
  19. ~CMLSChorus() override;
  20. void reset() override;
  21. void prepare(const juce::dsp::ProcessSpec&);
  22. void process(const juce::dsp::ProcessContextReplacing<float>&);
  23. // Parameter getters and setters
  24. void setDryWet(float value);
  25. void setAmount(float value);
  26. const float getDryWet();
  27. const float getAmount();
  28. private:
  29. float dryWetProp = 0.0;
  30. float amount = 0.0;
  31. juce::dsp::Chorus<float> delayLine1; // 1st chorus delayline
  32. juce::dsp::Chorus<float> delayLine2; // 2nd chorus delayline
  33. juce::dsp::DryWetMixer<float> dryWetMixer; // Dry/Wet mixer
  34. juce::NormalisableRange<float>* freqRange; // Range for LFOs frequencies
  35. juce::NormalisableRange<float>* depthRange; // Range for LFOs depth
  36. };