When focus is lost the midi channels seem to reset (The song isn't reset), same thing happens when focus is restored. Most notable when there is a long note playing as it will be cut short when the channel is reset.

Windows 10 x64