Midi thru, but logging all messages

I’d recommend using aconnect and aseqdump command line utilities.

aconnect -lio will list all the ALSA MIDI clients and the current virtual connections on the system. Pisound in my experience usually is accessible using 20:0 as the client and port id, so you could use a command like this to make all the incoming messages to be immediately sent back out:

aconnect 20:0 20:0

Or possibly aconnect pisound:0 pisound:0 could work too.

Then run aseqdump -p 20:0 or aseqdump -p pisound:0 to see the messages passing through.

You may have to first install alsa-utils package so aseqdump command is available: sudo apt install alsa-utils