Adding VST effect to audioSources


Hello GUYZ

I have been finished my application. I have used the AudioSources -> AudioSourcePlayer -> AudioDeviceManager pipeline. My Track class extend the audioSources and I do all the Audio stuff in the getNextAudioBlock() of each track, by handling the bufferToFill.

Considering this, now I want to add some VST effect to it and I see that everyone uses the AudioProcessor -> AudioProcessorGraph -> AudioProcessorPlayer -> AudioDeviceManager paradigm…

Does this mean that all my work with AudioSources is wasted and I have to rethink my entire code ?

And if so, could you please me suggest me some threads or tutorial where it is well explained how to use the AudioProcessor paradigm ?


There is no problem adding an AudioProcessor into an AudioSource. The only thing you have to manage is to create an AudioBuffer, that refers to a subset of the buffer in AudioSourceChannelInfo (startSample and numSamples)

void getNextAudioBlock (const AudioSourceChannelInfo& info)
    // fill your buffer as normal

    AudioBuffer proxy (info.buffer->getArrayOfWritePointers(), 
    MidiBuffer midiDummy;

    if (!processor->isSuspended())
        processor->processBlock (proxy, midiDummy);

That’s simpler than using AudioProcessorGraph etc.
Hope that helps…


That sounds perfect,
But I think I have another problem now :
I want to do a master Track which process the audio outputs buffers after that all the tracks did their stuff to it ? Is there a way to say to the deviceManager to callback the Master’s processing function after all the others ?

Don’t know if I explained my self


Your AudioIODevice runs an AudioIODeviceCallback, which is maybe an AudioSourcePlayer (the AudioAppComponent has an AudioSourcePlayer and acts itself as AudioSource).

So you can put your master effects in there. You can even create a little AudioProcessingSource wrapper, inheriting from AudioSource and add the snippet above in the getNextAudioBlock and hook it between your AudioTransportSource -or whatever you use as final output- and the MixerAudioSource, that mixes your tracks, you get the gist…


Yes I am using and AudioSourcePlayer, but I didn’t know it worked as an AudioSource, I seem to fit perfectly, tomorrow I am going to give it a try.
I have already check and it has a AudioIOdeviceCallback and it seems where I am going to put my processor

Thanks as usual Daniel lifesaver.

P.S. About the Mixer Audio Source am going to look at it the future since a nice strategy