1 #pragma once
2 #include "SmoothFilter.h"
3 
4 class LFO3PhaseDual {
5 public:
6     void init(double sampleRate);
7 
8     void process(float *outputs[3], unsigned count);
9 
getDepth()10     float getDepth() const { return fDepth; }
setDepth(float value)11     void setDepth(float value) { fDepth = value; }
12 
getDepth1()13     float getDepth1() const { return fRowsLFO[0].depth; }
setDepth1(float value)14     void setDepth1(float value) { fRowsLFO[0].depth = value; }
getDepth2()15     float getDepth2() const { return fRowsLFO[1].depth; }
setDepth2(float value)16     void setDepth2(float value) { fRowsLFO[1].depth = value;}
17 
getRate1()18     float getRate1() const { return fRowsLFO[0].rate; }
setRate1(float value)19     void setRate1(float value) { fRowsLFO[0].rate = value; }
getRate2()20     float getRate2() const { return fRowsLFO[1].rate; }
setRate2(float value)21     void setRate2(float value) { fRowsLFO[1].rate = value;}
22 
getPhase1()23     float getPhase1() const { return fRowsLFO[0].lfos[0].phase; }
getPhase2()24     float getPhase2() const { return fRowsLFO[1].lfos[0].phase; }
25 
26 private:
27     static float getLfoSine(float phase);
28     static float wrapPhase(float phase);
29 
30 private:
31     struct SingleLFO {
32         float phase;
33         float phase0;
34     };
35 
36     struct RowLFOs {
37         float rate;
38         float depth;
39         SingleLFO lfos[3];
40     };
41 
42     float fSampleTime;
43     float fDepth;
44     RowLFOs fRowsLFO[2];
45     SmoothFilter fSmoothOutput[3];
46 };
47