I'm working on a plugin that outputs MIDI sequences and ran into this strange bug when trying to copy and paste MIDI. It can successfully create a MIDI file, copy it to the clipboard and then paste it in Ableton, but it will only paste after I switch to a different window and then go back to Ableton. I can then copy and paste new MIDI without the bug until I copy something else, like text, to the clipboard; copying the MIDI then requires a window switch before it works. This happens on both Windows and Mac despite the clipboard code being different.
This is what I'm using to create the MIDI file:
https://github.com/craigsapp/midifile
Any help would be great, thanks. Please like me know if any code segments would be helpful.