aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-10-21 20:43:07 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-10-21 20:43:07 +0200
commit647824212f15f19b5297b6a35586d1cbf581c336 (patch)
tree0372d98b3e546e757b6f1c82f170488be0d6d6ce
parent2759e46f49ebd27bd1774eed5bf6d43ed7fe7002 (diff)
downloadchimaera_sc-647824212f15f19b5297b6a35586d1cbf581c336.zip
chimaera_sc-647824212f15f19b5297b6a35586d1cbf581c336.tar.gz
chimaera_sc-647824212f15f19b5297b6a35586d1cbf581c336.tar.bz2
chimaera_sc-647824212f15f19b5297b6a35586d1cbf581c336.tar.xz
major code cleanup
-rw-r--r--classes/ChimaeraInDummy.sc7
-rw-r--r--classes/ChimaeraInTuio2.sc45
-rw-r--r--classes/ChimaeraOut.sc4
-rw-r--r--classes/ChimaeraOutMidi.sc52
-rw-r--r--classes/ChimaeraOutSCSynth2F.sc14
-rw-r--r--classes/ChimaeraOutSCSynth4F.sc31
-rwxr-xr-xignore/custom_to_midi.sc18
-rwxr-xr-xignore/dummy_to_midi.sc4
-rwxr-xr-xignore/dummy_to_scsynth2F.sc2
-rw-r--r--ignore/instruments/2F/anabase.sc28
-rw-r--r--ignore/instruments/2F/analog.sc26
-rw-r--r--ignore/instruments/2F/anamin.sc25
-rw-r--r--ignore/instruments/2F/blip.sc22
-rw-r--r--ignore/instruments/2F/degree.sc28
-rw-r--r--ignore/instruments/2F/delay1.sc53
-rw-r--r--ignore/instruments/2F/filter.sc17
-rw-r--r--ignore/instruments/2F/grain.sc26
-rw-r--r--ignore/instruments/2F/harp.sc52
-rw-r--r--ignore/instruments/2F/pluck.sc28
-rw-r--r--ignore/instruments/2F/pluck_cubic.sc31
-rw-r--r--ignore/instruments/2F/pluck_vlf.sc (renamed from ignore/instruments/2F/vlf_pluck.sc)30
-rw-r--r--ignore/instruments/2F/sine.sc24
-rw-r--r--ignore/instruments/2F/syncsaw.sc24
-rw-r--r--ignore/instruments/2F/theremin.sc24
-rw-r--r--ignore/instruments/2F/wind.sc24
-rw-r--r--ignore/instruments/4F/anabase.sc28
-rw-r--r--ignore/instruments/4F/cello.sc23
-rw-r--r--ignore/instruments/4F/pluck.sc31
-rwxr-xr-xignore/osc_to_scsynth2F.sc5
-rwxr-xr-xignore/oscmidi_to_midi.sc2
-rwxr-xr-xignore/scsynth_to_scsynth2F.sc2
-rwxr-xr-xignore/scsynth_to_scsynth4F.sc3
-rwxr-xr-xignore/tuio2_to_midi.sc8
-rwxr-xr-xignore/tuio2_to_scsynth2F.sc2
-rwxr-xr-xignore/tuio2_to_scsynth4F.sc2
35 files changed, 246 insertions, 499 deletions
diff --git a/classes/ChimaeraInDummy.sc b/classes/ChimaeraInDummy.sc
index af597df..7a606ef 100644
--- a/classes/ChimaeraInDummy.sc
+++ b/classes/ChimaeraInDummy.sc
@@ -28,17 +28,18 @@ ChimaeraInDummy : ChimaeraIn {
engine = iEngine;
conf.sendMsg("/engines/dummy/enabled", true); // enable dummy output engine
+ conf.sendMsg("/engines/dummy/redundancy", false); // disable redundant output
on = OSCFunc({ |msg, time, addr, port|
- engine.on(time, msg[1], msg[2], msg[3], msg[4], msg[5])
+ engine.on(time, msg[1], msg[2], msg[3], msg[4], msg[5]) // sid, gid, pid, x, z
}, "/on", rx);
off = OSCFunc({ |msg, time, addr, port|
- engine.off(time, msg[1], msg[2], msg[3])
+ engine.off(time, msg[1]) // sid
}, "/off", rx);
set = OSCFunc({ |msg, time, addr, port|
- engine.set(time, msg[1], msg[2], msg[3], msg[4], msg[5])
+ engine.set(time, msg[1], msg[2], msg[3]) // sid, x, z
}, "/set", rx);
idle = OSCFunc({ |msg, time, addr, port|
diff --git a/classes/ChimaeraInTuio2.sc b/classes/ChimaeraInTuio2.sc
index 90ea793..a571c9d 100644
--- a/classes/ChimaeraInTuio2.sc
+++ b/classes/ChimaeraInTuio2.sc
@@ -22,7 +22,7 @@
*/
ChimaeraInTuio2 : ChimaeraIn {
- var firstFrame, frm, tok, alv, blobs, blobsOld, lastFid, lastTime, missing, ignore;
+ var firstFrame, frm, tok, alv, blobs, blobsOld, lastFid, lastTime, ignore;
init {|s, conf, rx, iEngine|
engine = iEngine;
@@ -32,7 +32,6 @@ ChimaeraInTuio2 : ChimaeraIn {
blobsOld = Array.new;
lastFid = 0;
lastTime = 0;
- missing = 0;
ignore = false;
conf.sendMsg("/engines/tuio2/enabled", true); // enable Tuio2 output engine
@@ -43,16 +42,12 @@ ChimaeraInTuio2 : ChimaeraIn {
fid = msg[1];
timestamp = time; //msg[2]; // TODO sclang does not support the OSC timestamp as argument
- if(fid != (lastFid+1) ) {
- missing = missing + 1;
- ["message missing", lastFid, fid, missing].postln;
- };
-
- ignore = false;
- if(timestamp < lastTime) {
- ("message late"+((timestamp-lastTime)*1000)+"ms").postln;
+ if( (fid < lastFid) || (timestamp < lastTime), {
+ ["TUIO2 packet missing or late"].postln;
ignore = true;
- };
+ }, {
+ ignore = false;
+ });
lastFid = fid;
lastTime = timestamp;
@@ -61,7 +56,7 @@ ChimaeraInTuio2 : ChimaeraIn {
tok = OSCFunc({ |msg, time, addr, port|
var o, sid, pid, gid, x, z;
- if(ignore == false) {
+ if(ignore == false, {
sid = msg[1];
pid = msg[2] & 0xffff;
gid = msg[3];
@@ -70,41 +65,41 @@ ChimaeraInTuio2 : ChimaeraIn {
//a = msg[6]; // not used
blobs[sid] = [time, sid, gid, pid, x, z];
- };
+ });
}, "/tuio2/tok", rx);
alv = OSCFunc({ |msg, time, addr, port|
var n, tmp;
- if(ignore == false) {
+ if(ignore == false, {
msg.removeAt(0); // remove /tuio2/alv
n = msg.size;
- if(n==0) {
+ if(n==0, {
engine.idle(time);
- };
+ });
// search for disappeard blobs
blobsOld do: {|v|
- if(msg.indexOf(v).isNil) {
+ if(msg.indexOf(v).isNil, {
var b = blobs[v];
- engine.off(b[0], b[1], b[2], b[3]);
+ engine.off(b[0], b[1]); // time, sid
blobs.removeAt(v);
- }
+ });
};
// search for new blobs
msg do: {|v|
var b = blobs[v];
- if(blobsOld.indexOf(v).isNil) {
- engine.on(b[0], b[1], b[2], b[3], b[4], b[5]);
- } {
- engine.set(b[0], b[1], b[2], b[3], b[4], b[5]);
- };
+ if(blobsOld.indexOf(v).isNil, {
+ engine.on(b[0], b[1], b[2], b[3], b[4], b[5]); // time, sid, gid, pid, x, z
+ }, {
+ engine.set(b[0], b[1], b[4], b[5]); // time, sid, x, z
+ });
};
blobsOld = msg;
- };
+ });
}, "/tuio2/alv", rx);
}
}
diff --git a/classes/ChimaeraOut.sc b/classes/ChimaeraOut.sc
index 678e6e8..8460b82 100644
--- a/classes/ChimaeraOut.sc
+++ b/classes/ChimaeraOut.sc
@@ -38,11 +38,11 @@ ChimaeraOut {
"on".postln;
}
- off { |time, sid, gid, pid|
+ off { |time, sid|
"off".postln;
}
- set { |time, sid, gid, pid, x, z|
+ set { |time, sid, x, z|
"set".postln;
}
diff --git a/classes/ChimaeraOutMidi.sc b/classes/ChimaeraOutMidi.sc
index bd8f1b4..f8a57cc 100644
--- a/classes/ChimaeraOutMidi.sc
+++ b/classes/ChimaeraOutMidi.sc
@@ -22,7 +22,7 @@
*/
ChimaeraOutMidi : ChimaeraOut {
- var midio, <>effect, <>doublePrecision, bot, ran, lookup;
+ var midio, <>control, <>doublePrecision, bot, ran, lookup;
init {|s, n, groups|
MIDIClient.init;
@@ -30,65 +30,73 @@ ChimaeraOutMidi : ChimaeraOut {
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
+ control = 0x07; // volume
doublePrecision = true;
- bot = 3*12 - 0.5 - (n % 18 / 6);
+ bot = 2*12 - 0.5 - (n % 18 / 6);
ran = n/3;
lookup = Order.new; // lookup table of currently active keys
}
on { |time, sid, gid, pid, x, z| // set callback function for blob on-events
- var midikey, cc;
+ var midikey, midinote, cc;
- midio.latency = time - SystemClock.beats;
+ midio.latency = time - SystemClock.seconds;
if(midio.latency < 0) { ("message late"+(midio.latency*1000)+"ms").postln; };
midikey = x*ran+bot;
+ midinote = midikey.round;
- 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+0x1fff); // we're using a pitchbend span of ran*100 cents
+ lookup[sid] = [gid, midinote];
+ midio.noteOn(gid, midinote, 0x7f); // we're using the group id (gid) as MIDI channel number
+ midio.bend(gid, midikey-midinote/ran*0x2000+0x1fff); // we're using a pitchbend span of ran*100 cents
if(doublePrecision) {
cc = (z*0x3fff).asInteger;
- midio.control(gid, effect | 0x20, cc & 0x7f); // effect LSB
- midio.control(gid, effect, cc >> 7); // effect MSB
+ midio.control(gid, control | 0x20, cc & 0x7f); // control LSB
+ midio.control(gid, control, cc >> 7); // control MSB
} { // !doublePrecision
cc = (z*0x7f).asInteger;
- midio.control(gid, effect, cc); // effect MSB
+ midio.control(gid, control, cc); // control MSB
}
}
- off { |time, sid, gid, pid| // set callback function for blob off-events
- midio.latency = time - SystemClock.beats;
+ off { |time, sid| // set callback function for blob off-events
+ var midinote, gid;
+
+ midio.latency = time - SystemClock.seconds;
if(midio.latency < 0) { ("message late"+(midio.latency*1000)+"ms").postln; };
- midio.noteOff(gid, lookup[sid], 0x00);
+ gid = lookup[sid][0];
+ midinote = lookup[sid][1];
+
+ midio.noteOff(gid, midinote, 0x00);
lookup[sid] = nil;
}
- set { |time, sid, gid, pid, x, z| // set callback function for blob set-events
- var midikey, cc;
+ set { |time, sid, x, z| // set callback function for blob set-events
+ var midikey, midinote, gid, cc;
- midio.latency = time - SystemClock.beats;
+ midio.latency = time - SystemClock.seconds;
if(midio.latency < 0) { ("message late"+(midio.latency*1000)+"ms").postln; };
midikey = x*ran+bot;
+ gid = lookup[sid][0];
+ midinote = lookup[sid][1];
- midio.bend(gid, midikey-lookup[sid]/ran*0x2000+0x1fff); // we're using a pitchbend span of ran*100 cents
+ midio.bend(gid, midikey-midinote/ran*0x2000+0x1fff); // we're using a pitchbend span of ran*100 cents
if(doublePrecision) {
cc = (z*0x3fff).asInteger;
- midio.control(gid, effect | 0x20, cc & 0x7f); // effect LSB
- midio.control(gid, effect, cc >> 7); // effect MSB
+ midio.control(gid, control | 0x20, cc & 0x7f); // control LSB
+ midio.control(gid, control, cc >> 7); // control MSB
} { // !doublePrecision
cc = (z*0x7f).asInteger;
- midio.control(gid, effect, cc); // effect MSB
+ midio.control(gid, control, cc); // control MSB
}
}
idle { |time|
- midio.latency = time - SystemClock.beats;
+ midio.latency = time - SystemClock.seconds;
if(midio.latency < 0) { ("message late"+(midio.latency*1000)+"ms").postln; };
}
}
diff --git a/classes/ChimaeraOutSCSynth2F.sc b/classes/ChimaeraOutSCSynth2F.sc
index b35c74c..9605bd9 100644
--- a/classes/ChimaeraOutSCSynth2F.sc
+++ b/classes/ChimaeraOutSCSynth2F.sc
@@ -37,29 +37,29 @@ ChimaeraOutSCSynth2F : ChimaeraOut {
}
on { |time, sid, gid, pid, x, z| // set callback function for blob on-events
- var lag = time - SystemClock.beats;
+ var lag = time - SystemClock.seconds;
if(lag < 0) { ("message late"+(lag*1000)+"ms").postln; };
s.sendMsg('/s_new', instruments[gid], sid+sidOffset, \addToHead, gid+gidOffset, 'out', gid, 'gate', 0);
s.sendBundle(lag, ['/n_set', sid+sidOffset, 0, x, 1, z, 2, pid, 'gate', 1]);
}
- off { |time, sid, gid, pid| // set callback function for blob off-events
- var lag = time - SystemClock.beats;
+ off { |time, sid| // set callback function for blob off-events
+ var lag = time - SystemClock.seconds;
if(lag < 0) { ("message late"+(lag*1000)+"ms").postln; };
s.sendBundle(lag, ['/n_set', sid+sidOffset, 'gate', 0]);
}
- set { |time, sid, gid, pid, x, z| // set callback function for blob set-events
- var lag = time - SystemClock.beats;
+ set { |time, sid, x, z| // set callback function for blob set-events
+ var lag = time - SystemClock.seconds;
if(lag < 0) { ("message late"+(lag*1000)+"ms").postln; };
- s.sendBundle(lag, ['/n_set', sid+sidOffset, 0, x, 1, z, 2, pid]);
+ s.sendBundle(lag, ['/n_set', sid+sidOffset, 0, x, 1, z]);
}
idle { |time|
- var lag = time - SystemClock.beats;
+ var lag = time - SystemClock.seconds;
if(lag < 0) { ("message late"+(lag*1000)+"ms").postln; };
instruments do: {|v, gid|
diff --git a/classes/ChimaeraOutSCSynth4F.sc b/classes/ChimaeraOutSCSynth4F.sc
index 73c8bf7..a3a0b1a 100644
--- a/classes/ChimaeraOutSCSynth4F.sc
+++ b/classes/ChimaeraOutSCSynth4F.sc
@@ -22,11 +22,10 @@
*/
ChimaeraOutSCSynth4F : ChimaeraOut {
- var bndl, sidOffset, gidOffset, instruments, s, grp;
+ var sidOffset, gidOffset, instruments, s, grp, lookup;
init {|iS, n, groups|
instruments = groups;
- bndl = List.new(32);
s = iS;
gidOffset = 100;
@@ -35,12 +34,16 @@ ChimaeraOutSCSynth4F : ChimaeraOut {
grp = 0+gidOffset;
s.sendMsg('/g_new', grp, \addToHead.asInt, 0);
+
+ lookup = Order.new; // lookup table of currently active blobs
}
on { |time, sid, gid, pid, x, z| // set callback function for blob on-events
- var lag = time - SystemClock.beats;
+ var lag = time - SystemClock.seconds;
if(lag < 0) { ("message late"+(lag*1000)+"ms").postln; };
+ lookup[sid] = gid;
+
if(gid==0) {
s.sendMsg('/s_new', instruments[gid], sid+sidOffset, \addToHead, grp, 'out', gid, 'gate', 0);
s.sendBundle(lag, ['/n_set', sid+sidOffset, 0, x, 1, z, 2, pid, 'gate', 1]);
@@ -49,28 +52,36 @@ ChimaeraOutSCSynth4F : ChimaeraOut {
};
}
- off { |time, sid, gid, pid| // set callback function for blob off-events
- var lag = time - SystemClock.beats;
+ off { |time, sid| // set callback function for blob off-events
+ var gid;
+ var lag = time - SystemClock.seconds;
if(lag < 0) { ("message late"+(lag*1000)+"ms").postln; };
+
+ gid = lookup[sid];
if(gid==0) {
s.sendBundle(lag, ['/n_set', sid+sidOffset, 'gate', 0]);
};
+
+ lookup[sid] = nil;
}
- set { |time, sid, gid, pid, x, z| // set callback function for blob set-events
- var lag = time - SystemClock.beats;
+ set { |time, sid, x, z| // set callback function for blob set-events
+ var gid;
+ var lag = time - SystemClock.seconds;
if(lag < 0) { ("message late"+(lag*1000)+"ms").postln; };
+
+ gid = lookup[sid];
if(gid==0) {
- s.sendBundle(lag, ['/n_set', sid+sidOffset, 0, x, 1, z, 2, pid]);
+ s.sendBundle(lag, ['/n_set', sid+sidOffset, 0, x, 1, z]);
} {
- s.sendBundle(lag, ['/n_set', grp, 3, x, 4, z, 5, pid]);
+ s.sendBundle(lag, ['/n_set', grp, 3, x, 4, z]);
};
}
idle { |time|
- var lag = time - SystemClock.beats;
+ var lag = time - SystemClock.seconds;
if(lag < 0) { ("message late"+(lag*1000)+"ms").postln; };
s.sendBundle(lag, ['/n_set', 0+gidOffset, 'gate', 0]);
diff --git a/ignore/custom_to_midi.sc b/ignore/custom_to_midi.sc
index fbadb5e..f81011e 100755
--- a/ignore/custom_to_midi.sc
+++ b/ignore/custom_to_midi.sc
@@ -44,11 +44,11 @@
chimconf.sendMsg("/engines/enabled", true, {|msg| rx.connect;}); // connect via TCP
chimconf.sendMsg("/engines/custom/reset");
- chimconf.sendMsg("/engines/custom/append", "on", "/noteOn", "i($g) i(3 12* 0.5- $n 18% 6/- $n 6/+) i(0x7f)");
- chimconf.sendMsg("/engines/custom/append", "off", "/noteOff", "i($g) i(3 12* 0.5- $n 18% 6/- $n 6/+) i(0x7f)");
- chimconf.sendMsg("/engines/custom/append", "set", "/bend", "i($g) i($x 0x3fff*)");
- chimconf.sendMsg("/engines/custom/append", "set", "/control", "i($g) i(0x27) i($z 0x3fff* 0x7f&)");
- chimconf.sendMsg("/engines/custom/append", "set", "/control", "i($g) i(0x07) i($z 0x3fff* 7>>)");
+ chimconf.sendMsg("/engines/custom/append", "on", "/noteOn", "i($g) i(35.5 $n 18% 6/- $n 3/ $x @@ $g[*+) i(0x7f)");
+ chimconf.sendMsg("/engines/custom/append", "off", "/noteOff", "i($g) i(35.5 $n 18% 6/- $n 3/ $g]*+) i(0x7f)");
+ chimconf.sendMsg("/engines/custom/append", "set", "/bend", "i($g) i($x $g]- 0x2000* 0x1fff+)");
+ chimconf.sendMsg("/engines/custom/append", "set", "/control", "i($g) i(0x27) i($z 0x3fff* 0x7f&)");
+ chimconf.sendMsg("/engines/custom/append", "set", "/control", "i($g) i(0x07) i($z 0x3fff* 7>>)");
chimconf.sendMsg("/engines/custom/enabled", true);
@@ -63,28 +63,28 @@
midio.latency = 0; // send MIDI with no delay, instantaneously
on = OSCFunc({|msg, time, addr, port|
- midio.latency = time - SystemClock.beats;
+ midio.latency = time - SystemClock.seconds;
if(midio.latency < 0) {("message late"+(midio.latency*1000)+"ms").postln};
midio.noteOn(msg[1], msg[2], msg[3]);
}, "/noteOn", rx);
off = OSCFunc({|msg, time, addr, port|
- midio.latency = time - SystemClock.beats;
+ midio.latency = time - SystemClock.seconds;
if(midio.latency < 0) {("message late"+(midio.latency*1000)+"ms").postln};
midio.noteOff(msg[1], msg[2], msg[3]);
}, "/noteOff", rx);
bend = OSCFunc({|msg, time, addr, port|
- midio.latency = time - SystemClock.beats;
+ midio.latency = time - SystemClock.seconds;
if(midio.latency < 0) {("message late"+(midio.latency*1000)+"ms").postln};
midio.bend(msg[1], msg[2]);
}, "/bend", rx);
control = OSCFunc({|msg, time, addr, port|
- midio.latency = time - SystemClock.beats;
+ midio.latency = time - SystemClock.seconds;
if(midio.latency < 0) {("message late"+(midio.latency*1000)+"ms").postln};
midio.control(msg[1], msg[2], msg[3]);
diff --git a/ignore/dummy_to_midi.sc b/ignore/dummy_to_midi.sc
index e69e001..addcdfa 100755
--- a/ignore/dummy_to_midi.sc
+++ b/ignore/dummy_to_midi.sc
@@ -36,7 +36,7 @@
rate = 3000;
chimconf.sendMsg("/engines/reset");
- chimconf.sendMsg("/engines/offset", 0.002);
+ chimconf.sendMsg("/engines/offset", 0.0025);
chimconf.sendMsg("/engines/enabled", false);
chimconf.sendMsg("/engines/server", true);
@@ -51,7 +51,7 @@
chimconf.sendMsg("/sensors/number", {|msg|
var n = msg[0];
chimout = ChimaeraOutMidi(s, n, [\base, \lead]);
- chimout.effect = 0x07;
+ chimout.control = 0x07;
chimout.doublePrecision = true;
chimin = ChimaeraInDummy(s, chimconf, rx, chimout);
});
diff --git a/ignore/dummy_to_scsynth2F.sc b/ignore/dummy_to_scsynth2F.sc
index c1586ca..9024917 100755
--- a/ignore/dummy_to_scsynth2F.sc
+++ b/ignore/dummy_to_scsynth2F.sc
@@ -41,7 +41,7 @@ s.doWhenBooted({
rate = 3000;
chimconf.sendMsg("/engines/reset");
- chimconf.sendMsg("/engines/offset", 0.002);
+ chimconf.sendMsg("/engines/offset", 0.0025);
chimconf.sendMsg("/engines/enabled", false);
chimconf.sendMsg("/engines/server", true);
diff --git a/ignore/instruments/2F/anabase.sc b/ignore/instruments/2F/anabase.sc
index 177acd0..b01f14d 100644
--- a/ignore/instruments/2F/anabase.sc
+++ b/ignore/instruments/2F/anabase.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,29 +21,19 @@
* distribution.
*/
-/*
- * low-pass filtered pulse width oscillator
- *
- * x := freq
- * y := cutoff frequency of low-pass filter
- */
-
{|synthname, n|
- var bot = 2*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
- var suicide, up=0.1, down=0.5, env, sig, cutoff;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:2);
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
-
- sig = VarSaw.ar(freq, 0.5, mul:amp*env);
- sig = Blip.ar(freq, amp*20) * sig;
- sig = RLPF.ar(sig, amp*900+100, 0.1);
+ sig = VarSaw.ar(freq, 0.5, mul:y*env);
+ sig = Blip.ar(freq, y*20) * sig;
+ sig = RLPF.ar(sig, y*900+100, 0.1);
sig = FreeVerb.ar(sig);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/analog.sc b/ignore/instruments/2F/analog.sc
index 38b9e96..3854802 100644
--- a/ignore/instruments/2F/analog.sc
+++ b/ignore/instruments/2F/analog.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,30 +21,20 @@
* distribution.
*/
-/*
- * low-pass filtered pulse width oscillator
- *
- * x := freq
- * y := cutoff frequency of low-pass filter
- */
-
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, cutoff, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
- var suicide, up=0.1, down=0.5, env, sig, cutoff;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:2);
+ cutoff = LinExp.kr(y, 0, 1, (1*12).midicps, (7*12).midicps);
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
-
- cutoff = LinExp.kr(amp, 0, 1, (1*12).midicps, (7*12).midicps);
sig = Pulse.ar([freq/2, freq, freq*2, freq*4], 0.2, mul:[0.5, 1, 0.5, 0.25]);
sig = Mix.ar(sig);
- sig = RLPF.ar(sig, cutoff, 0.2, mul:amp*env);
+ sig = RLPF.ar(sig, cutoff, 0.2, mul:y*env);
sig = FreeVerb.ar(sig);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/anamin.sc b/ignore/instruments/2F/anamin.sc
index 4307a49..7302204 100644
--- a/ignore/instruments/2F/anamin.sc
+++ b/ignore/instruments/2F/anamin.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -22,31 +22,26 @@
*/
{|synthname, n|
- var bot = 2*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, sig1, sig2, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
- var suicide, up=0.1, down=2.0, env, sig, sig1, sig2, cutoff, x;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:2);
- x = freq;
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
-
- sig1 = Pulse.ar(freq, 0.5, mul:amp*env);
+ sig1 = Pulse.ar(freq, 0.5, mul:y*env);
sig1 = Blip.ar(freq, 5) * sig1;
- sig1 = RLPF.ar(sig1, LinExp.kr(amp, 0, 1, 10, 2000), 0.2);
+ sig1 = RLPF.ar(sig1, LinExp.kr(y, 0, 1, 10, 2000), 0.2);
- sig2 = SinOsc.ar(freq, mul:amp*env);
+ sig2 = SinOsc.ar(freq, mul:y*env);
sig2 = sig2 * VarSaw.ar(freq*1.005, 0.2, mul:5);
sig2 = sig2.distort;
sig2 = BPF.ar(sig2, 500, 0.1, mul:5);
sig2 = sig2*(1-(x*0.5));
- sig = SelectX.ar(amp, [sig2, sig1]);
-
+ sig = SelectX.ar(y, [sig2, sig1]);
sig = FreeVerb.ar(sig, mix:0.3, room:0.8, damp:0.1);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/blip.sc b/ignore/instruments/2F/blip.sc
index 30766f3..651f5d8 100644
--- a/ignore/instruments/2F/blip.sc
+++ b/ignore/instruments/2F/blip.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,26 +21,16 @@
* distribution.
*/
-/*
- * Blip
- *
- * x := frequency
- * z := synced frequency
- */
-
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
- var suicide, up=0.1, down=0.5, env, freq2, sig;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:2);
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
+ sig = Blip.ar(freq, y*20, mul:env*y) * XLine.kr(1, 0.01, 5.0);
- sig = Blip.ar(freq, amp*20, mul:env*amp) * XLine.kr(1, 0.01, 5.0);
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/degree.sc b/ignore/instruments/2F/degree.sc
index 7b70a6b..ce283c9 100644
--- a/ignore/instruments/2F/degree.sc
+++ b/ignore/instruments/2F/degree.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,32 +21,18 @@
* distribution.
*/
-/*
- * discrete pitch instrument
- *
- * x := frequency
- * z := volume, distortion, cutoff frequency of low-pass filter
- */
-
{|synthname, n|
- var scale, buf;
- 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) });
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, vol, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
- var suicide, up=0.1, down=1.0, env, sig, vol;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapStepCPS.kr(x, n:n, oct:2);
+ vol = LinExp.kr(y, 0.0, 1.0, 0.5, 1.0);
- freq = DegreeToKey.kr(buf.bufnum, freq*(top-bot), 12, 1, bot).midicps;
-
- vol = LinExp.kr(amp, 0.0, 1.0, 0.5, 1.0);
sig = SinOsc.ar(freq);
sig = FreeVerb.ar(sig, mix:0.8, room:0.1, damp:0.1, mul:vol*env);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/delay1.sc b/ignore/instruments/2F/delay1.sc
deleted file mode 100644
index 872b726..0000000
--- a/ignore/instruments/2F/delay1.sc
+++ /dev/null
@@ -1,53 +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.
- */
-
-/*
- * simple sine-wave
- *
- * x := freq
- * z := volume
- */
-
-{|synthname, n|
- 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;
-
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
-
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
-
- trig = Dust.ar(LinExp.kr(amp, 0, 1, 2, 20));
- trigsplit = PulseDivider.ar(trig, 2, [0, 1]);
- delaytimes = Lag.ar(TRand.ar(0.005, 0.05, trigsplit), 0.07);
-
- sig = Saw.ar(freq * [1, 1.003], mul:env).sum * 0.1;
- sig = LPF.ar(sig, 9000);
- sig = sig + DelayL.ar(sig, 0.05, delaytimes);
-
- OffsetOut.ar(out, sig);
- }).add;
-}
diff --git a/ignore/instruments/2F/filter.sc b/ignore/instruments/2F/filter.sc
index a32e49c..921ecdf 100644
--- a/ignore/instruments/2F/filter.sc
+++ b/ignore/instruments/2F/filter.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -22,19 +22,16 @@
*/
{|synthname, n|
- var bot = 1*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var freq, env, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
- var suicide, up=0.1, down=0.5, env, sig, cutoff;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
-
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
+ freq = ChimaeraMap3rdOrderStepCPS.kr(x, n:n, oct:4);
sig = AudioIn.ar(out+1);
- sig = RLPF.ar(sig, freq, 0.1, mul:env*amp);
+ sig = RLPF.ar(sig, freq, 1-y, mul:env*y);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/grain.sc b/ignore/instruments/2F/grain.sc
index 22caf76..334dd22 100644
--- a/ignore/instruments/2F/grain.sc
+++ b/ignore/instruments/2F/grain.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,28 +21,18 @@
* distribution.
*/
-/*
- * sine wave grain synthesis
- *
- * x := grain freq
- * z := impulse rate, volume
- */
-
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, trig, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
- var suicide, up=0.1, down=0.5, env, sig, trig;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:2);
+ trig = Impulse.kr(LinExp.kr(y, 0, 1, 1, 100));
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
-
- trig = Impulse.kr(LinExp.kr(amp, 0, 1, 1, 100));
sig = GrainSin.ar(2, trig, 0.1, freq, 0, -1, mul:env);
- sig = (sig*amp).distort;
+ sig = (sig*y).distort;
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/harp.sc b/ignore/instruments/2F/harp.sc
deleted file mode 100644
index 19e7bef..0000000
--- a/ignore/instruments/2F/harp.sc
+++ /dev/null
@@ -1,52 +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.
- */
-
-/*
- * harp instrument
- *
- * x := frequency
- * z := volume, distortion, cutoff frequency of low-pass filter
- */
-
-{|synthname, n|
- 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;
-
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
-
- trig = Changed.kr(freq);
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
-
- vol = LinExp.kr(amp, 0.0, 1.0, 0.5, 1.0);
- sig = Pluck.ar(WhiteNoise.ar(0.1), trig, 1, freq.reciprocal, 10, 0.20);
- sig = (sig*amp*1000).distort;
- sig = FreeVerb.ar(sig, mix:0.8, room:0.1, damp:0.1, mul:vol*env);
- cut = LinExp.kr(amp, 0.0, 1.0, 500, 1000);
- sig = RLPF.ar(sig, freq:cut, rq:0.3);
- OffsetOut.ar(out, sig);
- }).add;
-}
diff --git a/ignore/instruments/2F/pluck.sc b/ignore/instruments/2F/pluck.sc
index c756cac..f525e9c 100644
--- a/ignore/instruments/2F/pluck.sc
+++ b/ignore/instruments/2F/pluck.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,31 +21,21 @@
* distribution.
*/
-/*
- * plucked instrument
- *
- * x := frequency
- * z := volume, distortion, cutoff frequency of low-pass filter
- */
-
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, vol, cut, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
- var suicide, up=0.1, down=1.0, env, sig, vol, cut;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:3);
+ vol = LinExp.kr(y, 0.0, 1.0, 0.5, 1.0);
+ cut = LinExp.kr(y, 0.0, 1.0, 500, 1000);
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
-
- vol = LinExp.kr(amp, 0.0, 1.0, 0.5, 1.0);
sig = Pluck.ar(WhiteNoise.ar(0.1), gate, 1, freq.reciprocal, 10, 0.20);
- sig = (sig*amp*1000).distort;
+ sig = (sig*y*1000).distort;
sig = FreeVerb.ar(sig, mix:0.8, room:0.5, damp:0.1, mul:vol*env);
- cut = LinExp.kr(amp, 0.0, 1.0, 500, 1000);
sig = RLPF.ar(sig, freq:cut, rq:0.3);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/pluck_cubic.sc b/ignore/instruments/2F/pluck_cubic.sc
index 63c609a..ebb6e38 100644
--- a/ignore/instruments/2F/pluck_cubic.sc
+++ b/ignore/instruments/2F/pluck_cubic.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,34 +21,21 @@
* distribution.
*/
-/*
- * plucked instrument
- *
- * x := frequency
- * z := volume, distortion, cutoff frequency of low-pass filter
- */
-
{|synthname, n|
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
- var suicide, up=0.1, down=1.0, env, sig, vol, cut;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, vol, cut, sig;
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- //freq = ChimaeraMapLinearCPS.kr(freq, n:n, oct:3);
- //freq = ChimaeraMapStepCPS.kr(freq, n:n, oct:3);
- //freq = ChimaeraMapPolyStepCPS.kr(freq, n:n, oct:3, order:3);
- //freq = ChimaeraMap2ndOrderStepCPS.kr(freq, n:n, oct:3);
- freq = ChimaeraMap3rdOrderStepCPS.kr(freq, n:n, oct:3);
- //freq = ChimaeraMap4thOrderStepCPS.kr(freq, n:n, oct:3);
- //freq = ChimaeraMap5thOrderStepCPS.kr(freq, n:n, oct:3);
+ freq = ChimaeraMap3rdOrderStepCPS.kr(x, n:n, oct:3);
+ vol = LinExp.kr(y, 0.0, 1.0, 0.5, 1.0);
+ cut = LinExp.kr(y, 0.0, 1.0, 500, 1000);
- vol = LinExp.kr(amp, 0.0, 1.0, 0.5, 1.0);
sig = Pluck.ar(WhiteNoise.ar(0.1), gate, 1, freq.reciprocal, 10, 0.20);
- sig = (sig*amp*1000).distort;
+ sig = (sig*y*1000).distort;
sig = FreeVerb.ar(sig, mix:0.8, room:0.5, damp:0.1, mul:vol*env);
- cut = LinExp.kr(amp, 0.0, 1.0, 500, 1000);
sig = RLPF.ar(sig, freq:cut, rq:0.3);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/vlf_pluck.sc b/ignore/instruments/2F/pluck_vlf.sc
index 5ae2e3c..dafd8be 100644
--- a/ignore/instruments/2F/vlf_pluck.sc
+++ b/ignore/instruments/2F/pluck_vlf.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,33 +21,23 @@
* distribution.
*/
-/*
- * plucked instrument
- *
- * x := frequency
- * z := volume, distortion, cutoff frequency of low-pass filter
- */
-
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, vol, cut, noise, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
- var suicide, up=0.1, down=1.0, env, sig, vol, cut, noise;
-
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
-
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:3);
+ vol = LinExp.kr(y, 0.0, 1.0, 0.5, 1.0);
+ cut = LinExp.kr(y, 0.0, 1.0, 500, 1000);
+
noise = AudioIn.ar(out+1);
- vol = LinExp.kr(amp, 0.0, 1.0, 0.5, 1.0);
sig = Pluck.ar(noise, gate, 1, freq.reciprocal, 10, 0.20);
- sig = (sig*amp*1000).distort;
+ sig = (sig*y*1000).distort;
sig = FreeVerb.ar(sig, mix:0.8, room:0.5, damp:0.1, mul:vol*env);
- cut = LinExp.kr(amp, 0.0, 1.0, 500, 1000);
sig = RLPF.ar(sig, freq:cut, rq:0.3);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/sine.sc b/ignore/instruments/2F/sine.sc
index b1abd9a..4e9ddbb 100644
--- a/ignore/instruments/2F/sine.sc
+++ b/ignore/instruments/2F/sine.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,27 +21,17 @@
* distribution.
*/
-/*
- * simple sine-wave
- *
- * x := freq
- * z := volume
- */
-
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, amp, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
- var up=0.1, down=0.5, env, suicide, sig;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:3);
+ amp = y.cubed;
- amp = amp.cubed;
-
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
sig = SinOsc.ar(freq, mul:amp*env);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/syncsaw.sc b/ignore/instruments/2F/syncsaw.sc
index d4827b3..a4cbc23 100644
--- a/ignore/instruments/2F/syncsaw.sc
+++ b/ignore/instruments/2F/syncsaw.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,29 +21,19 @@
* distribution.
*/
-/*
- * synced saw oscillator
- *
- * x := frequency
- * z := synced frequency
- */
-
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, freq2, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
- var up=0.1, down=0.5, env, suicide, sig, freq2;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
-
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
- freq2 = LinLin.kr(amp, 0, 1, (0*12).midicps, (5*12).midicps);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:3);
+ freq2 = LinLin.kr(y, 0, 1, (0*12).midicps, (5*12).midicps);
sig = SyncSaw.ar(freq, freq2, mul:env);
sig = RLPF.ar(sig, freq2*8, 0.1);
sig = FreeVerb.ar(sig);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/theremin.sc b/ignore/instruments/2F/theremin.sc
index bf9f9ba..b7122bc 100644
--- a/ignore/instruments/2F/theremin.sc
+++ b/ignore/instruments/2F/theremin.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,31 +21,21 @@
* distribution.
*/
-/*
- * Theremin
- *
- * x := freq
- * z := volume
- */
-
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=0, out=0|
+ var env, freq, amp, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=0, out=0|
- var up=0.1, down=0.5, env, suicide, sig;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:3);
+ amp = y.cubed;
- amp = amp.cubed;
-
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
sig = SinOsc.ar(freq, mul:amp*env);
sig = sig * VarSaw.ar(freq*1.001, 0.2, mul:5);
sig = sig.distort;
sig = BPF.ar(sig, 500, 0.1, mul:5);
sig = FreeVerb.ar(sig, mix:0.3, room:0.8, damp:0.1);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/2F/wind.sc b/ignore/instruments/2F/wind.sc
index fdbf2fa..71d5727 100644
--- a/ignore/instruments/2F/wind.sc
+++ b/ignore/instruments/2F/wind.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,28 +21,18 @@
* distribution.
*/
-/*
- * low-pass filtered noise, aka wind
- *
- * x := freq
- * y := cutoff frequency of low-pass filter
- */
-
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x=0, y=0, p=0, gate=1, out=0|
+ var env, freq, sig;
- SynthDef(synthname, {|freq=0, amp=0, p=0, gate=1, out=0|
- var suicide, up=0.1, down=0.5, env, sig, cutoff;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq = ChimaeraMapLinearCPS.kr(x, n:n, oct:2);
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
-
- sig = WhiteNoise.ar(0.1, mul:amp*env);
+ sig = WhiteNoise.ar(0.1, mul:y*env);
sig = RLPF.ar(sig, freq*4, 0.1);
sig = FreeVerb.ar(sig);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/4F/anabase.sc b/ignore/instruments/4F/anabase.sc
index 7c5861d..6a5aee5 100644
--- a/ignore/instruments/4F/anabase.sc
+++ b/ignore/instruments/4F/anabase.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,29 +21,19 @@
* distribution.
*/
-/*
- * low-pass filtered pulse width oscillator
- *
- * x := freq
- * y := cutoff frequency of low-pass filter
- */
-
{|synthname, n|
- var bot = 2*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x1=0, y1=0, p1=0, x2=0, y2=0, p2=0, gate=1, out=0|
+ var env, freq1, freq2, sig;
- 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;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq1 = ChimaeraMapLinearCPS.kr(x1, n:n, oct:2);
+ freq2 = ChimaeraMapLinearCPS.kr(x2, n:n, oct:2);
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
- freq2 = LinExp.kr(freq2, 0, 1, bot.midicps, top.midicps);
-
- sig = SyncSaw.ar(freq, freq2, mul:amp2*env);
- sig = RLPF.ar(sig, amp*1900+100, 0.1);
+ sig = SyncSaw.ar(freq1, freq2, mul:y2*env);
+ sig = RLPF.ar(sig, y1*1900+100, 0.1);
sig = FreeVerb.ar(sig);
+
OffsetOut.ar(out, sig);
}).add;
}
diff --git a/ignore/instruments/4F/cello.sc b/ignore/instruments/4F/cello.sc
index ceab462..477e40d 100644
--- a/ignore/instruments/4F/cello.sc
+++ b/ignore/instruments/4F/cello.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -22,22 +22,17 @@
*/
{|synthname, n|
- var bot = 3*12 - 0.5 - (n % 18 / 6);
- var top = n/3 + bot;
+ SynthDef(synthname, {|x1=0, y1=0, p1=0, x2=0, y2=0, p2=0, gate=0, out=0|
+ var env, freq1, sig;
- 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;
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ freq1 = ChimaeraMapLinearCPS.kr(x1, n:n, oct:2);
+ y2 = y2 - OnePole.kr(y2, 0.998); // differentiate
+ y2 = RunningSum.kr(y2.abs.tan, 20)*0.05;
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
-
- freq1 = freq1 - OnePole.kr(freq1, 0.998); // differentiate
- freq1 = RunningSum.kr(freq1.abs.tan, 20)*0.05;
-
- sig = Mix.ar(Saw.ar([freq, freq/3, freq*5], mul:freq1*env));
- sig = RLPF.ar(sig, amp*900+100, 0.1);
+ sig = Mix.ar(Saw.ar([freq1, freq1/3, freq1*5], mul:y2*env));
+ sig = RLPF.ar(sig, y1*900+100, 0.1);
OffsetOut.ar(out, sig);
}).add;
diff --git a/ignore/instruments/4F/pluck.sc b/ignore/instruments/4F/pluck.sc
index e1a58c2..fcd8ee3 100644
--- a/ignore/instruments/4F/pluck.sc
+++ b/ignore/instruments/4F/pluck.sc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ * Copyright (c) 2014 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
@@ -21,31 +21,18 @@
* distribution.
*/
-/*
- * plucked instrument with 4 degrees of freedom
- *
- * - pitch
- * - volume
- * - decaytime
- * - coef
- */
-
{|synthname, n|
- 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;
+ SynthDef(synthname, {|x1=0, y1=0, p1=0, x2=0, y2=0, p2=0, gate=0, out=0|
+ var env, freq1, freq2, sig;
- suicide = DetectSilence.kr(Line.kr(0.1, 0.0, 1.0)+gate, 0.0001, down, doneAction:2);
- env = Linen.kr(gate, up, 1.0, down);
+ env = Linen.kr(gate, 0.01, 1.0, 1.0, doneAction:2);
- freq = LinExp.kr(freq, 0, 1, bot.midicps, top.midicps);
- freq1 = 1 - freq1 * 0.5;
- amp1 = LinExp.kr(amp1, 0, 1, (1*12-0.5).midicps, (11*12+0.5).midicps);
+ freq1 = ChimaeraMapLinearCPS.kr(x1, n:n, oct:2);
+ x2 = 1 - x2 * 0.5;
+ freq2 = LinExp.kr(y2, 0, 1, (1*12).midicps, (11*12).midicps);
- sig = Pluck.ar(WhiteNoise.ar(0.1), gate, 1, freq.reciprocal, 10, freq1, mul:env*amp);
- sig = RLPF.ar(sig, amp1, 0.1);
+ sig = Pluck.ar(WhiteNoise.ar(0.1), gate, 1, freq1.reciprocal, 10, x2, mul:env*y1);
+ sig = RLPF.ar(sig, freq2, 0.1);
OffsetOut.ar(out, sig);
}).add;
diff --git a/ignore/osc_to_scsynth2F.sc b/ignore/osc_to_scsynth2F.sc
index 7a55668..1f16565 100755
--- a/ignore/osc_to_scsynth2F.sc
+++ b/ignore/osc_to_scsynth2F.sc
@@ -29,13 +29,14 @@ s.latency = nil;
s.boot;
s.doWhenBooted({
- var gidOffset;
+ var gidOffset, N;
gidOffset = 100;
+ N = 160;
s.sendMsg('/g_new', 0+gidOffset, \addToHead.asInt, 0);
s.sendMsg('/g_new', 1+gidOffset, \addToHead.asInt, 0);
s.sync;
- "./instruments2F.sc".load.value(96, \base, \lead);
+ "./instruments2F.sc".load.value(N, \base, \lead);
})
diff --git a/ignore/oscmidi_to_midi.sc b/ignore/oscmidi_to_midi.sc
index 990d441..b85b0d6 100755
--- a/ignore/oscmidi_to_midi.sc
+++ b/ignore/oscmidi_to_midi.sc
@@ -68,7 +68,7 @@
var ran = n/3;
chimconf.sendMsg("/engines/oscmidi/reset");
chimconf.sendMsg("/engines/oscmidi/attributes/0", "control_change", bot, ran, 0x07);
- chimconf.sendMsg("/engines/oscmidi/attributes/1", "note_pressure", bot, ran, 0x07);
+ chimconf.sendMsg("/engines/oscmidi/attributes/1", "control_change", bot, ran, 0x07);
}, clock:AppClock);
});
diff --git a/ignore/scsynth_to_scsynth2F.sc b/ignore/scsynth_to_scsynth2F.sc
index 10bcdcc..635f1d2 100755
--- a/ignore/scsynth_to_scsynth2F.sc
+++ b/ignore/scsynth_to_scsynth2F.sc
@@ -36,7 +36,7 @@ Routine.run({
s.doWhenBooted({
var hostname, tx, chimconf, rate, sidOffset, gidOffset;
-
+
hostname = "hostname".unixCmdGetStdOutLines[0]++".local";
gidOffset = 100;
diff --git a/ignore/scsynth_to_scsynth4F.sc b/ignore/scsynth_to_scsynth4F.sc
index fcc02dc..8c26250 100755
--- a/ignore/scsynth_to_scsynth4F.sc
+++ b/ignore/scsynth_to_scsynth4F.sc
@@ -43,7 +43,6 @@ s.doWhenBooted({
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
tx = NetAddr ("chimaera.local", 4444);
@@ -53,7 +52,7 @@ s.doWhenBooted({
rate = 3000;
chimconf.sendMsg("/engines/enabled", false);
chimconf.sendMsg("/engines/reset");
- chimconf.sendMsg("/engines/offset", 0.002);
+ chimconf.sendMsg("/engines/offset", 0.0025);
chimconf.sendMsg("/engines/address", hostname++":"++s.addr.port, {
chimconf.sendMsg("/engines/server", false);
chimconf.sendMsg("/engines/mode", "osc.tcp");
diff --git a/ignore/tuio2_to_midi.sc b/ignore/tuio2_to_midi.sc
index 47eb74e..c2bc236 100755
--- a/ignore/tuio2_to_midi.sc
+++ b/ignore/tuio2_to_midi.sc
@@ -31,14 +31,14 @@
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);
+ rx = NetAddr("chimaera.local", 3333);
+ tx = NetAddr("chimaera.local", 4444);
chimconf = ChimaeraConf(s, tx, tx);
rate = 3000;
chimconf.sendMsg("/engines/reset");
- chimconf.sendMsg("/engines/offset", 0.002);
+ chimconf.sendMsg("/engines/offset", 0.0025);
chimconf.sendMsg("/engines/address", hostname++":"++3333, {
chimconf.sendMsg("/engines/server", false);
chimconf.sendMsg("/engines/mode", "osc.udp");
@@ -52,7 +52,7 @@
chimconf.sendMsg("/sensors/number", {|msg|
var n = msg[0];
chimout = ChimaeraOutMidi(s, n, [\base, \lead]);
- chimout.effect = 0x07;
+ chimout.control = 0x07;
chimout.doublePrecision = true;
chimin = ChimaeraInTuio2(s, chimconf, rx, chimout);
});
diff --git a/ignore/tuio2_to_scsynth2F.sc b/ignore/tuio2_to_scsynth2F.sc
index 0c65353..301c0dd 100755
--- a/ignore/tuio2_to_scsynth2F.sc
+++ b/ignore/tuio2_to_scsynth2F.sc
@@ -43,7 +43,7 @@ s.doWhenBooted({
rate = 3000;
chimconf.sendMsg("/engines/reset");
- chimconf.sendMsg("/engines/offset", 0.002);
+ chimconf.sendMsg("/engines/offset", 0.0025);
chimconf.sendMsg("/engines/address", hostname++":"++3333, {
chimconf.sendMsg("/engines/server", false);
chimconf.sendMsg("/engines/mode", "osc.udp");
diff --git a/ignore/tuio2_to_scsynth4F.sc b/ignore/tuio2_to_scsynth4F.sc
index 038a563..a34ac84 100755
--- a/ignore/tuio2_to_scsynth4F.sc
+++ b/ignore/tuio2_to_scsynth4F.sc
@@ -43,7 +43,7 @@ s.doWhenBooted({
rate = 3000;
chimconf.sendMsg("/engines/reset");
- chimconf.sendMsg("/engines/offset", 0.002);
+ chimconf.sendMsg("/engines/offset", 0.0025);
chimconf.sendMsg("/engines/address", hostname++":"++3333, {
chimconf.sendMsg("/engines/server", false);
chimconf.sendMsg("/engines/mode", "osc.udp");