aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2013-12-13 18:16:49 +0100
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2013-12-13 18:16:49 +0100
commitf169fc32352c846f358d744c0329f35e743a70bc (patch)
tree9509ab80794dfb111bbbae312c485f6d45844038
parentb6881951e5e64715ca74e789423057231c8f6f29 (diff)
downloadchimaera_sc-f169fc32352c846f358d744c0329f35e743a70bc.zip
chimaera_sc-f169fc32352c846f358d744c0329f35e743a70bc.tar.gz
chimaera_sc-f169fc32352c846f358d744c0329f35e743a70bc.tar.bz2
chimaera_sc-f169fc32352c846f358d744c0329f35e743a70bc.tar.xz
classification cleanup
-rw-r--r--Chimaera/ChimaeraConf.sc2
-rw-r--r--Chimaera/ChimaeraInDummy.sc8
-rw-r--r--Chimaera/ChimaeraOut.sc6
-rw-r--r--Chimaera/ChimaeraOutMidi.sc7
-rw-r--r--Chimaera/ChimaeraOutSCSynth2F.sc71
-rw-r--r--Chimaera/ChimaeraOutSCSynth4F.sc79
-rw-r--r--Chimaera/ChimaeraTuio2.sc131
-rw-r--r--Looper/Looper.sc11
-rwxr-xr-xexamples/cal_gui.sc (renamed from examples/test_cal_gui.sc)0
-rwxr-xr-xexamples/dummy_to_midi.sc49
-rwxr-xr-xexamples/dump_gui.sc (renamed from examples/test_dump_gui.sc)2
-rw-r--r--examples/engines/midi_2f.sc69
-rw-r--r--examples/engines/scevent_2f.sc79
-rw-r--r--examples/engines/scevent_4f.sc87
-rw-r--r--examples/instruments/2F/anabase.sc (renamed from examples/instruments/2f/anabase.sc)0
-rw-r--r--examples/instruments/2F/analog.sc (renamed from examples/instruments/2f/analog.sc)0
-rw-r--r--examples/instruments/2F/blip.sc (renamed from examples/instruments/2f/blip.sc)0
-rw-r--r--examples/instruments/2F/degree.sc (renamed from examples/instruments/2f/degree.sc)0
-rw-r--r--examples/instruments/2F/delay1.sc (renamed from examples/instruments/2f/delay1.sc)0
-rw-r--r--examples/instruments/2F/filter.sc (renamed from examples/instruments/2f/filter.sc)0
-rw-r--r--examples/instruments/2F/grain.sc (renamed from examples/instruments/2f/grain.sc)0
-rw-r--r--examples/instruments/2F/harp.sc (renamed from examples/instruments/2f/harp.sc)0
-rw-r--r--examples/instruments/2F/pluck.sc (renamed from examples/instruments/2f/pluck.sc)0
-rw-r--r--examples/instruments/2F/sine.sc (renamed from examples/instruments/2f/sine.sc)0
-rw-r--r--examples/instruments/2F/syncsaw.sc (renamed from examples/instruments/2f/syncsaw.sc)0
-rw-r--r--examples/instruments/2F/theremin.sc (renamed from examples/instruments/2f/theremin.sc)0
-rw-r--r--examples/instruments/2F/wind.sc (renamed from examples/instruments/2f/wind.sc)0
-rw-r--r--examples/instruments/4F/anabase.sc (renamed from examples/instruments/4f/anabase.sc)0
-rw-r--r--examples/instruments/4F/cello.sc (renamed from examples/instruments/4f/cello.sc)0
-rw-r--r--examples/instruments/4F/pluck.sc (renamed from examples/instruments/4f/pluck.sc)0
-rw-r--r--examples/instruments2F.sc (renamed from examples/scsynth_instrument_chooser_2f.sc)2
-rw-r--r--examples/instruments4F.sc (renamed from examples/scsynth_instrument_chooser_4f.sc)2
-rwxr-xr-xexamples/looper.sc (renamed from examples/test_looper.sc)4
-rw-r--r--examples/midi_port_chooser.sc50
-rwxr-xr-xexamples/oscmidi_to_midi.sc (renamed from examples/test_oscmidi_engine_midi.sc)26
-rwxr-xr-xexamples/scsynth_to_scsynth2F.sc (renamed from examples/test_tuio2_engine_4f.sc)45
-rwxr-xr-xexamples/scsynth_to_scsynth4F.sc (renamed from examples/test_tuio2_engine_scevent.sc)49
-rw-r--r--examples/templates/single_group.sc29
-rw-r--r--examples/templates/two_groups.sc75
-rw-r--r--examples/templates/two_groups_separate.sc30
-rwxr-xr-xexamples/test_dummy_engine_midi.sc120
-rwxr-xr-xexamples/test_midi_port_chooser.sc28
-rwxr-xr-xexamples/test_scsynth_engine.sc67
-rwxr-xr-xexamples/test_scsynth_engine_4f.sc67
-rwxr-xr-xexamples/test_tuio2_engine_midi.sc69
-rwxr-xr-xexamples/tuio2_to_midi.sc (renamed from examples/test_classification.sc)4
-rwxr-xr-xexamples/tuio2_to_scsynth2F.sc54
-rwxr-xr-xexamples/tuio2_to_scsynth4F.sc54
48 files changed, 387 insertions, 989 deletions
diff --git a/Chimaera/ChimaeraConf.sc b/Chimaera/ChimaeraConf.sc
index c91dcbc..41a518b 100644
--- a/Chimaera/ChimaeraConf.sc
+++ b/Chimaera/ChimaeraConf.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013 Hanspeter Portner (agenthp@users.sf.net)
+ * 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
diff --git a/Chimaera/ChimaeraInDummy.sc b/Chimaera/ChimaeraInDummy.sc
index 798972f..288600e 100644
--- a/Chimaera/ChimaeraInDummy.sc
+++ b/Chimaera/ChimaeraInDummy.sc
@@ -32,22 +32,22 @@ ChimaeraInDummy : ChimaeraIn {
conf.sendMsg("/chimaera/dummy/enabled", true); // enable dummy output engine
on = OSCFunc({ |msg, time, addr, port|
- update(time);
+ this.update(time);
engine.on(time, msg[1], msg[2], msg[3], msg[4], msg[5]);
}, "/on", rx);
off = OSCFunc({ |msg, time, addr, port|
- update(time);
+ this.update(time);
engine.off(time, msg[1], msg[2], msg[3]);
}, "/off", rx);
set = OSCFunc({ |msg, time, addr, port|
- update(time);
+ this.update(time);
engine.set(time, msg[1], msg[2], msg[3], msg[4], msg[5]);
}, "/set", rx);
idle = OSCFunc({ |msg, time, addr, port|
- update(time);
+ this.update(time);
engine.idle(time);
}, "/idle", rx);
}
diff --git a/Chimaera/ChimaeraOut.sc b/Chimaera/ChimaeraOut.sc
index 044d53f..66945a8 100644
--- a/Chimaera/ChimaeraOut.sc
+++ b/Chimaera/ChimaeraOut.sc
@@ -22,15 +22,15 @@
*/
ChimaeraOut {
- *new {|s, n|
- ^super.new.init(s, n);
+ *new {|s, n, groups|
+ ^super.new.init(s, n, groups);
}
*initClass {
//TODO
}
- init {|s, n|
+ init {|s, n, groups|
"init".postln;
}
diff --git a/Chimaera/ChimaeraOutMidi.sc b/Chimaera/ChimaeraOutMidi.sc
index 46bedf7..eaa50fd 100644
--- a/Chimaera/ChimaeraOutMidi.sc
+++ b/Chimaera/ChimaeraOutMidi.sc
@@ -24,7 +24,7 @@
ChimaeraOutMidi : ChimaeraOut {
var midio, <>effect, <>doublePrecision, bot, ran, lookup;
- init {|s, n|
+ init {|s, n, groups|
MIDIClient.init;
//midio = MIDIOut(0, MIDIClient.destinations[0].uid); // use this on MacOS, Windows to connect to the MIDI stream of choice
midio = MIDIOut(0); // use this on Linux, as patching is usually done via ALSA/JACK
@@ -41,6 +41,9 @@ ChimaeraOutMidi : ChimaeraOut {
start { |time|
midio.latency = time - SystemClock.beats;
+ if(midio.latency < 0) {
+ ("message late"+(midio.latency*1000)+"ms").postln;
+ };
}
end { |time|
@@ -50,8 +53,6 @@ ChimaeraOutMidi : ChimaeraOut {
on { |time, sid, gid, pid, x, z| // set callback function for blob on-events
var midikey, cc;
midikey = x*ran+bot;
-
- //(time-SystemClock.beats).postln; //uncomment this to check whether there are late messages (if so, adjust the offset on the device)
lookup[sid] = midikey.round;
midio.noteOn(gid, lookup[sid], 0x7f); // we're using the group id (gid) as MIDI channel number
diff --git a/Chimaera/ChimaeraOutSCSynth2F.sc b/Chimaera/ChimaeraOutSCSynth2F.sc
new file mode 100644
index 0000000..023b9fc
--- /dev/null
+++ b/Chimaera/ChimaeraOutSCSynth2F.sc
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+ChimaeraOutSCSynth2F : ChimaeraOut {
+ var bndl, sidOffset, gidOffset, instruments, s;
+
+ init {|iS, n, groups|
+ instruments = groups;
+ bndl = List.new(32);
+ s = iS;
+
+ gidOffset = 100;
+ sidOffset = 200;
+
+ instruments do: {|v, gid|
+ s.sendMsg('/g_new', gid+gidOffset, \addToHead.asInt, 0);
+ }
+ }
+
+ start { |time|
+ bndl.clear;
+ }
+
+ end { |time|
+ var lag;
+ lag = time - SystemClock.beats;
+ if(lag < 0) {
+ ("message late"+(lag*1000)+"ms").postln;
+ };
+ s.listSendBundle(lag, bndl);
+ }
+
+ on { |time, sid, gid, pid, x, z| // set callback function for blob on-events
+ s.sendMsg('/s_new', instruments[gid], sid+sidOffset, \addToHead, gid+gidOffset, 'out', gid, 'gate', 0);
+ bndl = bndl.add(['/n_set', sid+sidOffset, 0, x, 1, z, 2, pid, 'gate', 1]);
+ }
+
+ off { |time, sid, gid, pid| // set callback function for blob off-events
+ bndl = bndl.add(['/n_set', sid+sidOffset, 'gate', 0]);
+ }
+
+ set { |time, sid, gid, pid, x, z| // set callback function for blob set-events
+ bndl = bndl.add(['/n_set', sid+sidOffset, 0, x, 1, z, 2, pid]);
+ }
+
+ idle { |time|
+ instruments do: {|v, gid|
+ bndl = bndl.add(['/n_set', gid+gidOffset, 'gate', 0]);
+ }
+ }
+}
diff --git a/Chimaera/ChimaeraOutSCSynth4F.sc b/Chimaera/ChimaeraOutSCSynth4F.sc
new file mode 100644
index 0000000..9705d93
--- /dev/null
+++ b/Chimaera/ChimaeraOutSCSynth4F.sc
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+
+ChimaeraOutSCSynth4F : ChimaeraOut {
+ var bndl, sidOffset, gidOffset, instruments, s, grp;
+
+ init {|iS, n, groups|
+ instruments = groups;
+ bndl = List.new(32);
+ s = iS;
+
+ gidOffset = 100;
+ sidOffset = 200;
+
+ grp = 0+gidOffset;
+
+ s.sendMsg('/g_new', grp, \addToHead.asInt, 0);
+ }
+
+ start { |time|
+ bndl.clear;
+ }
+
+ end { |time|
+ var lag;
+ lag = time - SystemClock.beats;
+ if(lag < 0) {
+ ("message late"+(lag*1000)+"ms").postln;
+ };
+ s.listSendBundle(lag, bndl);
+ }
+
+ on { |time, sid, gid, pid, x, z| // set callback function for blob on-events
+ if(gid==0) {
+ s.sendMsg('/s_new', instruments[gid], sid+sidOffset, \addToHead, grp, 'out', gid, 'gate', 0);
+ bndl = bndl.add(['/n_set', sid+sidOffset, 0, x, 1, z, 2, pid, 'gate', 1]);
+ } {
+ bndl = bndl.add(['/n_set', grp, 3, x, 4, z, 5, pid]);
+ };
+ }
+
+ off { |time, sid, gid, pid| // set callback function for blob off-events
+ if(gid==0) {
+ bndl = bndl.add(['/n_set', sid+sidOffset, 'gate', 0]);
+ };
+ }
+
+ set { |time, sid, gid, pid, x, z| // set callback function for blob set-events
+ if(gid==0) {
+ bndl = bndl.add(['/n_set', sid+sidOffset, 0, x, 1, z, 2, pid]);
+ } {
+ bndl = bndl.add(['/n_set', grp, 3, x, 4, z, 5, pid]);
+ };
+ }
+
+ idle { |time|
+ bndl = bndl.add(['/n_set', 0+gidOffset, 'gate', 0]);
+ }
+}
diff --git a/Chimaera/ChimaeraTuio2.sc b/Chimaera/ChimaeraTuio2.sc
deleted file mode 100644
index 50f42d7..0000000
--- a/Chimaera/ChimaeraTuio2.sc
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2012-2013 Hanspeter Portner (agenthp@users.sf.net)
- *
- * 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.
- */
-
-ChimaeraTuio2 {
- classvar first_frame;
- var rx, frm, tok, alv, <>engine, blobs, old_blobs, last_fid, last_time, missing, ignore;
-
- *new {|s, iRx, iEngine|
- ^super.new.init(s, iRx, iEngine);
- }
-
- *classInit {
- first_frame = 1;
- }
-
- initConn {|iRx, iEngine|
- rx = iRx;
- engine = iEngine;
- blobs = Order.new;
- old_blobs = Array.new;
- last_fid = 0;
- last_time = 0;
- missing = 0;
- ignore = false;
-
- // handling tuio messages
- frm = OSCFunc({|msg, time, addr, port|
- var fid, timestamp;
-
- fid = msg[1];
- timestamp = time; //msg[2]; // TODO sclang does not support the OSC timestamp as argument
-
- if(fid != (last_fid+1) ) {
- missing = missing + 1;
- ["message missing", last_fid, fid, missing].postln;
- };
-
- ignore = false;
- if(timestamp < last_time) {
- ["message late", timestamp, last_time].postln;
- ignore = true;
- };
-
- last_fid = fid;
- last_time = timestamp;
-
- if(engine.start.notNil) {engine.start.value(time)};
-
- }, "/tuio2/frm", rx);
-
- tok = OSCFunc({|msg, time, addr, port|
- var o, sid, pid, gid, x, z;
-
- if(ignore == false) {
- sid = msg[1];
- pid = msg[2] & 0xffff;
- gid = msg[3];
- x = msg[4];
- z = msg[5];
- //a = msg[6]; // not used
-
- blobs[sid] = [time, sid, pid, gid, x, z];
- };
- }, "/tuio2/tok", rx);
-
- alv = OSCFunc({|msg, time, addr, port|
- var n, tmp;
-
- if(ignore == false) {
- msg.removeAt(0); // remove /tuio2/alv
-
- n = msg.size;
- if(n==0) {
- if(engine.idle.notNil) {engine.idle.value(time);};
- };
-
- // search for disappeard blobs
- old_blobs do: {|v|
- if(msg.indexOf(v).isNil) {
- if(engine.off.notNil) {engine.off.valueArray(blobs[v])};
- blobs.removeAt(v);
- }
- };
-
- // search for new blobs
- msg do: {|v|
- if(old_blobs.indexOf(v).isNil) {
- if(engine.on.notNil) {engine.on.valueArray(blobs[v])};
- } {
- if(engine.set.notNil) {engine.set.valueArray(blobs[v])};
- };
- };
-
- if(engine.end.notNil) {engine.end.value(time)};
-
- old_blobs = msg;
- };
- }, "/tuio2/alv", rx);
-
- // engine.start {|time| };
- // engine.end {|time| };
- // engine.on {|time, sid, pid, gid, x, z| ["Tuio2 ON:", time, sid, pid, gid, x, z].postln;};
- // engine.off {|time, sid, pid, gid| ["Tuio2 OFF:", time, sid, pid, gid].postln;};
- // engine.set {|time, sid, pid, gid, x, z| ["Tuio2 SET:", time, sid, pid, gid, x, z].postln;};
- // engine.idle {|time| ["Tuio2 IDLE:", time].postln;};
- }
-
- init {|s, iRx, iCb|
- this.initConn(iRx, iCb);
- }
-}
diff --git a/Looper/Looper.sc b/Looper/Looper.sc
index e5c3978..e19235a 100644
--- a/Looper/Looper.sc
+++ b/Looper/Looper.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (agenthp@users.sf.net)
+ * 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
@@ -109,8 +109,8 @@ PaceMaker {
^super.new.init(s, out, beatsPerMinute, beatsPerBar);
}
- init {|s, out, beatsPerMinute=200, beatsPerBar=4|
- SynthDef(\pace_maker, {|out, barRate, beatRate|
+ init {|s, out, beatsPerMinute=120, beatsPerBar=4|
+ SynthDef(\pace_maker, {|barRate, beatRate|
var bar, beat;
bar = Impulse.kr(barRate);
beat = Impulse.kr(beatRate);
@@ -124,17 +124,16 @@ PaceMaker {
pace = ( type: \on,
instrument: \pace_maker,
- out: out,
barRate: barRate,
beatRate: beatRate
).play;
OSCFunc({|msg, time, addr, port|
- "\r".post;
+ "\n".post;
}, "/bar", nil);
OSCFunc({|msg, time, addr, port|
- "|".post;
+ ".".post;
}, "/beat", nil);
}
diff --git a/examples/test_cal_gui.sc b/examples/cal_gui.sc
index bf3e0fa..bf3e0fa 100755
--- a/examples/test_cal_gui.sc
+++ b/examples/cal_gui.sc
diff --git a/examples/dummy_to_midi.sc b/examples/dummy_to_midi.sc
new file mode 100755
index 0000000..0422915
--- /dev/null
+++ b/examples/dummy_to_midi.sc
@@ -0,0 +1,49 @@
+#!/usr/bin/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.
+ */
+
+{
+ var rx, tx, 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);
+
+ chimconf.sendMsg("/chimaera/output/reset");
+
+ chimconf.sendMsg("/chimaera/group/clear"); // clear groups
+ chimconf.sendMsg("/chimaera/group", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/chimaera/group", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/chimaera/sensors", {|msg|
+ var n = msg[0];
+ chimout = ChimaeraOutMidi(s, n, [\base, \lead]);
+ chimout.effect = 0x07;
+ chimout.doublePrecision = true;
+ chimin = ChimaeraInDummy(s, chimconf, rx, chimout);
+ });
+}.value;
diff --git a/examples/test_dump_gui.sc b/examples/dump_gui.sc
index 8aeb539..a84067c 100755
--- a/examples/test_dump_gui.sc
+++ b/examples/dump_gui.sc
@@ -39,7 +39,7 @@
chimconf.sendMsg("/chimaera/output/offset", 0.001); // add 1ms offset to bundle timestamps
chimconf.sendMsg("/chimaera/output/reset"); // reset all output engines
- chimconf.sendMsg("/chimaera/calibration/reset");
+ //chimconf.sendMsg("/chimaera/calibration/reset"); // uncomment to reset quiescent output
chimdump = ChimaeraDump(s, chimconf, rx);
}.value;
diff --git a/examples/engines/midi_2f.sc b/examples/engines/midi_2f.sc
deleted file mode 100644
index 1fb6e40..0000000
--- a/examples/engines/midi_2f.sc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.
- */
-
-{ |midio, bot, ran, effect|
- var lookup = Order.new; // lookup table of currently active keys
-
- (
- start: { |time|
- midio.latency = time - SystemClock.beats;
- },
-
- end: { |time|
- midio.latency = 0;
- },
-
- on: { |time, sid, pid, gid, x, z| // set callback function for blob on-events
- var midikey, cc;
- midikey = x*ran + bot;
- cc = (z*0x3fff).asInteger;
-
- //(time-SystemClock.beats).postln; //uncomment this to check whether there are late messages (if so, adjust the offset on the device)
-
- lookup[sid] = midikey.round;
- midio.noteOn(gid, lookup[sid], 0x7f); // we're using the group id (gid) as MIDI channel number
- midio.bend(gid, midikey-lookup[sid]/ran*0x2000+0x2000); // we're using a pitchbend span of ran*100 cents
- midio.control(gid, effect | 0x20, cc & 0x7f); // effect LSB
- midio.control(gid, effect | 0x00, cc >> 7); // effect MSB
- },
-
- off: { |time, sid, pid, gid| // set callback function for blob off-events
- midio.noteOff(gid, lookup[sid], 0x00);
- lookup[sid] = nil;
- },
-
- set: { |time, sid, pid, gid, x, z| // set callback function for blob set-events
- var midikey, cc;
- midikey = x*ran + bot;
- cc = (z*0x3fff).asInteger;
-
- midio.bend(gid, midikey-lookup[sid]/ran*0x2000+0x2000); // we're using a pitchbend span of ran*100 cents
- midio.control(gid, effect | 0x20, cc & 0x7f); // effect LSB
- midio.control(gid, effect | 0x00, cc >> 7); // effect MSB
- },
-
- idle: { |time|
- midio.allNotesOff(baseID);
- midio.allNotesOff(leadID);
- }
- );
diff --git a/examples/engines/scevent_2f.sc b/examples/engines/scevent_2f.sc
deleted file mode 100644
index 85231f4..0000000
--- a/examples/engines/scevent_2f.sc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.
- */
-
-{ |instruments|
- var bndl = List.new(16);
-
- (
- start: { |time|
- bndl.clear;
- },
-
- end: { |time|
- var lag;
-
- lag = time - SystemClock.beats;
- s.listSendBundle(lag, bndl);
- },
-
- on: { |time, sid, pid, gid, x, z|
- var lag;
-
- sid = sid + 200;
- lag = time - SystemClock.beats;
- //["on", time, sid, lag].postln;
-
- s.sendMsg('/s_new', instruments[gid], sid, \addToHead, 100+gid, 'out', gid, 'gate', 0);
- bndl = bndl.add(['/n_set', sid, 0, x, 1, z, 2, pid, 'gate', 1]);
- },
-
- off: { |time, sid, pid, gid|
- var lag;
-
- sid = sid + 200;
- lag = time - SystemClock.beats;
- //["off", time, sid].postln;
-
- bndl = bndl.add(['/n_set', sid, 'gate', 0]);
- },
-
- set: { |time, sid, pid, gid, x, z|
- var lag;
-
- sid = sid + 200;
- lag = time - SystemClock.beats;
-
- bndl = bndl.add(['/n_set', sid, 0, x, 1, z, 2, pid]);
- },
-
- idle: { |time|
- var lag;
-
- lag = time - SystemClock.beats;
-
- s.sendBundle(lag,
- ['/n_set', baseGrp, 'gate', 0],
- ['/n_set', leadGrp, 'gate', 0]);
- }
- );
-}
diff --git a/examples/engines/scevent_4f.sc b/examples/engines/scevent_4f.sc
deleted file mode 100644
index feee7f0..0000000
--- a/examples/engines/scevent_4f.sc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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.
- */
-
-{ |baseGrp, baseOut|
- var bndl = List.new(16);
-
- (
- start: { |time|
- bndl.clear;
- },
-
- end: { |time|
- var lag;
-
- lag = time - SystemClock.beats;
- s.listSendBundle(lag, bndl);
- },
-
- on: { |time, sid, pid, gid, x, z|
- var lag;
-
- sid = sid + 200;
- lag = time - SystemClock.beats;
- //["on", time, sid, lag].postln;
-
- if(gid==baseOut) {
- s.sendMsg('/s_new', \base, sid, \addToHead, baseGrp, 'out', baseOut, 'gate', 0);
- bndl = bndl.add(['/n_set', sid, 0, x, 1, z, 2, pid, 'gate', 1]);
- } {
- bndl = bndl.add(['/n_set', baseGrp, 3, x, 4, z, 5, pid]);
- };
- },
-
- off: { |time, sid, pid, gid|
- var lag;
-
- sid = sid + 200;
- lag = time - SystemClock.beats;
- //["off", time, sid].postln;
-
- if(gid==baseOut) {
- bndl = bndl.add(['/n_set', sid, 'gate', 0]);
- };
- },
-
- set: { |time, sid, pid, gid, x, z|
- var lag;
-
- sid = sid + 200;
- lag = time - SystemClock.beats;
-
- if(gid==baseOut) {
- bndl = bndl.add(['/n_set', sid, 0, x, 1, z, 2, pid]);
- } {
- bndl = bndl.add(['/n_set', baseGrp, 3, x, 4, z, 5, pid]);
- };
- },
-
- idle: { |time|
- var lag;
-
- lag = time - SystemClock.beats;
-
- s.sendBundle(lag, ['/n_set', baseGrp, 'gate', 0]);
- }
- );
-}
diff --git a/examples/instruments/2f/anabase.sc b/examples/instruments/2F/anabase.sc
index fbf5f5f..fbf5f5f 100644
--- a/examples/instruments/2f/anabase.sc
+++ b/examples/instruments/2F/anabase.sc
diff --git a/examples/instruments/2f/analog.sc b/examples/instruments/2F/analog.sc
index 60f1836..60f1836 100644
--- a/examples/instruments/2f/analog.sc
+++ b/examples/instruments/2F/analog.sc
diff --git a/examples/instruments/2f/blip.sc b/examples/instruments/2F/blip.sc
index b94b439..b94b439 100644
--- a/examples/instruments/2f/blip.sc
+++ b/examples/instruments/2F/blip.sc
diff --git a/examples/instruments/2f/degree.sc b/examples/instruments/2F/degree.sc
index eb49886..eb49886 100644
--- a/examples/instruments/2f/degree.sc
+++ b/examples/instruments/2F/degree.sc
diff --git a/examples/instruments/2f/delay1.sc b/examples/instruments/2F/delay1.sc
index 200705e..200705e 100644
--- a/examples/instruments/2f/delay1.sc
+++ b/examples/instruments/2F/delay1.sc
diff --git a/examples/instruments/2f/filter.sc b/examples/instruments/2F/filter.sc
index b1e335e..b1e335e 100644
--- a/examples/instruments/2f/filter.sc
+++ b/examples/instruments/2F/filter.sc
diff --git a/examples/instruments/2f/grain.sc b/examples/instruments/2F/grain.sc
index 5558ae4..5558ae4 100644
--- a/examples/instruments/2f/grain.sc
+++ b/examples/instruments/2F/grain.sc
diff --git a/examples/instruments/2f/harp.sc b/examples/instruments/2F/harp.sc
index b878f0c..b878f0c 100644
--- a/examples/instruments/2f/harp.sc
+++ b/examples/instruments/2F/harp.sc
diff --git a/examples/instruments/2f/pluck.sc b/examples/instruments/2F/pluck.sc
index 839ffcc..839ffcc 100644
--- a/examples/instruments/2f/pluck.sc
+++ b/examples/instruments/2F/pluck.sc
diff --git a/examples/instruments/2f/sine.sc b/examples/instruments/2F/sine.sc
index c8453b0..c8453b0 100644
--- a/examples/instruments/2f/sine.sc
+++ b/examples/instruments/2F/sine.sc
diff --git a/examples/instruments/2f/syncsaw.sc b/examples/instruments/2F/syncsaw.sc
index daf5f54..daf5f54 100644
--- a/examples/instruments/2f/syncsaw.sc
+++ b/examples/instruments/2F/syncsaw.sc
diff --git a/examples/instruments/2f/theremin.sc b/examples/instruments/2F/theremin.sc
index 640a1bd..640a1bd 100644
--- a/examples/instruments/2f/theremin.sc
+++ b/examples/instruments/2F/theremin.sc
diff --git a/examples/instruments/2f/wind.sc b/examples/instruments/2F/wind.sc
index ee5639e..ee5639e 100644
--- a/examples/instruments/2f/wind.sc
+++ b/examples/instruments/2F/wind.sc
diff --git a/examples/instruments/4f/anabase.sc b/examples/instruments/4F/anabase.sc
index a791304..a791304 100644
--- a/examples/instruments/4f/anabase.sc
+++ b/examples/instruments/4F/anabase.sc
diff --git a/examples/instruments/4f/cello.sc b/examples/instruments/4F/cello.sc
index e3311bb..e3311bb 100644
--- a/examples/instruments/4f/cello.sc
+++ b/examples/instruments/4F/cello.sc
diff --git a/examples/instruments/4f/pluck.sc b/examples/instruments/4F/pluck.sc
index 7e2eaaf..7e2eaaf 100644
--- a/examples/instruments/4f/pluck.sc
+++ b/examples/instruments/4F/pluck.sc
diff --git a/examples/scsynth_instrument_chooser_2f.sc b/examples/instruments2F.sc
index ec9831f..7267601 100644
--- a/examples/scsynth_instrument_chooser_2f.sc
+++ b/examples/instruments2F.sc
@@ -29,7 +29,7 @@
*/
baseInst = Array.new(64);
leadInst = Array.new(64);
- path = "instruments/2f/";
+ path = "./instruments/2F/";
p = PathName(path);
p.filesDo({|n|
var name = n.fileNameWithoutExtension;
diff --git a/examples/scsynth_instrument_chooser_4f.sc b/examples/instruments4F.sc
index b560001..430b0eb 100644
--- a/examples/scsynth_instrument_chooser_4f.sc
+++ b/examples/instruments4F.sc
@@ -28,7 +28,7 @@
* populate instrument name arrays
*/
baseInst = Array.new(64);
- path = "instruments/4f/";
+ path = "./instruments/4F/";
p = PathName(path);
p.filesDo({|n|
var name = n.fileNameWithoutExtension;
diff --git a/examples/test_looper.sc b/examples/looper.sc
index 91bb7b4..d730326 100755
--- a/examples/test_looper.sc
+++ b/examples/looper.sc
@@ -1,7 +1,7 @@
#!/usr/bin/sclang
/*
- * Copyright (c) 2013 Hanspeter Portner (agenthp@users.sf.net)
+ * 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
@@ -32,7 +32,7 @@ s.doWhenBooted({
beat = 21;
looper = Looper(s, 4, 10);
- pacemaker = PaceMaker(s, [bar, beat], 250, 4);
+ pacemaker = PaceMaker(s, [bar, beat], 120, 4);
channel = 0;
diff --git a/examples/midi_port_chooser.sc b/examples/midi_port_chooser.sc
deleted file mode 100644
index 2061ab0..0000000
--- a/examples/midi_port_chooser.sc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.
- */
-
-{
- var srcDict, dstDict, srcPort, dstPort, win, srcDrop, dstDrop;
-
- srcDict = Dictionary.new;
- dstDict = Dictionary.new;
-
- srcPort = Dictionary.new;
- dstPort = Dictionary.new;
-
- MIDIClient.init;
- MIDIClient.sources.do({|endpoint| srcDict[endpoint.name]=endpoint});
- MIDIClient.destinations.do({|endpoint| dstDict[endpoint.name]=endpoint});
-
- win = Window.new("MIDI port", Rect(200,200,400,100)).front;
-
- srcDrop = PopUpMenu(win, Rect(10,10,180,20));
- srcDrop.items = srcDict.keys.asArray;
- srcDrop.action = {|n|
- srcPort[n.item] = MIDIIn(srcDict[n.item].uid);
- };
-
- dstDrop = PopUpMenu(win, Rect(200,10,180,20));
- dstDrop.items = dstDict.keys.asArray;
- dstDrop.action = {|n|
- dstPort[n.item] = MIDIOut(dstDict[n.item].uid);
- };
-}
diff --git a/examples/test_oscmidi_engine_midi.sc b/examples/oscmidi_to_midi.sc
index 79a10ba..33c5a72 100755
--- a/examples/test_oscmidi_engine_midi.sc
+++ b/examples/oscmidi_to_midi.sc
@@ -24,18 +24,22 @@
*/
{
- var rx, tx, chimconf, midio, baseGrp, leadGrp, func, effect;
+ var rx, tx, chimconf, midio, func, effect;
+ thisProcess.openUDPPort(3333); // open port 3333 to listen for Tuio messages
thisProcess.openUDPPort(4444); // open port 4444 for listening to chimaera configuration replies
- tx = NetAddr("chimaera.local", 4444);
+
+ rx = NetAddr ("chimaera.local", 3333);
+ tx = NetAddr ("chimaera.local", 4444);
chimconf = ChimaeraConf(s, tx, tx);
- chimconf.sendMsg("/chimaera/output/enabled", true); // enable output
- chimconf.sendMsg("/chimaera/output/address", "192.168.1.10:3333"); // send output stream to port 3333
- chimconf.sendMsg("/chimaera/output/offset", 0.001); // add 1.2ms offset to bundle timestamps
chimconf.sendMsg("/chimaera/output/reset"); // reset all output engines
+ chimconf.sendMsg("/chimaera/group/clear"); // clear groups
+ chimconf.sendMsg("/chimaera/group", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/chimaera/group", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+
effect = 0x07; // volume
chimconf.sendMsg("/chimaera/sensors", {|msg|
var n=msg[0];
@@ -49,16 +53,6 @@
}, clock:AppClock);
});
- baseGrp = 0;
- leadGrp = 1;
-
- chimconf.sendMsg("/chimaera/group/clear"); // clear groups
- chimconf.sendMsg("/chimaera/group", baseGrp, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/chimaera/group", leadGrp, ChimaeraConf.south, 0.0, 1.0, false); // add group
-
- thisProcess.openUDPPort(3333); // open port 3333 to listen for Tuio messages
- rx = NetAddr("chimaera.local", 3333);
-
MIDIClient.init;
//midio = MIDIOut(0, MIDIClient.destinations[0].uid); // use this on MacOS, Windows to connect to the MIDI stream of choice
midio = MIDIOut(0); // use this on Linux, as patching is usually done via ALSA/JACK
@@ -66,7 +60,7 @@
func = OSCFunc({|msg, time, addr, port|
midio.latency = time - SystemClock.beats;
- if(midio.latency < 0) {("message late" + midio.latency).postln};
+ if(midio.latency < 0) {("message late"+(midio.latency*1000)+"ms").postln};
msg.removeAt(0); // remove path
msg.do({|m|
switch(0x100 + m[1], // int8 -> uint8
diff --git a/examples/test_tuio2_engine_4f.sc b/examples/scsynth_to_scsynth2F.sc
index 9c69501..a9ac60f 100755
--- a/examples/test_tuio2_engine_4f.sc
+++ b/examples/scsynth_to_scsynth2F.sc
@@ -23,44 +23,45 @@
* distribution.
*/
+Server.supernova;
s.options.blockSize = 0x10;
s.options.memSize = 0x10000;
s.latency = nil;
s.boot;
s.doWhenBooted({
- var rx, tx, chimconf, chimtuio2, baseOut, leadOut, baseGrp, event;
+ var rx, tx, chimconf, sidOffset, gidOffset;
+ gidOffset = 100;
+ sidOffset = 200;
+
+ 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);
- chimconf.sendMsg("/chimaera/output/enabled", true); // enable output
- chimconf.sendMsg("/chimaera/output/address", "192.168.1.10:3333"); // send output stream to port 3333
- chimconf.sendMsg("/chimaera/output/offset", 0.002); // add 1ms offset to bundle timestamps
- chimconf.sendMsg("/chimaera/output/reset"); // reset all output engines
+ chimconf.sendMsg("/chimaera/output/reset");
+ chimconf.sendMsg("/chimaera/output/address", "melamori.local:57110");
+
+ chimconf.sendMsg("/chimaera/group/clear"); // clear groups
+ chimconf.sendMsg("/chimaera/group", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/chimaera/group", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/chimaera/tuio2/enabled", true); // enable Tuio output engine
- chimconf.sendMsg("/chimaera/tuio2/long_header", false); // use short Tuio frame header (default)
+ chimconf.sendMsg("/chimaera/scsynth/enabled", true); // enable scsynth output engine
+ chimconf.sendMsg("/chimaera/scsynth/group", 0, \base, sidOffset, 0+gidOffset, 0, 0, true, true, \addToHead.asInt, false);
+ chimconf.sendMsg("/chimaera/scsynth/group", 1, \lead, sidOffset, 1+gidOffset, 1, 0, true, true, \addToHead.asInt, false);
- baseOut = 0;
- leadOut = 1;
- baseGrp = 100 + baseOut;
+ s.sendMsg('/g_new', 0+gidOffset, \addToHead.asInt, 0);
+ s.sendMsg('/g_new', 1+gidOffset, \addToHead.asInt, 0);
+ s.sync;
chimconf.sendMsg("/chimaera/sensors", {|msg|
var n=msg[0];
- "templates/single_group.sc".load.value(baseGrp);
- "../instruments/pluck_4f.sc".load.value(\base, n);
+ Routine.run({
+ "./instruments2F.sc".load.value(n);
+ }, clock:AppClock);
});
-
- chimconf.sendMsg("/chimaera/group/clear"); // clear groups
- chimconf.sendMsg("/chimaera/group", baseOut, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/chimaera/group", leadOut, ChimaeraConf.south, 0.0, 1.0, false); // add group
-
- engine = "../engines/scevent_4f.sc".load.value(baseGrp, baseOut);
-
- thisProcess.openUDPPort(3333); // open port 3333 to listen for Tuio messages
- rx = NetAddr ("chimaera.local", 3333);
- chimtuio2 = ChimaeraTuio2(s, rx, engine);
})
diff --git a/examples/test_tuio2_engine_scevent.sc b/examples/scsynth_to_scsynth4F.sc
index 5dd0fbd..078c287 100755
--- a/examples/test_tuio2_engine_scevent.sc
+++ b/examples/scsynth_to_scsynth4F.sc
@@ -23,50 +23,45 @@
* distribution.
*/
+Server.supernova;
s.options.blockSize = 0x10;
s.options.memSize = 0x10000;
s.latency = nil;
s.boot;
s.doWhenBooted({
- var rx, tx, chimconf, chimtuio2, instruments, baseOut, leadOut, baseGrp, leadGrp, engine;
+ var rx, tx, chimconf, sidOffset, gidOffset, grp;
+ gidOffset = 100;
+ sidOffset = 200;
+ grp = 0+gidOffset;
+
+ 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);
- chimconf.sendMsg("/chimaera/output/enabled", true); // enable output
- chimconf.sendMsg("/chimaera/output/address", "192.168.1.10:3333"); // send output stream to port 3333
- chimconf.sendMsg("/chimaera/output/offset", 0.002); // add 1ms offset to bundle timestamps
- chimconf.sendMsg("/chimaera/output/reset"); // reset all output engines
-
- baseOut = 0;
- leadOut = 1;
- baseGrp = 100 + baseOut;
- leadGrp = 100 + leadOut;
-
- // create groups in sclang
- instruments = Order.new;
- instruments[baseOut] = \base;
- instruments[leadOut] = \lead;
+ chimconf.sendMsg("/chimaera/output/reset");
+ chimconf.sendMsg("/chimaera/output/address", "melamori.local:57110");
chimconf.sendMsg("/chimaera/group/clear"); // clear groups
- chimconf.sendMsg("/chimaera/group", baseOut, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/chimaera/group", leadOut, ChimaeraConf.south, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/chimaera/group", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/chimaera/group", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/chimaera/tuio2/enabled", true); // enable Tuio output engine
- chimconf.sendMsg("/chimaera/tuio2/long_header", false); // use short Tuio frame header (default)
+ chimconf.sendMsg("/chimaera/scsynth/enabled", true); // enable scsynth output engine
+ chimconf.sendMsg("/chimaera/scsynth/group", 0, \base, sidOffset, grp, 0, 0, true, true, \addToHead.asInt, false);
+ chimconf.sendMsg("/chimaera/scsynth/group", 1, \lead, sidOffset, grp, 0, 3, false, false, \addToHead.asInt, true);
+
+ s.sendMsg('/g_new', grp, \addToHead.asInt, 0);
+ s.sync;
chimconf.sendMsg("/chimaera/sensors", {|msg|
var n=msg[0];
- "templates/two_groups_separate.sc".load.value(baseOut, leadOut, baseGrp, leadGrp);
- "scsynth_instrument_chooser_2f.sc".load.value(n);
+ Routine.run({
+ "./instruments4F.sc".load.value(n);
+ }, clock:AppClock);
});
-
- engine = "engines/scevent_2f.sc".load.value(instruments);
-
- thisProcess.openUDPPort(3333); // open port 3333 to listen for Tuio messages
- rx = NetAddr ("chimaera.local", 3333);
- chimtuio2 = ChimaeraTuio2(s, rx, engine);
})
diff --git a/examples/templates/single_group.sc b/examples/templates/single_group.sc
deleted file mode 100644
index 542da14..0000000
--- a/examples/templates/single_group.sc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.
- */
-
-{|baseGrp|
-
- s.sendMsg('/g_new', baseGrp, \addToHead.asInt, 0);
-
- s.sync;
-}
diff --git a/examples/templates/two_groups.sc b/examples/templates/two_groups.sc
deleted file mode 100644
index c656441..0000000
--- a/examples/templates/two_groups.sc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.
- */
-
-{ | baseOut, leadOut, baseGrp, leadGrp|
-
- // create groups in scsynth via events
- s.sendMsg('/g_new', baseGrp, \addToHead.asInt, 0);
- s.sendMsg('/g_new', leadGrp, \addToHead.asInt, 0);
-
- SynthDef(\gain, {|amp=0, pan=0, out=0| // define our synth
- var sig;
- sig = In.ar(out);
- ReplaceOut.ar(out, sig*amp);
- }).add;
-
- SynthDef(\pan, { // define our synth
- var base, lead, sig;
- base = In.ar(baseOut);
- lead = In.ar(leadOut);
- base = Pan2.ar(base, -0.5, 0.3);
- lead = Pan2.ar(lead, 0.5, 0.3);
- sig = base + lead;
- ReplaceOut.ar(0, sig);
- }).add;
-
- s.sync;
-
- // group gains
- (
- type: \on,
- addAction: \addToTail,
- instrument: \gain,
- id: baseGrp+50,
- group: baseGrp,
- out: baseOut,
- amp: 0.5
- ).play;
-
- (
- type: \on,
- addAction: \addToTail,
- instrument: \gain,
- id: leadGrp+50,
- group: leadGrp,
- out: leadOut,
- amp: 1.0
- ).play;
-
- (
- type: \on,
- addAction: \addToTail,
- instrument: \pan,
- group: 0
- ).play;
-}
diff --git a/examples/templates/two_groups_separate.sc b/examples/templates/two_groups_separate.sc
deleted file mode 100644
index d1c14df..0000000
--- a/examples/templates/two_groups_separate.sc
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-
-{ |baseOut, leadOut, baseGrp, leadGrp|
-
- s.sendMsg('/g_new', baseGrp, \addToHead.asInt, 0);
- s.sendMsg('/g_new', leadGrp, \addToHead.asInt, 0);
-
- s.sync;
-}
diff --git a/examples/test_dummy_engine_midi.sc b/examples/test_dummy_engine_midi.sc
deleted file mode 100755
index ff5b5b5..0000000
--- a/examples/test_dummy_engine_midi.sc
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/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.
- */
-
-{
- var rx, tx, chimconf, midio, baseID, leadID, on, off, set, idle, lookup, effect, bot, ran;
-
- thisProcess.openUDPPort(4444); // open port 4444 for listening to chimaera configuration replies
- tx = NetAddr("chimaera.local", 4444);
-
- chimconf = ChimaeraConf(s, tx, tx);
-
- chimconf.sendMsg("/chimaera/output/enabled", true); // enable output
- chimconf.sendMsg("/chimaera/output/address", "192.168.1.10:3333"); // send output stream to port 3333
- chimconf.sendMsg("/chimaera/output/offset", 0.0012); // add 1.2ms offset to bundle timestamps
- chimconf.sendMsg("/chimaera/output/reset"); // reset all output engines
-
- chimconf.sendMsg("/chimaera/dummy/enabled", true); // enable dummy engine
-
- bot = 23.5;
- ran = 49;
- chimconf.sendMsg("/chimaera/sensors", {|msg|
- var n=msg[0];
- Routine.run({
- bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- ran = n/3 + 1;
- }, clock:AppClock);
- });
-
- baseID = 0;
- leadID = 1;
-
- chimconf.sendMsg("/chimaera/group/clear"); // clear groups
- chimconf.sendMsg("/chimaera/group", baseID, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/chimaera/group", leadID, ChimaeraConf.south, 0.0, 1.0, false); // add group
-
- thisProcess.openUDPPort(3333); // open port 3333 to listen for Tuio messages
- rx = NetAddr("chimaera.local", 3333);
-
- MIDIClient.init;
- //midio = MIDIOut(0, MIDIClient.destinations[0].uid); // use this on MacOS, Windows to connect to the MIDI stream of choice
- midio = MIDIOut(0); // use this on Linux, as patching is usually done via ALSA/JACK
- midio.latency = 0; // send MIDI with no delay, instantaneously
-
- lookup = Order.new;
- effect = 0x07; // volume
-
- on = OSCFunc({|msg, time, addr, port|
- var sid, gid, x, y, midikey, bend, cc;
- sid = msg[1];
- gid = msg[2];
- x = msg[4];
- y = msg[5];
-
- midikey = x * ran + bot;
- lookup[sid] = midikey.round;
- bend = midikey - lookup[sid] / ran * 0x2000 + 0x1fff;
- cc = (y*0x3fff).asInteger;
-
- midio.latency = time - SystemClock.beats;
- midio.noteOn(gid, lookup[sid], 0x7f); // we're using the group id (gid) as MIDI channel number
- midio.bend(gid, bend);
- midio.control(gid, effect | 0x20, cc & 0x7f); // effect LSB
- midio.control(gid, effect | 0x00, cc >> 7); // effect MSB
- }, "/on", rx);
-
- off = OSCFunc({|msg, time, addr, port|
- var sid, gid;
- sid = msg[1];
- gid = msg[2];
-
- midio.latency = time - SystemClock.beats;
- midio.noteOff(gid, lookup[sid], 0x00);
- lookup[sid] = nil;
- }, "/off", rx);
-
- set = OSCFunc({|msg, time, addr, port|
- var sid, gid, x, y, midikey, bend, cc;
- sid = msg[1];
- gid = msg[2];
- x = msg[4];
- y = msg[5];
-
- midikey = x * ran + bot;
- bend = midikey - lookup[sid] / ran * 0x2000 + 0x1fff;
- cc = (y*0x3fff).asInteger;
-
- midio.latency = time - SystemClock.beats;
- midio.bend(gid, bend);
- midio.control(gid, effect | 0x20, cc & 0x7f); // effect LSB
- midio.control(gid, effect | 0x00, cc >> 7); // effect MSB
- }, "/set", rx);
-
- idle = OSCFunc({|msg, time, addr, port|
- midio.latency = time - SystemClock.beats;
- midio.allNotesOff(baseID);
- midio.allNotesOff(leadID);
- }, "/idle", rx);
-}.value;
diff --git a/examples/test_midi_port_chooser.sc b/examples/test_midi_port_chooser.sc
deleted file mode 100755
index e1a79f7..0000000
--- a/examples/test_midi_port_chooser.sc
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/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.
- */
-
-{
- "midi_port_chooser.sc".load().value();
-}.value;
diff --git a/examples/test_scsynth_engine.sc b/examples/test_scsynth_engine.sc
deleted file mode 100755
index f1a1f8a..0000000
--- a/examples/test_scsynth_engine.sc
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/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.
- */
-
-Server.supernova;
-s.options.blockSize = 0x10;
-s.options.memSize = 0x10000;
-s.latency = nil;
-s.boot;
-
-s.doWhenBooted({
- var txrx, chimconf, baseOut, leadOut, baseGrp, leadGrp;
-
- thisProcess.openUDPPort(4444);
- txrx = NetAddr("chimaera.local", 4444);
-
- chimconf = ChimaeraConf(s, txrx, txrx);
-
- chimconf.sendMsg("/chimaera/output/enabled", true); // enable output socket on device
- chimconf.sendMsg("/chimaera/output/address", "192.168.1.10:57110"); // send to scsynth port
- chimconf.sendMsg("/chimaera/output/offset", 0.001); // add 1ms offset to bundle timestamps
- chimconf.sendMsg("/chimaera/output/reset"); // reset all output engines
-
- chimconf.sendMsg("/chimaera/interpolation/order", 2); // cubic interpolation
-
- baseOut = 0;
- leadOut = 1;
- baseGrp = 100 + baseOut;
- leadGrp = 100 + leadOut;
-
- chimconf.sendMsg("/chimaera/group/clear"); // clear groups
- chimconf.sendMsg("/chimaera/group", baseOut, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/chimaera/group", leadOut, ChimaeraConf.south, 0.0, 1.0, false); // add group
-
- chimconf.sendMsg("/chimaera/scsynth/enabled", true); // enable scsynth output engine
- chimconf.sendMsg("/chimaera/scsynth/group", baseOut, \base, 200, baseGrp, baseOut, 0, true, true, \addToHead.asInt, false);
- chimconf.sendMsg("/chimaera/scsynth/group", leadOut, \lead, 200, leadGrp, leadOut, 0, true, true, \addToHead.asInt, false);
-
- chimconf.sendMsg("/chimaera/sensors", {|msg|
- var n=msg[0];
- Routine.run({
- "templates/two_groups_separate.sc".load.value(baseOut, leadOut, baseGrp, leadGrp);
- "scsynth_instrument_chooser_2f.sc".load.value(n);
- }, clock:AppClock);
- });
-});
diff --git a/examples/test_scsynth_engine_4f.sc b/examples/test_scsynth_engine_4f.sc
deleted file mode 100755
index d51cb5b..0000000
--- a/examples/test_scsynth_engine_4f.sc
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/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.
- */
-
-Server.supernova;
-s.options.blockSize = 0x10;
-s.options.memSize = 0x10000;
-s.latency = nil;
-s.boot;
-
-s.doWhenBooted({
- var txrx, chimconf, baseOut, leadOut, baseGrp, leadGrp;
-
- thisProcess.openUDPPort(4444);
- txrx = NetAddr("chimaera.local", 4444);
-
- chimconf = ChimaeraConf(s, txrx, txrx);
-
- chimconf.sendMsg("/chimaera/output/enabled", true); // enable output socket on device
- chimconf.sendMsg("/chimaera/output/address", "192.168.1.10:57110"); // send to scsynth port
- chimconf.sendMsg("/chimaera/output/offset", 0.001); // add 1ms offset to bundle timestamps
- chimconf.sendMsg("/chimaera/output/reset"); // reset all output engines
-
- chimconf.sendMsg("/chimaera/interpolation/order", 2); // cubic interpolation
-
- baseOut = 0;
- leadOut = 1;
- baseGrp = 100 + baseOut;
- leadGrp = 100 + leadOut;
-
- chimconf.sendMsg("/chimaera/group/clear"); // clear groups
- chimconf.sendMsg("/chimaera/group", baseOut, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/chimaera/group", leadOut, ChimaeraConf.south, 0.0, 1.0, false); // add group
-
- chimconf.sendMsg("/chimaera/scsynth/enabled", true); // enable scsynth output engine
- chimconf.sendMsg("/chimaera/scsynth/group", baseOut, \base, 200, baseGrp, baseOut, 0, true, true, \addToHead.asInt, false);
- chimconf.sendMsg("/chimaera/scsynth/group", leadOut, \lead, 200, baseGrp, leadOut, 3, false, false, \addToHead.asInt, true);
-
- chimconf.sendMsg("/chimaera/sensors", {|msg|
- var n=msg[0];
- Routine.run({
- "templates/single_group.sc".load.value(baseGrp);
- "scsynth_instrument_chooser_4f.sc".load.value(n);
- }, clock:AppClock);
- });
-});
diff --git a/examples/test_tuio2_engine_midi.sc b/examples/test_tuio2_engine_midi.sc
deleted file mode 100755
index 26ad5fe..0000000
--- a/examples/test_tuio2_engine_midi.sc
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/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.
- */
-
-{
- var rx, tx, chimconf, chimtuio2, midio, lookup, baseID, leadID, effect, bot, ran;
-
- thisProcess.openUDPPort(4444); // open port 4444 for listening to chimaera configuration replies
- tx = NetAddr ("chimaera.local", 4444);
-
- chimconf = ChimaeraConf(s, tx, tx);
-
- bot = 24 - 0.5;
- ran = 48 + 1;
-
- chimconf.sendMsg("/chimaera/sensors", {|msg|
- var n=msg[0];
- bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- ran = n/3 + 1;
- });
-
- chimconf.sendMsg("/chimaera/output/enabled", true); // enable output
- chimconf.sendMsg("/chimaera/output/address", "192.168.1.10:3333"); // send output stream to port 3333
- chimconf.sendMsg("/chimaera/output/offset", 0.0012); // add 1.2ms offset to bundle timestamps
- chimconf.sendMsg("/chimaera/output/reset"); // reset all output engines
-
- chimconf.sendMsg("/chimaera/tuio2/enabled", true); // enable Tuio output engine
- chimconf.sendMsg("/chimaera/tuio2/long_header", false); // use short Tuio frame header (default)
-
- baseID = 0;
- leadID = 1;
-
- chimconf.sendMsg("/chimaera/group/clear"); // clear groups
- chimconf.sendMsg("/chimaera/group", baseID, ChimaeraConf.north, 0.0, 1.0, false); // add group
- chimconf.sendMsg("/chimaera/group", leadID, ChimaeraConf.south, 0.0, 1.0, false); // add group
-
- MIDIClient.init;
- //midio = MIDIOut(0, MIDIClient.destinations[0].uid); // use this on MacOS, Windows to connect to the MIDI stream of choice
- midio = MIDIOut(0); // use this on Linux, as patching is usually done via ALSA/JACK
- midio.latency = 0; // send MIDI with no delay, instantaneously
-
- effect = 0x07; // volume
- engine = "engines/midi_2f.sc".load.value(midio, bot, ran, effect);
-
- thisProcess.openUDPPort(3333); // open port 3333 to listen for Tuio messages
- rx = NetAddr ("chimaera.local", 3333);
- chimtuio2 = ChimaeraTuio2(s, rx, engine);
-}.value;
diff --git a/examples/test_classification.sc b/examples/tuio2_to_midi.sc
index 2d9c313..95ae283 100755
--- a/examples/test_classification.sc
+++ b/examples/tuio2_to_midi.sc
@@ -34,12 +34,14 @@
chimconf = ChimaeraConf(s, tx, tx);
+ chimconf.sendMsg("/chimaera/output/reset");
+
chimconf.sendMsg("/chimaera/group/clear"); // clear groups
chimconf.sendMsg("/chimaera/group", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
chimconf.sendMsg("/chimaera/group", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
chimconf.sendMsg("/chimaera/sensors", {|msg|
var n = msg[0];
- chimout = ChimaeraOutMidi(s, n);
+ chimout = ChimaeraOutMidi(s, n, [\base, \lead]);
chimout.effect = 0x07;
chimout.doublePrecision = true;
chimin = ChimaeraInTuio2(s, chimconf, rx, chimout);
diff --git a/examples/tuio2_to_scsynth2F.sc b/examples/tuio2_to_scsynth2F.sc
new file mode 100755
index 0000000..866e845
--- /dev/null
+++ b/examples/tuio2_to_scsynth2F.sc
@@ -0,0 +1,54 @@
+#!/usr/bin/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, 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);
+
+ chimconf.sendMsg("/chimaera/output/reset");
+
+ chimconf.sendMsg("/chimaera/group/clear"); // clear groups
+ chimconf.sendMsg("/chimaera/group", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/chimaera/group", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+
+ chimconf.sendMsg("/chimaera/sensors", {|msg|
+ var n = msg[0];
+ chimout = ChimaeraOutSCSynth2F(s, n, [\base, \lead]);
+ chimin = ChimaeraInTuio2(s, chimconf, rx, chimout);
+ Routine.run({"./instruments2F.sc".load.value(n);}, clock:AppClock);
+ });
+})
diff --git a/examples/tuio2_to_scsynth4F.sc b/examples/tuio2_to_scsynth4F.sc
new file mode 100755
index 0000000..3a43343
--- /dev/null
+++ b/examples/tuio2_to_scsynth4F.sc
@@ -0,0 +1,54 @@
+#!/usr/bin/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, 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);
+
+ chimconf.sendMsg("/chimaera/output/reset");
+
+ chimconf.sendMsg("/chimaera/group/clear"); // clear groups
+ chimconf.sendMsg("/chimaera/group", 0, ChimaeraConf.north, 0.0, 1.0, false); // add group
+ chimconf.sendMsg("/chimaera/group", 1, ChimaeraConf.south, 0.0, 1.0, false); // add group
+
+ chimconf.sendMsg("/chimaera/sensors", {|msg|
+ var n = msg[0];
+ chimout = ChimaeraOutSCSynth4F(s, n, [\base]);
+ chimin = ChimaeraInTuio2(s, chimconf, rx, chimout);
+ Routine.run({"./instruments4F.sc".load.value(n);}, clock:AppClock);
+ });
+})