// title: Simple MIDI CC to Sysex messages ( proof of concept ) // author: hems.inlet // description: // This snippet is a proof of concept showing how to map MIDI CC to MIDI Sysex messages. // // It can be improved by filtering MIDI source, and routing channel and control number in a neater way. // // unfortunately i couldn't test this code on my synths, the CC part was tested. // code: // running this line will show all your MIDI ins and outs on the console // find the number of the output interface you want to use MIDIClient.init; // select the midi out you would like to use m = MIDIOut( 8 ).latency_(0.0); // send a sysex functions // some example messages MKS-50 here: // "http://www.vintagesynth.com/roland/sysex.php" // this one using MIDI CHANNEL 2 ( 0x01 ) // set filter ~set_param = { | param, value | m.sysex(Int8Array[ 0xF0, 0x41, 0x36, 0x01, 0x23, 0x20, 0x01, param, value, 0xf7]); }; // connect will connect to all midi in devices // if you need to specify one, // check the sources at: MIDIClient.sources // and connect using MIDIIn.connect( source_index ) MIDIIn.connectAll; // show incoming control data ~control = { arg src, channel, control, value; // ( control + " : " + value ).postln; switch( control, 32, { // value.postln; // still have to convert value to hex number ~set_param.value( 0x10, value ); }); }; MIDIIn.addFuncTo(\control, ~control);