i run a shell script which connects midi usb controllers directly to midi usb devices (including usb>DIN cables etc) it does not require booting into a X11 environment, all done with the core midi utility - all done years ago, when they were new, so memory is rusty, but conceptually it is trivial, the slicker bit is auto detecting which devices are connected and attributing what you want as in and out, have a google first or PM me and i’ll dig out the pi script to see if it’ll work for u