Sonic Pi’s record function records all the sound produced and ignores the MIDI notes produced. I request the complementary capability where all MIDI produced gets recorded to a standard MIDI file, while the audio is ignored. This was discussed here some time ago, but it’s a real pain to use an external app to record complicated streams of MIDI correctly for re-use in clip launching apps and hardware.
My current workaround is to use MIDI Tape Recorder in REAPER DAW to record MIDI coming from Sonic Pi. It’s not overly cumbersome, I guess, but I am forced to install this extra DAW (I normally use Bitwig) for this single user case because support for AUv3 plugins is so rare. MIDI Tape Recorder is open source at GitHub, so not only is this another situation where the wish list item to add plugin support to Sonic Pi would fulfill follow-on wishes, but maybe also MIDI Tape Recorder’s code could be used to build MIDI recording into Sonic Pi without necessarily providing general plugin support.
Apologies but recording MIDI events is not currently on my TODO list. However if someone wanted to look into this, I’d be happy to consider pull requests. It would very likely need to be implemented at the Erlang/Elixir level and appropriate syntax/GUI interaction would need to be considered to operate it.