Random access to MIDI data

For my plug-in I need to be able to analyse the MIDI data for a whole track/clip. I have researched into this but it looks like there isn’t any plug-in format which can allow this.

My current best solution is to have our own piano roll editor inside our own plug-in. This feels hacky and far from ideal. Is there a better solution out there? Do any DAWs support random access to MIDI?

Thanks.

I’ve not been doing this for super long so I could be wrong but I’ll share my understanding seeing as no one else has. Just make sure you verify what I say for yourself because I could be wrong.

So just to make sure we’re on the same page, you want to be able to read and analyse an entire midi track at once. If by plug-in you mean a VST or AU or something like that, then I don’t believe what you want to do is possible. This being because these sorts of plugins that are instantiated at the track level stream the data in discrete chunks, with the size of those chunks determined by your DAW’s buffer size.

So as far as I know you have two options. Firstly you could create a standalone application that reads and modifies a midi file. This method could create a cumbersome workflow depending on how the DAW handles storing its midi data. But as long as the DAW at least allows you to save and load midi files (which I think is all of them) this method would definitely work and I would be somewhat straight forward (even if not the most elegant).

The second option would be to create an extension or editor level plugin for your DAW. How does one do this? I have no idea. I don’t even know which DAWs offer a toolset to do it. If you can make an editor extension or something like that, then that would be a much more pleasant for the user experience, but its going to be a lot harder, and be specific to each DAW. I’m pretty sure Reaper has an extension SDK that could do something like this (never used it so I don’t know) but beyond that I’m not aware of anything.

Hope this was helpful! If you figure something out, or if anyone can identify a way that I’m wrong please let me know!

1 Like

No, it’s not supported in the VST2, VST3 or AU formats. For audio there is ARA but for MIDI I haven’t heard of anything. Maybe you can ask the devs behind CLAP (Bitwig among others) to consider this addition? This is something that can’t be done unless the DAWs are interested in supporting it. ARA was developed because DAWs needed to integrate Melodyne (they couldn’t offer the same when it came out) but for MIDI I have the feeling that most DAWS are trying to sell their own internal tools.

If I’m not mistaken Celemony had to create their own editor to run Melodyne separately before ARA was adopted, so you might have to do this as well (create your own MIDI editor in your plugin). You may want to consider start using the MIDI editor of the Tracktion Engine.

Thanks for the replies. It’s as I thought. I think I will have to use my own midi editor as you said, but I will also have a look at the reaper extension.

A follow up question is then is it possible within the VST API to query contextual information from the host such at tempo, time signature, play head position, clip start position etc?

They’re provided in the ProcessContext which is passed to the processing callback in your plugin, but hosts do not necessarily support all the fields.