-
Notifications
You must be signed in to change notification settings - Fork 9
/
delay.cpp
65 lines (57 loc) · 1.26 KB
/
delay.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
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "delay.h"
#include "magic.h"
int
DelayCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
cmd[2] = 0x05;
memcpy( cmd + 3, model, 2 );
cmd[5] = parm5;
cmd[6] = parm6;
cmd[7] = parm7;
unsigned short magic = magic_values[value];
cmd[9] = magic & 0xff;
cmd[10] = (magic >> 8) & 0xff;
return 0;
}
int
DelayCC::discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
cmd[2] = 0x05;
memcpy( cmd + 3, model, 2 );
cmd[5] = parm5;
cmd[6] = parm6;
cmd[7] = parm7;
cmd[9] = value;
return 0;
}
int
DelayCC::dispatch( int cc, int value, unsigned char *cmd ) {
switch ( cc ) {
case 49:
// Level
return cc49( value, cmd );
break;
case 50:
// Delay Time
return cc50( value, cmd );
break;
case 51:
// Feedback / FFdbk
return cc51( value, cmd );
break;
case 52:
// Brightness / Frequency / Release / RFdbk / Flutter
return cc52( value, cmd );
break;
case 53:
// Attenuation / Resonance / Mode / Stereo / Threshold
// Tone / Brightness / Separation
return cc53( value, cmd );
break;
case 54:
// Input Level / Stereo / Brightness
return cc54( value, cmd );
break;
default:
return 0;
break;
}
}