MIDI File Recording with PsychoPy

My team is currently working on an experiment to play audio through PsychoPy, have participants respond on a MIDI keyboard (the output MIDI file is our data), and have an input to move on to the next trial. We are currently struggling to connect our controller in a way where PsychoPy prompts can start and stop the MIDI recordings. Any advice at all would be greatly appreciated!

Our keyboard: https://usa.yamaha.com/files/download/other_assets/6/321686/n1_en_om_c0.pdf
PsychoPy Version: 2022.3.1