There is a MIDI bridge device available to achieve that goal:
a2jmidi_bridge <device-name> &
That will act as a router for MIDI events between ALSA and JACK worlds. It’s possible to create multiple bridges by executing the command using different device names.
Maybe you also need to install/load the
snd-virmidi kernel module.