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