Appears to be enough to silence any lingering notes when midi is playing
and core is suddenly closed. Tried adding this on the core side but
midi_free comes first before retro_deinit/retro_unload_game so the
driver was already closed.
Another way to fix this in the core's side is to call 'flush'
immediately after any midi writes, but that doesn't appear to be the
api's design, flush is supposed to get called at the end of the
retro_run.
Im open for any better methods. but this should work for the issue
without causing other problems.
Co-authored-by: negativeExponent <negativeExponent@users.noreply.github.com>
When an underlying MIDI device does not understand/support a MIDI message (very common with sysex messages) it returns an error code.
With this fix MIDI output can continue gracefully even after an emulated game sends an unsupported message.
midiStreamStop can freeze the process when there has been a NOTE-ON message without a corresponding NOTE-OFF.
Just removing the call to midiStreamStop and letting the midiStreamClose below it do the entire stopping and closing fixes that.