I’m running Sonic Pi v3.2.0-dev-3538a on my Ubuntu system and it’s not recognizing my USB MIDI keyboard. Using aconnect and aseqdump, I was able to verify that my system recognizes it. I tried using qjackctl to route MIDI, but for whatever reason it can’t start up when sonic pi is running (and vice versa). It’s worth noting that aconnect doesn’t recognize sonic pi as an input or an output for MIDI.
Ubuntu 18.04.3 LTS