I'm now using arecordmidi to record my puredata midi sessions. arecordmidi is part of alsa-utils.
arecordmidi -l lists the available port :
Port Client name Port name 64:0 EMU10K1 MPU-401 (UART) EMU10K1 MPU-401 (UART) 72:0 Virtual Raw MIDI 1-0 VirMIDI 1-0 73:0 Virtual Raw MIDI 1-1 VirMIDI 1-1 74:0 Virtual Raw MIDI 1-2 VirMIDI 1-2 75:0 Virtual Raw MIDI 1-3 VirMIDI 1-3 129:1 Pure Data Pure Data Midi-Out 1
Here's the commandline I use: arecordmidi --port=129:1 -s -d midirecording.mid