I am on Linux, using a custom program generating MIDI events, which are interpreted and played by a synth connected to my PC via USB cable. Since this program is interactive and does not allow saving MIDI files, is there any tool to intercept MIDI raw data on the USB cable and save it in .MID file format?
I have tried arecordmidi(1) with the correct port, but I get:
Cannot connect to port 24:0 - Resource temporarily unavailable
It looks like there is concurrency problem here: if one program is writing to raw MIDI ports, another one can't read.