aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-07-13 22:17:46 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-07-13 22:17:46 +0200
commitb3197fd0214bd1c99fbfe0c45eacf6ebb9a5779c (patch)
treeb7108e5f006ec96f2b18a2c334d072eaffef44f9
parentdd2691d266b5a5916ba7ee52912ac6695bda700b (diff)
downloadchimaera_sc-b3197fd0214bd1c99fbfe0c45eacf6ebb9a5779c.tar.xz
oscmidi: use midi as oscmidi/format.
-rwxr-xr-xignore/oscmidi_to_midi.sc13
1 files changed, 7 insertions, 6 deletions
diff --git a/ignore/oscmidi_to_midi.sc b/ignore/oscmidi_to_midi.sc
index 971b60e..3f22e1a 100755
--- a/ignore/oscmidi_to_midi.sc
+++ b/ignore/oscmidi_to_midi.sc
@@ -39,7 +39,7 @@
chimconf.sendMsg("/engines/oscmidi/enabled", true);
chimconf.sendMsg("/engines/oscmidi/multi", true);
- chimconf.sendMsg("/engines/oscmidi/format", "int32");
+ chimconf.sendMsg("/engines/oscmidi/format", "midi");
chimconf.sendMsg("/engines/oscmidi/path", "/midi");
chimconf.sendMsg("/sensors/number", {|msg|
@@ -70,11 +70,12 @@
midio.latency = ChimaeraOut.timeToLatency(time);
msg.removeAt(0); // remove path
- msg.do({|i| // iterate over all MIDI messages
- var hiStatus = i & 0xf0; // upper status byte
- var loStatus = i & 0x0f; // lower status byte (channel)
- var dat0 = (i & 0x7f00) >> 8; // data byte 0
- var dat1 = (i & 0x7f0000) >> 16; // data byte 1
+ msg.do({|m| // iterate over all MIDI messages
+ var hiStatus = m[1] & 0xf0; // upper status byte
+ var loStatus = m[1] & 0x0f; // lower status byte (channel)
+ var dat0 = m[2]; // data byte 0
+ var dat1 = m[3]; // data byte 1
+ [hiStatus, loStatus, dat0, dat1].postln;
midio.write(3, hiStatus, loStatus, dat0, dat1);
});
}, "/midi", chimconf.rx);