aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-08-11 12:02:53 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-08-11 12:02:53 +0200
commit2a07aa9f95de385dd79fe3789db79bf7e73d550d (patch)
tree16f18982afdaf794730b2fccc2134f01f44d2572
parent424dd0e4dc3416cc4607f28675b4ff422180c3e5 (diff)
downloadchimaera_sc-2a07aa9f95de385dd79fe3789db79bf7e73d550d.zip
chimaera_sc-2a07aa9f95de385dd79fe3789db79bf7e73d550d.tar.gz
chimaera_sc-2a07aa9f95de385dd79fe3789db79bf7e73d550d.tar.bz2
chimaera_sc-2a07aa9f95de385dd79fe3789db79bf7e73d550d.tar.xz
almost working TCP client mode
-rw-r--r--classes/ChimaeraInDummy.sc4
-rw-r--r--classes/ChimaeraOutSCSynth2F.sc3
-rwxr-xr-xignore/dummy_to_midi.sc10
-rwxr-xr-xignore/dummy_to_scsynth2F.sc62
-rw-r--r--ignore/instruments/2F/pluck_cubic.sc14
5 files changed, 79 insertions, 14 deletions
diff --git a/classes/ChimaeraInDummy.sc b/classes/ChimaeraInDummy.sc
index c573219..e17ce43 100644
--- a/classes/ChimaeraInDummy.sc
+++ b/classes/ChimaeraInDummy.sc
@@ -67,11 +67,11 @@ ChimaeraInDummy : ChimaeraIn {
ignore = true;
} { //time >= lastTime
ignore = false;
- if(time > lastTime) {
+ //if(time > lastTime) { FIXME
engine.end(lastTime);
engine.start(time);
lastTime = time;
- }
+ //}
};
}
}
diff --git a/classes/ChimaeraOutSCSynth2F.sc b/classes/ChimaeraOutSCSynth2F.sc
index 023b9fc..a78c60a 100644
--- a/classes/ChimaeraOutSCSynth2F.sc
+++ b/classes/ChimaeraOutSCSynth2F.sc
@@ -47,7 +47,8 @@ ChimaeraOutSCSynth2F : ChimaeraOut {
if(lag < 0) {
("message late"+(lag*1000)+"ms").postln;
};
- s.listSendBundle(lag, bndl);
+ //s.listSendBundle(lag, bndl);
+ s.listSendBundle(nil, bndl); //FIXME
}
on { |time, sid, gid, pid, x, z| // set callback function for blob on-events
diff --git a/ignore/dummy_to_midi.sc b/ignore/dummy_to_midi.sc
index 34baee8..42d8b49 100755
--- a/ignore/dummy_to_midi.sc
+++ b/ignore/dummy_to_midi.sc
@@ -24,9 +24,7 @@
*/
{
- var hostname, rx, tx, rate, chimconf, chimin, chimout;
-
- hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
+ var rx, tx, rate, chimconf, chimin, chimout;
thisProcess.openUDPPort(3333); // open port 3333 to listen for Tuio messages
thisProcess.openUDPPort(4444); // open port 4444 for listening to chimaera configuration replies
@@ -38,8 +36,12 @@
rate = 3000;
chimconf.sendMsg("/engines/reset");
- chimconf.sendMsg("/engines/address", hostname++":"++3333); // send output stream to port 3333
chimconf.sendMsg("/engines/offset", 0.002);
+
+ chimconf.sendMsg("/engines/enabled", false);
+ chimconf.sendMsg("/engines/server", true);
+ chimconf.sendMsg("/engines/mode", "osc.tcp");
+ chimconf.sendMsg("/engines/enabled", true, {|msg| rx.connect;}); // connect via TCP
chimconf.sendMsg("/sensors/rate", rate);
chimconf.sendMsg("/sensors/group/reset"); // reset groups
diff --git a/ignore/dummy_to_scsynth2F.sc b/ignore/dummy_to_scsynth2F.sc
new file mode 100755
index 0000000..cd4bbdd
--- /dev/null
+++ b/ignore/dummy_to_scsynth2F.sc
@@ -0,0 +1,62 @@
+#!/usr/bin/env sclang
+
+/*
+ * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ */
+
+s.options.blockSize = 0x10;
+s.options.memSize = 0x10000;
+s.latency = nil;
+s.boot;
+
+s.doWhenBooted({
+ var rx, tx, rate, chimconf, chimin, chimout;
+
+ thisProcess.openUDPPort(3333); // open port 3333 to listen for Tuio messages
+ thisProcess.openUDPPort(4444); // open port 4444 for listening to chimaera configuration replies
+
+ rx = NetAddr ("chimaera.local", 3333);
+ tx = NetAddr ("chimaera.local", 4444);
+
+ chimconf = ChimaeraConf(s, tx, tx);
+
+ rate = 3000;
+ chimconf.sendMsg("/engines/reset");
+ chimconf.sendMsg("/engines/offset", 0.002);
+
+ chimconf.sendMsg("/engines/enabled", false);
+ chimconf.sendMsg("/engines/server", true);
+ chimconf.sendMsg("/engines/mode", "osc.tcp");
+ chimconf.sendMsg("/engines/enabled", true, {|msg| rx.connect;}); // connect via TCP
+
+ chimconf.sendMsg("/sensors/rate", rate);
+ chimconf.sendMsg("/sensors/group/reset"); // reset groups
+ 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 = ChimaeraOutSCSynth2F(s, n, [\base, \lead]);
+ chimin = ChimaeraInDummy(s, chimconf, rx, chimout);
+ Routine.run({"./instruments2F.sc".load.value(n);}, clock:AppClock);
+ });
+})
diff --git a/ignore/instruments/2F/pluck_cubic.sc b/ignore/instruments/2F/pluck_cubic.sc
index 84f1022..63c609a 100644
--- a/ignore/instruments/2F/pluck_cubic.sc
+++ b/ignore/instruments/2F/pluck_cubic.sc
@@ -35,13 +35,13 @@
suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
env = Linen.kr(gate, up, 1.0, down);
- //freq = ChimaeraMapLinearCPS.kr(freq, n:n, oct:2);
- //freq = ChimaeraMapStepCPS.kr(freq, n:n, oct:2);
- //freq = ChimaeraMapPolyStepCPS.kr(freq, n:n, oct:2, order:3);
- //freq = ChimaeraMap2ndOrderStepCPS.kr(freq, n:n, oct:2);
- freq = ChimaeraMap3rdOrderStepCPS.kr(freq, n:n, oct:2);
- //freq = ChimaeraMap4thOrderStepCPS.kr(freq, n:n, oct:2);
- //freq = ChimaeraMap5thOrderStepCPS.kr(freq, n:n, oct:2);
+ //freq = ChimaeraMapLinearCPS.kr(freq, n:n, oct:3);
+ //freq = ChimaeraMapStepCPS.kr(freq, n:n, oct:3);
+ //freq = ChimaeraMapPolyStepCPS.kr(freq, n:n, oct:3, order:3);
+ //freq = ChimaeraMap2ndOrderStepCPS.kr(freq, n:n, oct:3);
+ freq = ChimaeraMap3rdOrderStepCPS.kr(freq, n:n, oct:3);
+ //freq = ChimaeraMap4thOrderStepCPS.kr(freq, n:n, oct:3);
+ //freq = ChimaeraMap5thOrderStepCPS.kr(freq, n:n, oct:3);
vol = LinExp.kr(amp, 0.0, 1.0, 0.5, 1.0);
sig = Pluck.ar(WhiteNoise.ar(0.1), gate, 1, freq.reciprocal, 10, 0.20);