Cantabile's Onscreen Keyboard device works just like any other MIDI device. Usually, it's is accessed via a set of MIDI input/output ports, but its state can also be queried through a set of variables.
eg: $(cc(23))
shows the value of the on-screen keyboard's continuous controller 23.
These variables are managed right alongside the on-screen keyboard's MIDI Device, as shown in the following diagram:
In addition to the normal input/output ports associated with the keyboard, there's also a loopback port that can be used to send MIDI as if it's coming from the on-screen keyboard.
The Problem
In most cases the above setup works just fine. The one small problem that sending MIDI to the loopback port bypasses the device and hence the on-screen keyboard variables don't reflect anything sent to the loopback.
(Note this is essentially the same behaviour as a physical loopback device where if you send MIDI to a loopback device, it will come back via Cantabile's MIDI input port, but the device itself never sees it).
The Fix for Bindings
To work around this, Cantabile now supports a new MIDI target called "Onscreen Keyboard Device (in)".
This lets you inject MIDI at the on-screen keyboard device level - rather than through the loopback port.
The advantage of using this target over the loopback port is that not only will the MIDI appear at the input port, but the onscreen keyboard variables will also be updated.
Currently this device is only available in bindings and can't be used in regular MIDI routing.
Available now in build 4169 and later.