summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-04-28 23:22:13 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-04-28 23:22:13 +0200
commitdc65a809679e7217a2ab6981cb8bfc24edd6e784 (patch)
tree5f28c2e17ba8db90749430aed1b3aab817bea793
parent1e990fb25abf5d2987d67bb91b59aff54ab30a2d (diff)
downloaddigitale-debutanten-dc65a809679e7217a2ab6981cb8bfc24edd6e784.tar.gz
some contact mic params made configurable
-rw-r--r--contact_mic.ck39
1 files changed, 38 insertions, 1 deletions
diff --git a/contact_mic.ck b/contact_mic.ck
index 12999b0..ce27ed6 100644
--- a/contact_mic.ck
+++ b/contact_mic.ck
@@ -31,4 +31,41 @@ clipper.output => Delay del => amp;
adc.chan(1) => Bus.out_left;
adc.chan(1) => Bus.out_right;
-while (day => now);
+/*
+ * Mic/effect configuration via MIDI
+ */
+/* FIXME: custom nanoKONTROL events */
+if (me.args() > 0)
+ me.exit();
+
+/* fixed to Scene 1 */
+0 => int on_channel;
+
+MidiIn min;
+
+/* always open MIDI Through port, actual connection is done by Jack */
+if (!min.open(0))
+ me.exit();
+<<< "MIDI device:", min.num(), " -> ", min.name() >>>;
+
+while (min => now) {
+ while (MidiMsg msg => min.recv) {
+ msg.data1 & 0x0F => int channel;
+ msg.data1 & 0xF0 => int cmd;
+ (msg.data3 $ float)/127 => float value;
+
+ if (channel == on_channel && cmd == 0xB0) {
+ <<< "Channel:", channel, "Command:", cmd, "Controller:", msg.data2, "Value:", value >>>;
+
+ if (msg.data2 == 14) {
+ value*0.4 + 0.1 => del.gain;
+ } else if (msg.data2 == 2) {
+ value*10::ms => del.delay;
+ } else if (msg.data2 == 3) {
+ value*10 + 1 => pregain.gain;
+ } else if (msg.data2 == 15) {
+ value*4 + 1 => amp.gain;
+ }
+ }
+ }
+} \ No newline at end of file