The script simply converts MIDI input to OSC output, in the format expected by REAPER's 'virtual keyboard' when using the Default.ReaperOSC configuration; cf. these comments in Default.ReaperOSC configuration file:
Code:
# these send MIDI to the vkb MIDI input. parameters are raw MIDI.
# for notes, if two, first wildcard is channel (0-15). MIDI note number is required (as decimal integer only!)
# if parameter value is 0, note-off, otherwise note-on
VKB_MIDI_NOTE i/vkb_midi/@/note/@ f/vkb_midi/@/note/@ i/vkb_midi/note/@ f/vkb_midi/note/@
# similar, but for 0xA0 (poly aftertouch)
VKB_MIDI_POLYAFTERTOUCH i/vkb_midi/@/polyaftertouch/@ f/vkb_midi/@/polyaftertouch/@ i/vkb_midi/polyaftertouch/@ f/vkb_midi/polyaftertouch/@
# for CCs, if two, first wildcard is channel (0-15). MIDI CC number is required (as decimal integer only!)
VKB_MIDI_CC i/vkb_midi/@/cc/@ f/vkb_midi/@/cc/@ i/vkb_midi/cc/@ f/vkb_midi/cc/@
# program change (0xC0) can take channel as wildcard, or value only
VKB_MIDI_PROGRAM i/vkb_midi/@/program f/vkb_midi/@/program i/vkb_midi/program f/vkb_midi/program
# channel pressure (aftertouch) (0xD0) can take channel as wildcard, or value only
VKB_MIDI_CHANNELPRESSURE i/vkb_midi/@/channelpressure f/vkb_midi/@/channelpressure i/vkb_midi/channelpressure f/vkb_midi/channelpressure
# pitch can take channel as wildcard, or value only
VKB_MIDI_PITCH i/vkb_midi/@/pitch f/vkb_midi/@/pitch i/vkb_midi/pitch f/vkb_midi/pitch
If you have configured a MIDI input to OSCII-bot, and have enabled MIDI input for the virtual keyboard on a track in REAPER, this allows you to play MIDI notes on the virtual keyboard in REAPER using OSC messages.
For example:
[MIDI input] Ch. 1 Note C 4 ON, velocity: 100
[OSC output] /vkb_midi/0/note/60 [i] 100
[MIDI input] Ch. 1 Note C 4 OFF
[OSC output] /vkb_midi/0/note/60 [i] 0
You could simply deduce the message format used, and use it in your TouchOSC layout as appropriate.
It may be much more straightforward to make your TouchOSC layout send MIDI rather than OSC, though.