aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-03-18 11:46:49 +0100
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-03-18 11:46:49 +0100
commit46bb51132b5ff97ee93c63645b92119fcecfa9d6 (patch)
tree6bc84996449e7af4187de7d8e64acb0197f5ed8c
parent7cf8eab52f4399cbe1b868bd3f6427ce9930a8a1 (diff)
downloadchimaera_sc-46bb51132b5ff97ee93c63645b92119fcecfa9d6.zip
chimaera_sc-46bb51132b5ff97ee93c63645b92119fcecfa9d6.tar.gz
chimaera_sc-46bb51132b5ff97ee93c63645b92119fcecfa9d6.tar.bz2
chimaera_sc-46bb51132b5ff97ee93c63645b92119fcecfa9d6.tar.xz
fix X dim to midi note/range scaling, use recommended directory structure for a compliant Quark
-rw-r--r--Looper/Looper.sc178
-rw-r--r--README.md14
-rw-r--r--classes/ChimaeraCal.sc (renamed from Chimaera/ChimaeraCal.sc)28
-rw-r--r--classes/ChimaeraConf.sc (renamed from Chimaera/ChimaeraConf.sc)0
-rw-r--r--classes/ChimaeraDump.sc (renamed from Chimaera/ChimaeraDump.sc)0
-rw-r--r--classes/ChimaeraGroup.sc (renamed from Chimaera/ChimaeraGroup.sc)0
-rw-r--r--classes/ChimaeraIn.sc (renamed from Chimaera/ChimaeraIn.sc)0
-rw-r--r--classes/ChimaeraInDummy.sc (renamed from Chimaera/ChimaeraInDummy.sc)37
-rw-r--r--classes/ChimaeraInTuio2.sc (renamed from Chimaera/ChimaeraInTuio2.sc)0
-rw-r--r--classes/ChimaeraOut.sc (renamed from Chimaera/ChimaeraOut.sc)0
-rw-r--r--classes/ChimaeraOutMidi.sc (renamed from Chimaera/ChimaeraOutMidi.sc)4
-rw-r--r--classes/ChimaeraOutSCSynth2F.sc (renamed from Chimaera/ChimaeraOutSCSynth2F.sc)0
-rw-r--r--classes/ChimaeraOutSCSynth4F.sc (renamed from Chimaera/ChimaeraOutSCSynth4F.sc)0
-rwxr-xr-xexamples/looper.sc64
-rwxr-xr-xignore/cal_gui.sc (renamed from examples/cal_gui.sc)0
-rwxr-xr-xignore/dummy_to_midi.sc (renamed from examples/dummy_to_midi.sc)5
-rwxr-xr-xignore/dump_gui.sc (renamed from examples/dump_gui.sc)10
-rwxr-xr-xignore/group_gui.sc (renamed from examples/group_gui.sc)0
-rw-r--r--ignore/instruments/2F/anabase.sc (renamed from examples/instruments/2F/anabase.sc)4
-rw-r--r--ignore/instruments/2F/analog.sc (renamed from examples/instruments/2F/analog.sc)4
-rw-r--r--ignore/instruments/2F/blip.sc (renamed from examples/instruments/2F/blip.sc)4
-rw-r--r--ignore/instruments/2F/degree.sc (renamed from examples/instruments/2F/degree.sc)4
-rw-r--r--ignore/instruments/2F/delay1.sc (renamed from examples/instruments/2F/delay1.sc)4
-rw-r--r--ignore/instruments/2F/filter.sc (renamed from examples/instruments/2F/filter.sc)4
-rw-r--r--ignore/instruments/2F/grain.sc (renamed from examples/instruments/2F/grain.sc)4
-rw-r--r--ignore/instruments/2F/harp.sc (renamed from examples/instruments/2F/harp.sc)4
-rw-r--r--ignore/instruments/2F/pluck.sc (renamed from examples/instruments/2F/pluck.sc)4
-rw-r--r--ignore/instruments/2F/sine.sc (renamed from examples/instruments/2F/sine.sc)4
-rw-r--r--ignore/instruments/2F/syncsaw.sc (renamed from examples/instruments/2F/syncsaw.sc)4
-rw-r--r--ignore/instruments/2F/theremin.sc (renamed from examples/instruments/2F/theremin.sc)4
-rw-r--r--ignore/instruments/2F/wind.sc (renamed from examples/instruments/2F/wind.sc)4
-rw-r--r--ignore/instruments/4F/anabase.sc (renamed from examples/instruments/4F/anabase.sc)4
-rw-r--r--ignore/instruments/4F/cello.sc (renamed from examples/instruments/4F/cello.sc)4
-rw-r--r--ignore/instruments/4F/pluck.sc (renamed from examples/instruments/4F/pluck.sc)4
-rw-r--r--ignore/instruments2F.sc (renamed from examples/instruments2F.sc)0
-rw-r--r--ignore/instruments4F.sc (renamed from examples/instruments4F.sc)0
-rwxr-xr-xignore/introspect.sc (renamed from examples/introspect.sc)0
-rwxr-xr-xignore/oscmidi_to_midi.sc (renamed from examples/oscmidi_to_midi.sc)9
-rwxr-xr-xignore/scsynth_to_scsynth2F.sc (renamed from examples/scsynth_to_scsynth2F.sc)9
-rwxr-xr-xignore/scsynth_to_scsynth4F.sc (renamed from examples/scsynth_to_scsynth4F.sc)5
-rwxr-xr-xignore/tuio2_to_midi.sc (renamed from examples/tuio2_to_midi.sc)5
-rwxr-xr-xignore/tuio2_to_scsynth2F.sc (renamed from examples/tuio2_to_scsynth2F.sc)5
-rwxr-xr-xignore/tuio2_to_scsynth4F.sc (renamed from examples/tuio2_to_scsynth4F.sc)5
43 files changed, 131 insertions, 311 deletions
diff --git a/Looper/Looper.sc b/Looper/Looper.sc
deleted file mode 100644
index e19235a..0000000
--- a/Looper/Looper.sc
+++ /dev/null
@@ -1,178 +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.
- */
-
-Looper {
- var buffers, recording, playing;
-
- *new {|s, num, sec|
- ^super.new.init(s, num, sec);
- }
-
- init {|s, num=4, sec=10|
- SynthDef(\looper_record, {|in, bufnum, trigbus, recLevel=1, preLevel=0, loop=0, gate=1|
- var sig, env, trig;
- trig = In.kr(trigbus);
- gate = Latch.kr(gate, trig);
- env = Linen.kr(gate, 0.1, 1, 0.2, doneAction:2);
- sig = In.ar(in) * env;
- RecordBuf.ar(sig, bufnum, offset:0, recLevel:recLevel, preLevel:preLevel, run:gate, loop:loop, trigger:trig);
- }).add;
-
- SynthDef(\looper_play, {|out, bufnum, trigbus, loop=0, gate=1|
- var env, sig, trig;
- trig = In.kr(trigbus);
- gate = Latch.kr(gate, trig);
- env = Linen.kr(gate, 0.1, 1, 0.2, doneAction:2);
- sig = PlayBuf.ar(1, bufnum, rate:1.0, trigger:trig, startPos:0, loop:loop) * env;
- OffsetOut.ar(out, sig);
- }).add;
-
- buffers = Array.fill(num, {Buffer.alloc(s, s.sampleRate*sec, 1)});
- recording = Array.fill(num, nil);
- playing = Array.fill(num, nil);
- }
-
- record {|c, in, trigbus, recLevel=1, preLevel=0, loop=0|
- this.abort(c);
- recording[c] = ( type: \on,
- instrument: \looper_record,
- in: in,
- bufnum: buffers[c].bufnum,
- trigbus: trigbus,
- recLevel: recLevel,
- preLevel: preLevel,
- loop: loop
- ).play
- }
-
- play {|c, out, trigbus, loop=0|
- this.stop(c);
- playing[c] = ( type: \on,
- instrument: \looper_play,
- out: out,
- bufnum: buffers[c].bufnum,
- trigbus: trigbus,
- loop: loop
- ).play;
- }
-
- abort {|c|
- if(recording[c].notNil) {
- ( type: \off,
- id: recording[c].id
- ).play;
- recording[c] = nil;
- }
- }
-
- stop {|c|
- if(playing[c].notNil) {
- ( type: \off,
- id: playing[c].id
- ).play;
- playing[c] = nil;
- }
- }
-
- free {
- //TODO free synths first
- buffers.free;
- recording.free;
- playing.free;
- }
-}
-
-PaceMaker {
- var pace, barRate, beatRate;
-
- *new {|s, out, beatsPerMinute, beatsPerBar|
- ^super.new.init(s, out, beatsPerMinute, beatsPerBar);
- }
-
- init {|s, out, beatsPerMinute=120, beatsPerBar=4|
- SynthDef(\pace_maker, {|barRate, beatRate|
- var bar, beat;
- bar = Impulse.kr(barRate);
- beat = Impulse.kr(beatRate);
- SendReply.kr(bar, '/bar');
- SendReply.kr(beat, '/beat');
- Out.kr(out, [bar, beat]);
- }).add;
-
- beatRate = beatsPerMinute / 60;
- barRate = beatRate / beatsPerBar;
-
- pace = ( type: \on,
- instrument: \pace_maker,
- barRate: barRate,
- beatRate: beatRate
- ).play;
-
- OSCFunc({|msg, time, addr, port|
- "\n".post;
- }, "/bar", nil);
-
- OSCFunc({|msg, time, addr, port|
- ".".post;
- }, "/beat", nil);
- }
-
- free {
- if(pace.notNil) {
- ( type: \free,
- id: pace.id
- ).play;
- }
- }
-
- beatsPerMinute {
- ^(barRate*60);
- }
-
- beatsPerBar {
- ^(beatRate/barRate);
- }
-
- beatsPerMinute_ {|beatsPerMinute|
- var beatsPerBar;
- beatsPerBar = beatRate / barRate;
-
- beatRate = beatsPerMinute / 60;
- barRate = beatRate / beatsPerBar;
-
- ( type: \set,
- id: pace.id,
- barRate: barRate,
- beatRate: beatRate
- ).play;
- }
-
- beatsPerBar_ {|beatsPerBar|
- barRate = beatRate / beatsPerBar;
-
- ( type: \set,
- id: pace.id,
- barRate: barRate
- ).play;
- }
-}
diff --git a/README.md b/README.md
index b09c419..d87cb8f 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,16 @@
# Open Music Kontrollers
## SuperCollider repository
+
+### Install
+
+To install the _Chimaera_ extension, simply copy this folder into your SuperCollider user extension directory directory
+
+ sc3> Platform.userExtensionDir.postln;
+
+or alternatively into the system-wide extension directory.
+
+ sc3> Platform.systemExtensionDir.postln;
+
+### Usage
+
+There are a bunch of examples in the _ignore_ directory which show the usage of the extension classes. Run and adapt them to your needs.
diff --git a/Chimaera/ChimaeraCal.sc b/classes/ChimaeraCal.sc
index 241f0d9..e780b17 100644
--- a/Chimaera/ChimaeraCal.sc
+++ b/classes/ChimaeraCal.sc
@@ -54,24 +54,32 @@ ChimaeraCal {
{ conf.sendMsg("/calibration/start"); },
{ conf.sendMsg("/calibration/zero"); },
{ conf.sendMsg("/calibration/min", {|msg|
- num.visible=true;
- is.string="Sensor #"++msg[0];
- is.visible=true;
+ AppClock.sched(0, {
+ num.visible=true;
+ is.string="Sensor #"++msg[0];
+ is.visible=true;
+ });
})},
{ conf.sendMsg("/calibration/mid", num.value); },
{ conf.sendMsg("/calibration/mid", num.value); },
{ conf.sendMsg("/calibration/mid", num.value, {|msg|
- num.value=1;
- num.visible=false;
+ AppClock.sched(0, {
+ num.value=1;
+ num.visible=false;
+ });
})},
{ conf.sendMsg("/calibration/max", {|msg|
- num.visible=true;
- is.visible=false;
+ AppClock.sched(0, {
+ num.visible=true;
+ is.visible=false;
+ });
})},
{ conf.sendMsg("/calibration/end", num.value, {|msg|
- num.value=0;
- num.visible=false;
- is.visible=false;
+ AppClock.sched(0, {
+ num.value=0;
+ num.visible=false;
+ is.visible=false;
+ });
})},
{ conf.sendMsg("/calibration/save", 0); },
];
diff --git a/Chimaera/ChimaeraConf.sc b/classes/ChimaeraConf.sc
index 17c99d5..17c99d5 100644
--- a/Chimaera/ChimaeraConf.sc
+++ b/classes/ChimaeraConf.sc
diff --git a/Chimaera/ChimaeraDump.sc b/classes/ChimaeraDump.sc
index 3bd25c1..3bd25c1 100644
--- a/Chimaera/ChimaeraDump.sc
+++ b/classes/ChimaeraDump.sc
diff --git a/Chimaera/ChimaeraGroup.sc b/classes/ChimaeraGroup.sc
index 04d1f5a..04d1f5a 100644
--- a/Chimaera/ChimaeraGroup.sc
+++ b/classes/ChimaeraGroup.sc
diff --git a/Chimaera/ChimaeraIn.sc b/classes/ChimaeraIn.sc
index 7cf9d06..7cf9d06 100644
--- a/Chimaera/ChimaeraIn.sc
+++ b/classes/ChimaeraIn.sc
diff --git a/Chimaera/ChimaeraInDummy.sc b/classes/ChimaeraInDummy.sc
index f4f97e4..c573219 100644
--- a/Chimaera/ChimaeraInDummy.sc
+++ b/classes/ChimaeraInDummy.sc
@@ -22,41 +22,56 @@
*/
ChimaeraInDummy : ChimaeraIn {
- var on, off, set, idle, last;
+ var on, off, set, idle, lastTime, ignore;
init {|s, conf, rx, iEngine|
engine = iEngine;
- last = 0;
+ lastTime = 0;
+ ignore = false;
conf.sendMsg("/engines/dummy/enabled", true); // enable dummy output engine
on = OSCFunc({ |msg, time, addr, port|
this.update(time);
- engine.on(time, msg[1], msg[2], msg[3], msg[4], msg[5]);
+ if(ignore.not) {
+ engine.on(time, msg[1], msg[2], msg[3], msg[4], msg[5])
+ };
}, "/on", rx);
off = OSCFunc({ |msg, time, addr, port|
this.update(time);
- engine.off(time, msg[1], msg[2], msg[3]);
+ if(ignore.not) {
+ engine.off(time, msg[1], msg[2], msg[3])
+ };
}, "/off", rx);
set = OSCFunc({ |msg, time, addr, port|
this.update(time);
- engine.set(time, msg[1], msg[2], msg[3], msg[4], msg[5]);
+ if(ignore.not) {
+ engine.set(time, msg[1], msg[2], msg[3], msg[4], msg[5])
+ };
}, "/set", rx);
idle = OSCFunc({ |msg, time, addr, port|
this.update(time);
- engine.idle(time);
+ if(ignore.not) {
+ engine.idle(time);
+ };
}, "/idle", rx);
}
update {|time|
- if(time != last) {
- engine.end(last);
- engine.start(time);
- last = time;
- }
+ if(time < lastTime) {
+ "ignoring out-of-order event".postln;
+ ignore = true;
+ } { //time >= lastTime
+ ignore = false;
+ if(time > lastTime) {
+ engine.end(lastTime);
+ engine.start(time);
+ lastTime = time;
+ }
+ };
}
}
diff --git a/Chimaera/ChimaeraInTuio2.sc b/classes/ChimaeraInTuio2.sc
index 6377f15..6377f15 100644
--- a/Chimaera/ChimaeraInTuio2.sc
+++ b/classes/ChimaeraInTuio2.sc
diff --git a/Chimaera/ChimaeraOut.sc b/classes/ChimaeraOut.sc
index 66945a8..66945a8 100644
--- a/Chimaera/ChimaeraOut.sc
+++ b/classes/ChimaeraOut.sc
diff --git a/Chimaera/ChimaeraOutMidi.sc b/classes/ChimaeraOutMidi.sc
index eaa50fd..12c0def 100644
--- a/Chimaera/ChimaeraOutMidi.sc
+++ b/classes/ChimaeraOutMidi.sc
@@ -33,8 +33,8 @@ ChimaeraOutMidi : ChimaeraOut {
effect = 0x07; // volume
doublePrecision = true;
- bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- ran = n/3 + 1;
+ bot = 3*12 - 0.5 - (n % 18 / 6);
+ ran = n/3;
lookup = Order.new; // lookup table of currently active keys
}
diff --git a/Chimaera/ChimaeraOutSCSynth2F.sc b/classes/ChimaeraOutSCSynth2F.sc
index 023b9fc..023b9fc 100644
--- a/Chimaera/ChimaeraOutSCSynth2F.sc
+++ b/classes/ChimaeraOutSCSynth2F.sc
diff --git a/Chimaera/ChimaeraOutSCSynth4F.sc b/classes/ChimaeraOutSCSynth4F.sc
index 9705d93..9705d93 100644
--- a/Chimaera/ChimaeraOutSCSynth4F.sc
+++ b/classes/ChimaeraOutSCSynth4F.sc
diff --git a/examples/looper.sc b/examples/looper.sc
deleted file mode 100755
index d730326..0000000
--- a/examples/looper.sc
+++ /dev/null
@@ -1,64 +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.
- */
-
-s.boot;
-
-s.doWhenBooted({
- var looper, channel, bar, beat, pacemaker;
-
- bar = 20;
- beat = 21;
- looper = Looper(s, 4, 10);
-
- pacemaker = PaceMaker(s, [bar, beat], 120, 4);
-
- channel = 0;
-
- OSCFunc({|msg, time, addr, port|
- var channel, state;
- channel = msg[1];
- state = msg[2];
- if(state != 0) {
- ("starting recording on channel" ++ channel).postln;
- looper.record(channel, 8, bar);
- } {
- ("stopping recording on channel" ++ channel).postln;
- looper.abort(channel);
- }
- }, "/looper/record", nil, 1212);
-
- OSCFunc({|msg, time, addr, port|
- var channel, state;
- channel = msg[1];
- state = msg[2];
- if(state != 0) {
- ("starting playback on channel" ++ channel).postln;
- looper.play(channel, 0, bar);
- } {
- ("stopping playback on channel" ++ channel).postln;
- looper.stop(channel);
- }
- }, "/looper/play", nil, 1212);
-})
diff --git a/examples/cal_gui.sc b/ignore/cal_gui.sc
index 91778be..91778be 100755
--- a/examples/cal_gui.sc
+++ b/ignore/cal_gui.sc
diff --git a/examples/dummy_to_midi.sc b/ignore/dummy_to_midi.sc
index e20cb7b..f486b95 100755
--- a/examples/dummy_to_midi.sc
+++ b/ignore/dummy_to_midi.sc
@@ -24,7 +24,7 @@
*/
{
- var hostname, rx, tx, chimconf, chimin, chimout;
+ var hostname, rx, tx, rate, chimconf, chimin, chimout;
hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
@@ -36,9 +36,12 @@
chimconf = ChimaeraConf(s, tx, tx);
+ rate = 3000;
chimconf.sendMsg("/engines/reset");
chimconf.sendMsg("/engines/address", hostname++":"++3333); // send output stream to port 3333
+ chimconf.sendMsg("/engines/offset", 1/rate+0.001);
+ 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
diff --git a/examples/dump_gui.sc b/ignore/dump_gui.sc
index 6d924dd..4371489 100755
--- a/examples/dump_gui.sc
+++ b/ignore/dump_gui.sc
@@ -24,7 +24,7 @@
*/
{
- var hostname, rx, tx, chimconf, chimdump;
+ var hostname, rx, tx, rate, chimconf, chimdump;
hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
@@ -36,10 +36,12 @@
chimconf = ChimaeraConf(s, tx, tx);
- 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
+ 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("/sensors/rate", rate);
//chimconf.sendMsg("/calibration/reset"); // uncomment to reset quiescent output
diff --git a/examples/group_gui.sc b/ignore/group_gui.sc
index da1d76e..da1d76e 100755
--- a/examples/group_gui.sc
+++ b/ignore/group_gui.sc
diff --git a/examples/instruments/2F/anabase.sc b/ignore/instruments/2F/anabase.sc
index fbf5f5f..552bd12 100644
--- a/examples/instruments/2F/anabase.sc
+++ b/ignore/instruments/2F/anabase.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
var suicide, up=0.1, down=0.5, env, sig, cutoff;
diff --git a/examples/instruments/2F/analog.sc b/ignore/instruments/2F/analog.sc
index 60f1836..38b9e96 100644
--- a/examples/instruments/2F/analog.sc
+++ b/ignore/instruments/2F/analog.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
var suicide, up=0.1, down=0.5, env, sig, cutoff;
diff --git a/examples/instruments/2F/blip.sc b/ignore/instruments/2F/blip.sc
index b94b439..30766f3 100644
--- a/examples/instruments/2F/blip.sc
+++ b/ignore/instruments/2F/blip.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
var suicide, up=0.1, down=0.5, env, freq2, sig;
diff --git a/examples/instruments/2F/degree.sc b/ignore/instruments/2F/degree.sc
index eb49886..7b70a6b 100644
--- a/examples/instruments/2F/degree.sc
+++ b/ignore/instruments/2F/degree.sc
@@ -30,8 +30,8 @@
{|synthname, n|
var scale, buf;
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
scale = FloatArray[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; // dorian scale
buf = Buffer.alloc(s, scale.size, 1, {|b| b.setnMsg(0, scale) });
diff --git a/examples/instruments/2F/delay1.sc b/ignore/instruments/2F/delay1.sc
index 200705e..872b726 100644
--- a/examples/instruments/2F/delay1.sc
+++ b/ignore/instruments/2F/delay1.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
var suicide, up=0.1, down=0.5, env, sig, trig, trigsplit, delaytimes;
diff --git a/examples/instruments/2F/filter.sc b/ignore/instruments/2F/filter.sc
index b1e335e..a32e49c 100644
--- a/examples/instruments/2F/filter.sc
+++ b/ignore/instruments/2F/filter.sc
@@ -22,8 +22,8 @@
*/
{|synthname, n|
- var bot = 1*12 - 0.5 - (n/3 % 12 / 2);
- var top = n + bot + 1;
+ var bot = 1*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
var suicide, up=0.1, down=0.5, env, sig, cutoff;
diff --git a/examples/instruments/2F/grain.sc b/ignore/instruments/2F/grain.sc
index 5558ae4..22caf76 100644
--- a/examples/instruments/2F/grain.sc
+++ b/ignore/instruments/2F/grain.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
var suicide, up=0.1, down=0.5, env, sig, trig;
diff --git a/examples/instruments/2F/harp.sc b/ignore/instruments/2F/harp.sc
index b878f0c..19e7bef 100644
--- a/examples/instruments/2F/harp.sc
+++ b/ignore/instruments/2F/harp.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
var suicide, up=0.1, down=1.0, env, sig, vol, cut, trig;
diff --git a/examples/instruments/2F/pluck.sc b/ignore/instruments/2F/pluck.sc
index 839ffcc..c756cac 100644
--- a/examples/instruments/2F/pluck.sc
+++ b/ignore/instruments/2F/pluck.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
var suicide, up=0.1, down=1.0, env, sig, vol, cut;
diff --git a/examples/instruments/2F/sine.sc b/ignore/instruments/2F/sine.sc
index c8453b0..b1abd9a 100644
--- a/examples/instruments/2F/sine.sc
+++ b/ignore/instruments/2F/sine.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
var up=0.1, down=0.5, env, suicide, sig;
diff --git a/examples/instruments/2F/syncsaw.sc b/ignore/instruments/2F/syncsaw.sc
index 874f0af..cab1883 100644
--- a/examples/instruments/2F/syncsaw.sc
+++ b/ignore/instruments/2F/syncsaw.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 2*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
var up=0.1, down=0.5, env, suicide, sig, freq2;
diff --git a/examples/instruments/2F/theremin.sc b/ignore/instruments/2F/theremin.sc
index 640a1bd..bf9f9ba 100644
--- a/examples/instruments/2F/theremin.sc
+++ b/ignore/instruments/2F/theremin.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
var up=0.1, down=0.5, env, suicide, sig;
diff --git a/examples/instruments/2F/wind.sc b/ignore/instruments/2F/wind.sc
index ee5639e..fdbf2fa 100644
--- a/examples/instruments/2F/wind.sc
+++ b/ignore/instruments/2F/wind.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
var suicide, up=0.1, down=0.5, env, sig, cutoff;
diff --git a/examples/instruments/4F/anabase.sc b/ignore/instruments/4F/anabase.sc
index a791304..7c5861d 100644
--- a/examples/instruments/4F/anabase.sc
+++ b/ignore/instruments/4F/anabase.sc
@@ -29,8 +29,8 @@
*/
{|synthname, n|
- var bot = 2*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 2*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, freq2=0, amp2=0, p2=0, gate=1, out=0|
var suicide, up=0.1, down=0.5, env, sig, cutoff;
diff --git a/examples/instruments/4F/cello.sc b/ignore/instruments/4F/cello.sc
index e3311bb..ceab462 100644
--- a/examples/instruments/4F/cello.sc
+++ b/ignore/instruments/4F/cello.sc
@@ -22,8 +22,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, freq1=0, amp1=0, p1=0, gate=0, out=0|
var up=0.1, down=0.5, env, suicide, sig, x, y;
diff --git a/examples/instruments/4F/pluck.sc b/ignore/instruments/4F/pluck.sc
index 7e2eaaf..e1a58c2 100644
--- a/examples/instruments/4F/pluck.sc
+++ b/ignore/instruments/4F/pluck.sc
@@ -31,8 +31,8 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var top = n/3 + bot + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var top = n/3 + bot;
SynthDef(synthname, {|freq=0, amp=0, p=0, freq1=0, amp1=0, p1=0, gate=0, out=0|
var suicide, up=0.1, down=5.0, env, sig;
diff --git a/examples/instruments2F.sc b/ignore/instruments2F.sc
index 7267601..7267601 100644
--- a/examples/instruments2F.sc
+++ b/ignore/instruments2F.sc
diff --git a/examples/instruments4F.sc b/ignore/instruments4F.sc
index 430b0eb..430b0eb 100644
--- a/examples/instruments4F.sc
+++ b/ignore/instruments4F.sc
diff --git a/examples/introspect.sc b/ignore/introspect.sc
index 2bbfd07..2bbfd07 100755
--- a/examples/introspect.sc
+++ b/ignore/introspect.sc
diff --git a/examples/oscmidi_to_midi.sc b/ignore/oscmidi_to_midi.sc
index ce5725f..3254178 100755
--- a/examples/oscmidi_to_midi.sc
+++ b/ignore/oscmidi_to_midi.sc
@@ -24,7 +24,7 @@
*/
{
- var hostname, rx, tx, chimconf, midio, func, effect;
+ var hostname, rx, tx, rate, chimconf, midio, func, effect;
hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
@@ -36,9 +36,12 @@
chimconf = ChimaeraConf(s, tx, tx);
+ rate = 3000;
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("/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
@@ -50,8 +53,8 @@
chimconf.sendMsg("/sensors/number", {|msg|
var n=msg[0];
Routine.run({
- var bot = 3*12 - 0.5 - (n/3 % 12 / 2);
- var ran = n/3 + 1;
+ var bot = 3*12 - 0.5 - (n % 18 / 6);
+ var ran = n/3;
chimconf.sendMsg("/engines/oscmidi/offset", bot); // lowest MIDI Note
chimconf.sendMsg("/engines/oscmidi/range", ran); // MIDI Note range
}, clock:AppClock);
diff --git a/examples/scsynth_to_scsynth2F.sc b/ignore/scsynth_to_scsynth2F.sc
index fcf15cc..738f6e7 100755
--- a/examples/scsynth_to_scsynth2F.sc
+++ b/ignore/scsynth_to_scsynth2F.sc
@@ -23,14 +23,16 @@
* distribution.
*/
-//Server.supernova;
+Server.supernova;
s.options.blockSize = 0x10;
s.options.memSize = 0x10000;
s.latency = nil;
s.boot;
s.doWhenBooted({
- var hostname, tx, chimconf, sidOffset, gidOffset;
+ var hostname, tx, chimconf, rate, sidOffset, gidOffset;
+
+ s.addr.connect.debug("connected");
hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
@@ -43,9 +45,12 @@ s.doWhenBooted({
chimconf = ChimaeraConf(s, tx, tx);
+ rate = 3000;
chimconf.sendMsg("/engines/reset");
chimconf.sendMsg("/engines/address", hostname++":"++s.addr.port); // send output stream to port 3333
+ chimconf.sendMsg("/engines/offset", 1/rate+0.001);
+ 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
diff --git a/examples/scsynth_to_scsynth4F.sc b/ignore/scsynth_to_scsynth4F.sc
index 9325a7f..ef5b664 100755
--- a/examples/scsynth_to_scsynth4F.sc
+++ b/ignore/scsynth_to_scsynth4F.sc
@@ -30,7 +30,7 @@ s.latency = nil;
s.boot;
s.doWhenBooted({
- var hostname, tx, chimconf, sidOffset, gidOffset, grp;
+ var hostname, tx, chimconf, rate, sidOffset, gidOffset, grp;
hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
@@ -45,9 +45,12 @@ s.doWhenBooted({
chimconf = ChimaeraConf(s, tx, tx);
+ rate = 3000;
chimconf.sendMsg("/engines/reset");
chimconf.sendMsg("/engines/address", hostname++":"++s.addr.port); // send output stream to port 3333
+ chimconf.sendMsg("/engines/offset", 1/rate+0.001);
+ 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
diff --git a/examples/tuio2_to_midi.sc b/ignore/tuio2_to_midi.sc
index 4afdbb9..e109839 100755
--- a/examples/tuio2_to_midi.sc
+++ b/ignore/tuio2_to_midi.sc
@@ -24,7 +24,7 @@
*/
{
- var hostname, rx, tx, chimconf, chimin, chimout;
+ var hostname, rx, tx, chimconf, rate, chimin, chimout;
hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
@@ -36,9 +36,12 @@
chimconf = ChimaeraConf(s, tx, tx);
+ rate = 3000;
chimconf.sendMsg("/engines/reset");
chimconf.sendMsg("/engines/address", hostname++":"++3333); // send output stream to port 3333
+ chimconf.sendMsg("/engines/offset", 1/rate+0.001);
+ 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
diff --git a/examples/tuio2_to_scsynth2F.sc b/ignore/tuio2_to_scsynth2F.sc
index ffe45af..3cb518c 100755
--- a/examples/tuio2_to_scsynth2F.sc
+++ b/ignore/tuio2_to_scsynth2F.sc
@@ -29,7 +29,7 @@ s.latency = nil;
s.boot;
s.doWhenBooted({
- var hostname, rx, tx, chimconf, chimin, chimout;
+ var hostname, rx, tx, chimconf, rate, chimin, chimout;
hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
@@ -41,9 +41,12 @@ s.doWhenBooted({
chimconf = ChimaeraConf(s, tx, tx);
+ rate = 3000;
chimconf.sendMsg("/engines/reset");
chimconf.sendMsg("/engines/address", hostname++":"++3333); // send output stream to port 3333
+ chimconf.sendMsg("/engines/offset", 1/rate+0.001);
+ 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
diff --git a/examples/tuio2_to_scsynth4F.sc b/ignore/tuio2_to_scsynth4F.sc
index 97c287b..610f095 100755
--- a/examples/tuio2_to_scsynth4F.sc
+++ b/ignore/tuio2_to_scsynth4F.sc
@@ -29,7 +29,7 @@ s.latency = nil;
s.boot;
s.doWhenBooted({
- var hostname, rx, tx, chimconf, chimin, chimout;
+ var hostname, rx, tx, chimconf, rate, chimin, chimout;
hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
@@ -41,9 +41,12 @@ s.doWhenBooted({
chimconf = ChimaeraConf(s, tx, tx);
+ rate = 3000;
chimconf.sendMsg("/engines/reset");
chimconf.sendMsg("/engines/address", hostname++":"++3333); // send output stream to port 3333
+ chimconf.sendMsg("/engines/offset", 1/rate+0.001);
+ 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