If a midi device is unplugged and then re-plugged, it's impossible to .closeDevice and thus to .openDevice. This is because the new destDevice is not identical to the old one, even though they are equal.
In my tests, a simple change from .indexOf to .indexOfEqual would fix it:
If a midi device is unplugged and then re-plugged, it's impossible to .closeDevice and thus to .openDevice. This is because the new destDevice is not identical to the old one, even though they are equal. In my tests, a simple change from .indexOf to .indexOfEqual would fix it: