CMLSDistortion.h 734 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <JuceHeader.h>
  3. class CMLSDistortion : public juce::dsp::ProcessorBase {
  4. public:
  5. CMLSDistortion();
  6. ~CMLSDistortion() override = default;
  7. void prepare(const juce::dsp::ProcessSpec&) override;
  8. void reset() override;
  9. void process(const juce::dsp::ProcessContextReplacing<float>&) override;
  10. void setDrive(float drive); // controls intensity
  11. void setMix(float mix); // controls the dry/wet mix ratio,how much of the distorted signal is mixed with the original signal
  12. // 0.0 = dry, 1.0 = full distortion
  13. private:
  14. float drive = 1.0f;
  15. float mix = 1.0f;
  16. juce::dsp::Gain<float> inputGain, outputGain;
  17. };
  18. #pragma once