Copy/paste midi events


#1

I’d like to be able to copy midi events from the DAW’s midi tracks and paste into my Juce vst plugin. eventually I’d like to be able to do it the other way. I can get text from the clipboard no problem, but if I copy midi data from the midi track, there is nothing in the clipboard.

Is it even possible to do this? Can the clipboard hold anything other than text? Do the developers hold copied midi data as blobs of binary data or do they parse into their own text structure for pasting later on?


#2

I’ve no idea what format DAWs use for midi, but would be surprised if any two of them do it the same way.


#3

For example Native Instruments Kontakt libraries like Studio Drummer allow dragging some selected midi groove/part and dropping it onto DAW’s tracks as a midi file. I use it constantly with Reaper, Waveform, even with Guitar Pro. But it works differently: it generates dynamically some midi file which is imported then to the external programs/hosts. Anyway it’s very convenient and I am going to use this method in my projects too.


#4

thats interesting, so it must use a drop handler. i notice juce has a FileDragAndDropTarget class, maybe i can create drag from my vst and create a temporary file to drag into the DAW.


#5

Yes, it seems that as soon as you start dragging, you have to create a temporary MIDI file and then that gets dragged into the host.

We need that functionality in the future, too.

Would ROLI/JUCE be interested in a small class that can read/write very basic, single-track MIDI-files? Once we’ve implemented it, we could offer it as a JUCE module to be included with future versions of JUCE.


#6

Dropping a MIDI File onto a DAW track, is simple… as you indicated… create a temporary file and use that (start a cleanup Timer to delete the temp file later)… dragging MIDI clips from the host to a plug-in isn’t available in any DAW I’m familiar with… you’d have to record the MIDI from the DAW into your plug-in.

Rail


#7

Like this?
https://www.juce.com/doc/classMidiFile


#8

Sweet. Thanks. That should save some time :wink: