Install a2jmidid by entering the following commands in the terminal
Update package repositories and get latest package information.
sudo apt update -y
Install the packages and dependencies with -y flag.
sudo apt install -y a2jmidid
Now that you have your a2jmidid installed
Package Description: Daemon for exposing legacy ALSA MIDI in JACK MIDI systems
OS: Ubuntu 16.04 LTS Xenial Xerus
Dependent Packages (you may have to install the packages below if it is not installed automatically or is not available on your computer) :
Daemon for exposing legacy ALSA MIDI in JACK MIDI systems