Inserting audio into DAW from VST plugin?

A friend and I have been planning an app to automate some of the busy-work done by DJs in DAWs like Ableton. The hope is to be able to programmatically insert audio tracks into the DAW workspace, which the DJ can then continue working on.

I’m a C++ developer, but without much experience writing audio software. I’ve been doing a lot of reading on VST plugins, but can’t seem to find a straight answer to this question: can a VST plugin be used to insert audio into the DAW?

Most documentation I can find assumes that the VST plugin will be used to process audio that the DAW is already trying to play (for the purpose of applying effects). Are VST plugins only used for these sorts of DSP tasks? Or can a VST plugin be used to script the insertion of audio files from the hard drive into the DAW timeline?

Maybe we need to go the standalone app route, but thought I would double check with the experts in the JUCE community :wink:

VST plugins have no usable API for what you want. (Technically, there’s a very obscure thing in VST2.4 that is supposed to do offline processing of files but it’s not really implemented by any significant DAW. Juce also doesn’t have support for that anyway.)

The only viable way I see is that you would implement a way to drag audio files out of the plugin to be inserted into the host. Or maybe in Ableton Live you could look into what is possible to do with the Max/MSP integration? (That’s not C++ programming though, unless you implement an external object into Max…)

Definitely not without some specific host hackery, i.e. it’s not part of any standard. Normally a plugin is for processing audio passed to it (an effects plugin) or generating audio (a synth).

However if you can figure out how to do the specific host hackery, doing it from a plugin ‘might’ not be a bad idea. For one you can get the name and I believe location of the running host application, JUCE makes this pretty easy. What you can’t do is know which project(s) are open and therefore which project you’re plugin has been inserted in, unless you could get the host to save all open projects then look for the project files on disk which contain your plugin (assuming you know how to read them), anyway the whole thing will likely be a complete and utter nightmare riddled with all sorts of horrible edge-cases! and also it’s quite possible there would have to be some hacks specific to the OS you’re running on too.

Sure! Any VST can read files from disk and feed those into its output to the DAW. All you need to take care of is synchronizing it with the host clock (i.e. buffer the file and wait for the right playhead timestamp to start your feed).

This however works for online processing only, that is, “live” during playback. The waveform would not show up on your DAW track, of course. Its “embedded” with the plugin (where you can show it on its editor). But there’s really no reason why it shouldn’t work this way.

You can even stream audio over LAN, or the Internet, this way.

If I understood the original poster correctly, he does indeed want a new audio file/clip to appear on the host’s timeline and for that plugins don’t offer a standard API.

That would indeed only be possible if the DAW supported scripting.

Or a C or C++ API like Reaper has.