Feature Request: Native MIDI Export Functionality (Similar to Audio Record)

​First, thank you for the incredible work you’ve done on Sonic Pi. It has completely changed the way many of us approach composition and algorithmic music.

​I am writing to suggest a feature that would greatly enhance the workflow for users who distribute their music or use notation software: A native “Export to MIDI” button.

​Currently, converting a Sonic Pi composition into MIDI requires setting up virtual MIDI buses and recording into a third-party DAW in real-time. While this works, it adds a layer of technical friction for users who want to:

​Import their algorithmic compositions into notation software like MuseScore. ​Refine their compositions in a DAW with high-end VSTs. ​Archive their musical ideas in a lightweight, editable format.

​Proposed Implementation:

Much like the existing “Record” button captures audio to a .wav file, a “Record MIDI” toggle could capture all outgoing note events (pitch, duration, velocity, and channel) and save them as a Standard MIDI File (.mid) upon stopping.

​This feature would make Sonic Pi an even more powerful tool for professional composers and educators alike by seamlessly connecting code to the broader music production ecosystem.

​Thank you for your time and for everything you do for the live-coding community!