-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathagain.cpp
51 lines (34 loc) · 1.13 KB
/
again.cpp
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
#include "vst3_plugin.h"
//----------------------------------------------------------------------
class myDescriptor : public VST3_Descriptor {
public:
myDescriptor() {
name = "vst3_plugin";
appendParameter( new VST3_Parameter("Gain",1.0f) );
}
};
//----------------------------------------------------------------------
class myInstance : public VST3_Instance {
private:
float MGain = 0.0f;
public:
void on_parameter(uint32_t AIndex, float AValue, uint32_t AMode) final {
switch (AIndex) {
case 0: MGain = AValue; break;
}
}
void on_process(VST3_ProcessContext* AContext) final {
float* in0 = AContext->inputs[0];
float* in1 = AContext->inputs[1];
float* out0 = AContext->outputs[0];
float* out1 = AContext->outputs[1];
uint32_t len = AContext->num_samples;
for (uint32_t i=0; i<len; i++) {
*out0++ = *in0++ * MGain;
*out1++ = *in1++ * MGain;
}
}
};
//----------------------------------------------------------------------
VST3_ENTRYPOINT(myDescriptor,myInstance);
//----------------------------------------------------------------------