aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-05-21 19:00:30 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-05-21 19:00:30 +0200
commit07ce974f65f09877e9e422ed43fb022791bec006 (patch)
tree889bea217487a8c24d4708a58f8f211e039c2059
parent0d52ccd4b5723a073efea6d264f629cf4a27f385 (diff)
downloadchimaera_sc-07ce974f65f09877e9e422ed43fb022791bec006.zip
chimaera_sc-07ce974f65f09877e9e422ed43fb022791bec006.tar.gz
chimaera_sc-07ce974f65f09877e9e422ed43fb022791bec006.tar.bz2
chimaera_sc-07ce974f65f09877e9e422ed43fb022791bec006.tar.xz
update to new oscquery
-rw-r--r--classes/ChimaeraConf.sc4
-rw-r--r--classes/ChimaeraGroup.sc40
-rwxr-xr-xignore/cal_gui.sc2
-rwxr-xr-xignore/dummy_to_midi.sc4
-rwxr-xr-xignore/dump_gui.sc4
-rwxr-xr-xignore/introspect.sc93
-rwxr-xr-xignore/oscmidi_to_midi.sc4
-rwxr-xr-xignore/scsynth_to_scsynth2F.sc8
-rwxr-xr-xignore/scsynth_to_scsynth4F.sc8
-rwxr-xr-xignore/tuio2_to_midi.sc4
-rwxr-xr-xignore/tuio2_to_scsynth2F.sc4
-rwxr-xr-xignore/tuio2_to_scsynth4F.sc4
12 files changed, 90 insertions, 89 deletions
diff --git a/classes/ChimaeraConf.sc b/classes/ChimaeraConf.sc
index 17c99d5..88679bb 100644
--- a/classes/ChimaeraConf.sc
+++ b/classes/ChimaeraConf.sc
@@ -22,7 +22,6 @@
*/
ChimaeraConf {
- classvar <south, <north, <both;
var tx, rx, count, success, fail, cb;
*new {|s, iTx, iRx|
@@ -30,9 +29,6 @@ ChimaeraConf {
}
*initClass {
- south = 0x80;
- north = 0x100;
- both = 0x180;
}
initConn {|iTx, iRx|
diff --git a/classes/ChimaeraGroup.sc b/classes/ChimaeraGroup.sc
index 04d1f5a..7448950 100644
--- a/classes/ChimaeraGroup.sc
+++ b/classes/ChimaeraGroup.sc
@@ -32,35 +32,31 @@ ChimaeraGroup {
//TODO
}
- get {|i|
- config.sendMsg("/sensor/group/attributes", i, {|msg|
- var gid = msg[0];
- var pid = msg[1];
- var x0 = msg[2];
- var x1 = msg[3];
- var no = pid & 0x100 == 0x100;
- var so = pid & 0x80 == 0x80;
+ get {|gid|
+ config.sendMsg("/sensors/group/attributes/"++gid, {|msg|
+ var x0 = msg[0];
+ var x1 = msg[1];
+ var no = msg[2].asBoolean;
+ var so = msg[3].asBoolean;
var s = msg[4].asBoolean;
Routine.run({
- range[i].lo = x0;
- range[i].hi = x1;
- north[i].value = no;
- south[i].value = so;
- scale[i].value = s;
+ range[gid].lo = x0;
+ range[gid].hi = x1;
+ north[gid].value = no;
+ south[gid].value = so;
+ scale[gid].value = s;
}, clock:AppClock);
});
}
- set {|i|
- var gid = i;
- var pid = 0;
- var x0 = range[i].lo;
- var x1 = range[i].hi;
- var s = scale[i].value;
- if(north[i].value) {pid = pid | 0x100};
- if(south[i].value) {pid = pid | 0x080};
- config.sendMsg("/sensor/group/attributes", gid, pid, x0, x1, s);
+ set {|gid|
+ var x0 = range[gid].lo;
+ var x1 = range[gid].hi;
+ var no = north[gid].value;
+ var so = south[gid].value;
+ var s = scale[gid].value;
+ config.sendMsg("/sensors/group/attributes/"++gid, x0, x1, no, so, s);
}
init {|s, conf, rx|
diff --git a/ignore/cal_gui.sc b/ignore/cal_gui.sc
index 6cee6a3..c340e0c 100755
--- a/ignore/cal_gui.sc
+++ b/ignore/cal_gui.sc
@@ -38,7 +38,7 @@
chimconf.sendMsg("/engines/enabled", true); // enable output
chimconf.sendMsg("/engines/address", hostname++":"++3333); // send output stream to port 3333
- chimconf.sendMsg("/engines/offset", 0.001); // add 1ms offset to bundle timestamps
+ chimconf.sendMsg("/engines/offset", 0.002); // add 2ms offset to bundle timestamps
chimconf.sendMsg("/engines/reset"); // reset all output engines
chimdump = ChimaeraDump(s, chimconf, rx);
diff --git a/ignore/dummy_to_midi.sc b/ignore/dummy_to_midi.sc
index 9902e6d..34baee8 100755
--- a/ignore/dummy_to_midi.sc
+++ b/ignore/dummy_to_midi.sc
@@ -43,8 +43,8 @@
chimconf.sendMsg("/sensors/rate", rate);
chimconf.sendMsg("/sensors/group/reset"); // reset groups
- chimconf.sendMsg("/sensors/group/attributes", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/sensors/group/attributes", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/0", 0.0, 1.0, false, true, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/1", 0.0, 1.0, true, false, false); // add group
chimconf.sendMsg("/sensors/number", {|msg|
var n = msg[0];
chimout = ChimaeraOutMidi(s, n, [\base, \lead]);
diff --git a/ignore/dump_gui.sc b/ignore/dump_gui.sc
index ffc6d99..655ad9c 100755
--- a/ignore/dump_gui.sc
+++ b/ignore/dump_gui.sc
@@ -39,11 +39,11 @@
rate = 2500;
chimconf.sendMsg("/engines/reset"); // reset all output engines
chimconf.sendMsg("/engines/address", hostname++":"++3333); // send output stream to port 3333
- chimconf.sendMsg("/engines/offset", 1/rate+0.001);
+ chimconf.sendMsg("/engines/offset", 0.002);
chimconf.sendMsg("/sensors/rate", rate);
- //chimconf.sendMsg("/calibration/reset"); // uncomment to reset quiescent output
+ chimconf.sendMsg("/calibration/reset"); // uncomment to reset quiescent output
chimdump = ChimaeraDump(s, chimconf, rx);
}.value;
diff --git a/ignore/introspect.sc b/ignore/introspect.sc
index d8ff735..f20f258 100755
--- a/ignore/introspect.sc
+++ b/ignore/introspect.sc
@@ -77,7 +77,9 @@
items do: {|itm|
var child = path++itm;
dict[child] = view;
- chimconf.sendMsg(child++"!", handleQueryResponse);
+ AppClock.sched(0.1, {
+ chimconf.sendMsg(child++"!", handleQueryResponse);
+ });
}
} {
var arguments = json["arguments"];
@@ -90,7 +92,6 @@
var arr = Order.new();
var hasR = 0;
var hasW = 0;
- var hasX = 0;
if(line%2 == 1) { view.colors = grays; };
line = line+1;
@@ -99,51 +100,71 @@
var type = argv["type"];
var read = false;
var write = false;
- var optional = false;
var description = argv["description"];
var itm;
if(argv["read"] == "true") {read=true};
if(argv["write"] == "true") {write=true};
- if(argv["optional"] == "true") {optional=true};
if(read) {hasR = hasR + 1};
if(write) {hasW = hasW + 1};
- if(optional.not) {hasX = hasX + 1};
switch(type,
"i", {
var range = argv["range"];
- range[0] = range[0].asInt;
- range[1] = range[1].asInt;
- if( (range[0] == 0) && (range[1] == 1) ) {
- itm = CheckBox.new();
+ var values = argv["values"];
+ if(range.notNil, {
+ range[0] = range[0].asInt;
+ range[1] = range[1].asInt;
+ range[2] = range[2].asInt;
+ if( (range[0] == 0) && (range[1] == 1) ) {
+ itm = CheckBox.new();
+ itm.enabled = write;
+ itm.value = range[0];
+ } {
+ itm = NumberBox.new();
+ itm.enabled = write;
+ itm.value = range[0];
+ itm.decimals = 0;
+ itm.clipLo = range[0];
+ itm.clipHi = range[1];
+ };
+ }, if(values.notNil, {
+ itm = NumberBox.new();
itm.enabled = write;
- itm.value = range[0];
- } {
+ }))
+ },
+ "f", {
+ var range = argv["range"];
+ var values = argv["values"];
+ if(range.notNil, {
+ range[0] = range[0].asFloat;
+ range[1] = range[1].asFloat;
+ range[2] = range[2].asFloat;
itm = NumberBox.new();
itm.enabled = write;
itm.value = range[0];
- itm.decimals = 0;
+ itm.decimals = 6;
itm.clipLo = range[0];
itm.clipHi = range[1];
- };
- },
- "f", {
- var range = argv["range"];
- range[0] = range[0].asFloat;
- range[1] = range[1].asFloat;
- itm = NumberBox.new();
- itm.enabled = write;
- itm.value = range[0];
- itm.decimals = 6;
- itm.clipLo = range[0];
- itm.clipHi = range[1];
+ }, if(values.notNil, {
+ itm = NumberBox.new();
+ itm.enabled = write;
+ }))
},
"s", {
- var maxlen = argv["maxlen"].asInt;
- itm = TextField.new();
- itm.enabled = write;
+ var range = argv["range"];
+ var values = argv["values"];
+ if(range.notNil, {
+ range[0] = range[0].asInt;
+ range[1] = range[1].asInt;
+ range[2] = range[2].asInt;
+ itm = TextField.new();
+ itm.enabled = write;
+ }, if(values.notNil, {
+ itm = TextField.new();
+ itm.enabled = write;
+ }))
}
);
fields.add(itm);
@@ -156,19 +177,7 @@
get = view.setView(4, Button.new()).view(4);
get.states = [["get"]];
get.action = {
- var vals = Array.new(hasX);
-
- arr do: {|itm, i|
- if( (arguments[i]["write"] == "true") && (arguments[i]["optional"] == "false") ) {
- switch(arguments[i]["type"],
- "i", {vals.add(itm.value.asInt)},
- "f", {vals.add(itm.value.asFloat)},
- "s", {vals.add(itm.value.asString)}
- );
- };
- };
-
- chimconf.sendMsg(path, vals, {|msg|
+ chimconf.sendMsg(path, {|msg|
AppClock.sched(0, {
arr do: {|itm, i|
switch(arguments[i]["type"],
@@ -183,7 +192,7 @@
get.action.value;
};
- if( (hasW > 0) && (hasW != hasX) ) {
+ if(hasW > 0) {
set = view.setView(5, Button.new()).view(5);
set.states = [["set"]];
set.action = {
@@ -203,7 +212,7 @@
};
};
- if( (hasR == 0) && (hasW == hasX) ) {
+ if( (hasR == 0) && (hasW == 0) ) {
set = view.setView(6, Button.new()).view(6);
set.states = [["call"]];
set.action = { chimconf.sendMsg(path); };
diff --git a/ignore/oscmidi_to_midi.sc b/ignore/oscmidi_to_midi.sc
index 207e36a..3c3ec6f 100755
--- a/ignore/oscmidi_to_midi.sc
+++ b/ignore/oscmidi_to_midi.sc
@@ -43,8 +43,8 @@
chimconf.sendMsg("/sensors/rate", rate);
chimconf.sendMsg("/sensors/group/reset"); // reset groups
- chimconf.sendMsg("/sensors/group/attributes", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/sensors/group/attributes", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/0", 0.0, 1.0, false, true, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/1", 0.0, 1.0, true, false, false); // add group
effect = 0x07; // volume
chimconf.sendMsg("/engines/oscmidi/enabled", true); // enable OSCMidi output engine
diff --git a/ignore/scsynth_to_scsynth2F.sc b/ignore/scsynth_to_scsynth2F.sc
index 144baf0..c691552 100755
--- a/ignore/scsynth_to_scsynth2F.sc
+++ b/ignore/scsynth_to_scsynth2F.sc
@@ -50,12 +50,12 @@ s.doWhenBooted({
chimconf.sendMsg("/sensors/rate", rate);
chimconf.sendMsg("/sensors/group/reset"); // reset groups
- chimconf.sendMsg("/sensors/group/attributes", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/sensors/group/attributes", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/0", 0.0, 1.0, false, true, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/1", 0.0, 1.0, true, false, false); // add group
chimconf.sendMsg("/engines/scsynth/enabled", true); // enable scsynth output engine
- chimconf.sendMsg("/engines/scsynth/attributes", 0, \base, sidOffset, 0+gidOffset, 0, 0, true, true, \addToHead.asInt, false);
- chimconf.sendMsg("/engines/scsynth/attributes", 1, \lead, sidOffset, 1+gidOffset, 1, 0, true, true, \addToHead.asInt, false);
+ chimconf.sendMsg("/engines/scsynth/attributes/0", \base, sidOffset, 0+gidOffset, 0, 0, true, true, \addToHead.asInt, false);
+ chimconf.sendMsg("/engines/scsynth/attributes/1", \lead, sidOffset, 1+gidOffset, 1, 0, true, true, \addToHead.asInt, false);
s.sendMsg('/g_new', 0+gidOffset, \addToHead.asInt, 0);
s.sendMsg('/g_new', 1+gidOffset, \addToHead.asInt, 0);
diff --git a/ignore/scsynth_to_scsynth4F.sc b/ignore/scsynth_to_scsynth4F.sc
index 23df753..bf28d88 100755
--- a/ignore/scsynth_to_scsynth4F.sc
+++ b/ignore/scsynth_to_scsynth4F.sc
@@ -52,12 +52,12 @@ s.doWhenBooted({
chimconf.sendMsg("/sensors/rate", rate);
chimconf.sendMsg("/sensors/group/reset"); // reset groups
- chimconf.sendMsg("/sensors/group/attributes", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/sensors/group/attributes", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/0", 0.0, 1.0, false, true, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/1", 0.0, 1.0, true, false, false); // add group
chimconf.sendMsg("/engines/scsynth/enabled", true); // enable scsynth output engine
- chimconf.sendMsg("/engines/scsynth/attributes", 0, \base, sidOffset, grp, 0, 0, true, true, \addToHead.asInt, false);
- chimconf.sendMsg("/engines/scsynth/attributes", 1, \lead, sidOffset, grp, 0, 3, false, false, \addToHead.asInt, true);
+ chimconf.sendMsg("/engines/scsynth/attributes/0", \base, sidOffset, grp, 0, 0, true, true, \addToHead.asInt, false);
+ chimconf.sendMsg("/engines/scsynth/attributes/1", \lead, sidOffset, grp, 0, 3, false, false, \addToHead.asInt, true);
s.sendMsg('/g_new', grp, \addToHead.asInt, 0);
s.sync;
diff --git a/ignore/tuio2_to_midi.sc b/ignore/tuio2_to_midi.sc
index 4591e2d..3527b83 100755
--- a/ignore/tuio2_to_midi.sc
+++ b/ignore/tuio2_to_midi.sc
@@ -43,8 +43,8 @@
chimconf.sendMsg("/sensors/rate", rate);
chimconf.sendMsg("/sensors/group/reset"); // reset groups
- chimconf.sendMsg("/sensors/group/attributes", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/sensors/group/attributes", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/0", 0.0, 1.0, false, true, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/1", 0.0, 1.0, true, false, false); // add group
chimconf.sendMsg("/sensors/number", {|msg|
var n = msg[0];
chimout = ChimaeraOutMidi(s, n, [\base, \lead]);
diff --git a/ignore/tuio2_to_scsynth2F.sc b/ignore/tuio2_to_scsynth2F.sc
index 9a6b426..a4709bd 100755
--- a/ignore/tuio2_to_scsynth2F.sc
+++ b/ignore/tuio2_to_scsynth2F.sc
@@ -48,8 +48,8 @@ s.doWhenBooted({
chimconf.sendMsg("/sensors/rate", rate);
chimconf.sendMsg("/sensors/group/reset"); // reset groups
- chimconf.sendMsg("/sensors/group/attributes", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/sensors/group/attributes", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/0", 0.0, 1.0, false, true, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/1", 0.0, 1.0, true, false, false); // add group
chimconf.sendMsg("/sensors/number", {|msg|
var n = msg[0];
diff --git a/ignore/tuio2_to_scsynth4F.sc b/ignore/tuio2_to_scsynth4F.sc
index 1473897..e26f4c2 100755
--- a/ignore/tuio2_to_scsynth4F.sc
+++ b/ignore/tuio2_to_scsynth4F.sc
@@ -48,8 +48,8 @@ s.doWhenBooted({
chimconf.sendMsg("/sensors/rate", rate);
chimconf.sendMsg("/sensors/group/reset"); // reset groups
- chimconf.sendMsg("/sensors/group/attributes", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/sensors/group/attributes", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/0", 0.0, 1.0, false, true, false); // add group
+ chimconf.sendMsg("/sensors/group/attributes/1", 0.0, 1.0, true, false, false); // add group
chimconf.sendMsg("/sensors/number", {|msg|
var n = msg[0];