-
Notifications
You must be signed in to change notification settings - Fork 0
/
MuFactory.pde
120 lines (112 loc) · 2.33 KB
/
MuFactory.pde
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
void createKnobs(){
int knobRadius = 130;
for(int i = 85; i <= 89; i++){
new CustomKnob(cp5, str(i))
.setPosition(0, 0)
.setColorBackground(color(255, 255, 255, 1))
.setRadius(knobRadius)
.setRange(0, 127)
.setValue(100)
.setStringValue("")
.setVisible(false)
.setLabelVisible(false);
}
// new CustomKnob(cp5, str(98))
// .setPosition(0, 0)
// .setColorBackground(color(255, 255, 255, 1))
// .setRadius(knobRadius)
// .setRange(0, 127)
// .setValue(100)
// .setStringValue("")
// .setVisible(false)
// .setLabelVisible(false);
}
void createGroupKnobs(){
int knobRadius = 130;
for(int i = 90; i <= 99; i++){
new CustomKnob(cp5, str(i))
.setPosition(0, 0)
.setColorBackground(color(255, 255, 255, 1))
.setRadius(knobRadius)
.setRange(0, 127)
.setValue(100)
.setStringValue("")
.setVisible(false)
.setLabelVisible(false);
}
}
MuObject createMuObject(TuioObject tobj){
int id = tobj.getSymbolID();
int cubeId;
//loops
//cube 0 (no icons): 0-5
//cube 1: 16-20
//cube 2: 32-36
//cube 3: 48-52
//cube 4: 64-68
//cube 5: 80-84
//cube 6 (empty):
//cube 7 (big):
//effects + knobs
//generic knobs: 85-89
//bpm - 98
//start - 10
//record - 12
//reverb 90
//volume 91-92
//gate 93
//time 94
//equliazer 97
//delay 99
//generic effect knobs: find some
//instrments
//100 - 107
if(id >= 85 && id <= 89){
return new MuKnob(tobj);
}
else if(id == 90){
return new MuGroupReverbKnob(tobj);
}
else if(id == 91){
return new MuGroupVolumeKnob(tobj);
}
else if(id == 92){
return new MuGroupVolumeKnob(tobj);
}
else if(id == 93){
return new MuGroupGateKnob(tobj);
}
else if(id == 97){
return new MuGroupEqualizerKnob(tobj);
}
else if(id == 99){
return new MuGroupDelayKnob(tobj);
}
else if(id == 10){
return new MuPlay(tobj);
}
else if(id == 11){
return new MuBPM(tobj);
}
else if(id == 12){
return new MuRecord(tobj);
}
else if(id >= 100 && id <= 107){
return new Instrument(tobj, id - 100);
}
else if(id >= 0 && id <= 84){
cubeId = id / 16;
return new MuLoop(tobj, cubeId);
} else {
return new MuKnob(tobj);
}
}
enum MuObjectType {
LOOP,
KNOB,
GROUP_KNOB,
INSTRUMENT,
PLAY,
RECORD,
BPM
};