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.

54 lines
868B

  1. #pragma once
  2. #include "bogaudio.hpp"
  3. #include "dsp/signal.hpp"
  4. using namespace bogaudio::dsp;
  5. extern Model* modelVCA;
  6. namespace bogaudio {
  7. struct VCA : Module {
  8. enum ParamsIds {
  9. LEVEL1_PARAM,
  10. LEVEL2_PARAM,
  11. LINEAR_PARAM,
  12. NUM_PARAMS
  13. };
  14. enum InputsIds {
  15. CV1_INPUT,
  16. IN1_INPUT,
  17. CV2_INPUT,
  18. IN2_INPUT,
  19. NUM_INPUTS
  20. };
  21. enum OutputsIds {
  22. OUT1_OUTPUT,
  23. OUT2_OUTPUT,
  24. NUM_OUTPUTS
  25. };
  26. enum LightsIds {
  27. LINEAR_LIGHT,
  28. NUM_LIGHTS
  29. };
  30. Amplifier _amplifier1;
  31. SlewLimiter _levelSL1;
  32. Amplifier _amplifier2;
  33. SlewLimiter _levelSL2;
  34. VCA() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {
  35. onSampleRateChange();
  36. }
  37. void onSampleRateChange() override;
  38. void step() override;
  39. void channelStep(Input& input, Output& output, Param& knob, Input& cv, Amplifier& amplifier, SlewLimiter& levelSL, bool linear);
  40. };
  41. } // namespace bogaudio