You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
865B

  1. #pragma once
  2. #include "bogaudio.hpp"
  3. #include "dsp/signal.hpp"
  4. using namespace bogaudio::dsp;
  5. extern Model* modelClpr;
  6. namespace bogaudio {
  7. struct Clpr : Module {
  8. enum ParamsIds {
  9. THRESHOLD_PARAM,
  10. OUTPUT_GAIN_PARAM,
  11. KNEE_PARAM,
  12. NUM_PARAMS
  13. };
  14. enum InputsIds {
  15. LEFT_INPUT,
  16. RIGHT_INPUT,
  17. THRESHOLD_INPUT,
  18. OUTPUT_GAIN_INPUT,
  19. NUM_INPUTS
  20. };
  21. enum OutputsIds {
  22. LEFT_OUTPUT,
  23. RIGHT_OUTPUT,
  24. NUM_OUTPUTS
  25. };
  26. enum LightsIds {
  27. NUM_LIGHTS
  28. };
  29. const int modulationSteps = 100;
  30. int _modulationStep = 0;
  31. float _thresholdDb = 0.0f;
  32. float _outGain = -1.0f;
  33. float _outLevel = 0.0f;
  34. bool _softKnee = true;
  35. Compressor _compressor;
  36. Amplifier _amplifier;
  37. Saturator _saturator;
  38. Clpr() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {
  39. onReset();
  40. }
  41. void onReset() override;
  42. void step() override;
  43. };
  44. } // namespace bogaudio