aboutsummaryrefslogtreecommitdiffstats
path: root/classes/Bowelyzer.sc
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Bowelyzer.sc')
-rw-r--r--classes/Bowelyzer.sc20
1 files changed, 16 insertions, 4 deletions
diff --git a/classes/Bowelyzer.sc b/classes/Bowelyzer.sc
index 1841cb7..f286587 100644
--- a/classes/Bowelyzer.sc
+++ b/classes/Bowelyzer.sc
@@ -36,12 +36,24 @@ Bowelyzer{
OSCdef.newMatching(
key: \controls,
func: {|msg, time, addr, recvPort|
+ var type = msg[0],
+ name = msg[1],
+ control = msg[2],
+ value = msg[3],
+ value2;
postln("Received: "++msg);
// if the control exists, change it
- if(msg[1].notNil && msg[2].notNil && msg[3].notNil,{
- if(config.config.at(\controls).includesKey(msg[1]),{
- if(config.config.at(\controls).at(msg[1]).includesKey(msg[2]),{
- config.config.at(\controls).at(msg[1]).put(msg[2], config.getControlValue(msg[2], msg[3]));
+ if(name.notNil && control.notNil && value.notNil,{
+ if(config.config.at(\controls).includesKey(name),{
+ if(config.config.at(\controls).at(name).includesKey(control),{
+ if(BowelyzerConfig.hasToBeArray.includes(control), {
+ if(msg[4].notNil, {
+ value2 = msg[4];
+ config.config.at(\controls).at(name).put(control, config.getControlValue(control, [value, value2]));
+ });
+ },{
+ config.config.at(\controls).at(name).put(control, config.getControlValue(control, value));
+ });
});
});
});