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.

84 lines
2.8KB

  1. #pragma once
  2. #include "RichterLFO/RichterLFO.h"
  3. #include "WEFilters/AREnvelopeFollowerSquareLaw.h"
  4. namespace ModelInterface {
  5. class CloneableLFO : public WECore::Richter::RichterLFO {
  6. public:
  7. CloneableLFO() : WECore::Richter::RichterLFO() {}
  8. CloneableLFO* clone() const {
  9. return new CloneableLFO(*this);
  10. }
  11. void setFreqModulationSources(std::vector<WECore::ModulationSourceWrapper<double>> sources) {
  12. _freqModulationSources = sources;
  13. }
  14. void setDepthModulationSources(std::vector<WECore::ModulationSourceWrapper<double>> sources) {
  15. _depthModulationSources = sources;
  16. }
  17. void setPhaseModulationSources(std::vector<WECore::ModulationSourceWrapper<double>> sources) {
  18. _phaseModulationSources = sources;
  19. }
  20. private:
  21. CloneableLFO(const CloneableLFO& other) {
  22. _wave = other._wave;
  23. _outputMode = other._outputMode;
  24. _indexOffset = other._indexOffset;
  25. _bypassSwitch = other._bypassSwitch;
  26. _tempoSyncSwitch = other._tempoSyncSwitch;
  27. _phaseSyncSwitch = other._phaseSyncSwitch;
  28. _invertSwitch = other._invertSwitch;
  29. _needsSeekOffsetCalc = other._needsSeekOffsetCalc;
  30. _tempoNumer = other._tempoNumer;
  31. _tempoDenom = other._tempoDenom;
  32. _rawFreq = other._rawFreq;
  33. _rawDepth = other._rawDepth;
  34. _manualPhase = other._manualPhase;
  35. _sampleRate = other._sampleRate;
  36. _bpm = other._bpm;
  37. _wavetablePosition = other._wavetablePosition;
  38. _waveArrayPointer = other._waveArrayPointer;
  39. _cachedOutput = other._cachedOutput;
  40. _freqModulationSources = other._freqModulationSources;
  41. _depthModulationSources = other._depthModulationSources;
  42. _phaseModulationSources = other._phaseModulationSources;
  43. }
  44. };
  45. class CloneableEnvelopeFollower : public WECore::AREnv::AREnvelopeFollowerSquareLaw {
  46. public:
  47. CloneableEnvelopeFollower() : WECore::AREnv::AREnvelopeFollowerSquareLaw() {}
  48. CloneableEnvelopeFollower* clone() const {
  49. return new CloneableEnvelopeFollower(*this);
  50. }
  51. private:
  52. CloneableEnvelopeFollower(const CloneableEnvelopeFollower& other) {
  53. _envVal = other._envVal;
  54. _attackTimeMs = other._attackTimeMs;
  55. _releaseTimeMs = other._releaseTimeMs;
  56. _attackCoef = other._attackCoef;
  57. _releaseCoef = other._releaseCoef;
  58. _filterEnabled = other._filterEnabled;
  59. _lowCutFilter = other._lowCutFilter.clone();
  60. _highCutFilter = other._highCutFilter.clone();
  61. _sampleRate = other._sampleRate;
  62. _cachedOutput = other._cachedOutput;
  63. }
  64. };
  65. }