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.

55 lines
823B

  1. #pragma once
  2. #include "bogaudio.hpp"
  3. #include "dsp/signal.hpp"
  4. using namespace bogaudio::dsp;
  5. extern Model* modelSlew;
  6. namespace bogaudio {
  7. struct Slew : Module {
  8. enum ParamsIds {
  9. RISE_PARAM,
  10. RISE_SHAPE_PARAM,
  11. FALL_PARAM,
  12. FALL_SHAPE_PARAM,
  13. NUM_PARAMS
  14. };
  15. enum InputsIds {
  16. RISE_INPUT,
  17. FALL_INPUT,
  18. IN_INPUT,
  19. NUM_INPUTS
  20. };
  21. enum OutputsIds {
  22. OUT_OUTPUT,
  23. NUM_OUTPUTS
  24. };
  25. enum LightsIds {
  26. NUM_LIGHTS
  27. };
  28. const int modulationSteps = 100;
  29. int _modulationStep = 0;
  30. bool _rising = true;
  31. float _last = 0.0f;
  32. ShapedSlewLimiter _rise;
  33. ShapedSlewLimiter _fall;
  34. Slew() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {
  35. onReset();
  36. }
  37. void onReset() override;
  38. void step() override;
  39. float time(Param& param, Input& input);
  40. float shape(Param& param);
  41. };
  42. } // namespace bogaudio