Hi @yangzhang8805 welcome to in_thread, and hello also from LA (County)!
Sonic Pi doesn’t have any built-in support for loading MIDI files. I have a similar interest to be able to use a bunch of my own MIDI files and have explored this a little bit.
There are some tools out there that can help. At the top of my list to evaluate is Midiot (link below). I stumbled across this recently and looks like it has all the features needed. I haven’t had time to test beyond confirming that the base file appears to load OK but I’ll report back soon. The code hasn’t been updated in a few years so there may be things in there no longer compatible, but I’d be willing to hack at some fixes since this seems usable for me and possibly others.
A few months ago I hacked together a proof of concept Python script to convert a basic (drum-based) .mid to Sonic Pi code. I don’t expect it’s usable outside my hacking at the moment, but it’s a problem I want to solve… The Midiot approach seems good so I’m hoping it works out of the box or with a little nudging.
My hack: https://gist.github.com/unbracketed/17b46c575463fb5dae2d5a0d58083264