Finding a DirectShow MIDI codec may be the best bet (assuming no one has made MIDI codecs for the newer MediaEngine/MediaSession APIs, or a MIDI preview handler for File Explorer). I don't know which codec to recommend as I've not tried any of them.
Alternatively, for a quicker solution, you can use a Windows Media Player component to play MIDI in the viewer pane. At least, this works on my Windows 10 machine:
- Preferences / Viewers / Plugins.
- Configure MetaPlugin.
- Turn on the Generic ActiveX line.
- Add the
.mid
extension to it. - (It's up to you if you want to remove the other extensions, which could result in other audio/video formats playing in the same way if the main Video & Audio plugin can't find appropriate codecs for them.)
Drawback with that method is that Windows Media Player was never updated to handle dark mode or high DPI, so you'll get very small playback controls on modern displays, but the audio does play (at least for the test files I tried).