Using ydotool and systemd we can set this up
Install ydotool
sudo dnf install ydotool
sudo apt install ydotool
Replace MIDI Commands and Keycodes (from /usr/include/linux/input-event-codes.h
)
Example maps CC42 to F14
After writing the files, you can register and start the services
systemctl daemon-reload
systemctl enable ydotool midiKeyboardBridge
systemctl start ydotool midiKeyboardBridge