-
Notifications
You must be signed in to change notification settings - Fork 3
/
PointsEG.h
54 lines (43 loc) · 1.32 KB
/
PointsEG.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <od/objects/Object.h>
#define POINTS_HIGATE_SUSTAIN 1
#define POINTS_HIGATE_LOOP 2
#define POINTS_RETRIGGER_ANALOG 1
#define POINTS_RETRIGGER_DIGITAL 2
class PointsEG : public od::Object
{
public:
PointsEG();
virtual ~PointsEG();
#ifndef SWIGLUA
virtual void process();
od::Parameter mL1{"L1"};
od::Parameter mL2{"L2"};
od::Parameter mL3{"L3"};
od::Parameter mL4{"L4"};
od::Parameter mR1{"R1"};
od::Parameter mR2{"R2"};
od::Parameter mR3{"R3"};
od::Parameter mR4{"R4"};
od::Parameter mC1{"C1",0.0f};
od::Parameter mC2{"C2",0.0f};
od::Parameter mC3{"C3",0.0f};
od::Parameter mC4{"C4",0.0f};
od::Inlet mGate{"Gate"};
od::Outlet mOutput{"Out"};
od::Option mGateHighFlavor{"GateHighFlavor"};
od::Option mRetrigger{"Retrigger",1};
#endif
private:
float next(float r1, float r2, float r3, float r4, float sustain);
// float getSlope(float targetLevel, float currentLevel, float targetRate);
// bool isStageComplete(float slope, float target, float current);
float getCurveValueAtT(float y1, float y2, float y3, float t);
int mStage = 0;
float mCapture = 0.0f;
// float mSlope = 0.0f;
float mCurrentValue = 0.0f;
float mElapsedTime = 0.0f;
// float X1, X2, X3,
float Y1, Y2, Y3 = 0.0f;
// int counter = 0;
};