Adding Midi Out to VST Host Demo


#1

I’m trying to get a test host up and running with midi in and out, my plugins work with external synthesizers.
Midi in works fine.
I added the following to add an MidiOutput filter -

FilterGraph::FilterGraph - added -

addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::midiOutputFilter),   0.25f, 0.1f);

FilterGraph::newDocument -added -
addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::midiOutputFilter), 0.25f, 0.9f);

InternalPluginFormat::InternalPluginFormat()-added-

{
    AudioProcessorGraph::AudioGraphIOProcessor p (AudioProcessorGraph::AudioGraphIOProcessor::midiOutputNode);
    p.fillInPluginDescription (midiOutDesc);
}

InternalPluginFormat::createPluginInstance - added -

if (desc.name == midiOutDesc.name)
    retval = new AudioProcessorGraph::AudioGraphIOProcessor (AudioProcessorGraph::AudioGraphIOProcessor::midiOutputNode);

PluginDescription* InternalPluginFormat::getDescriptionFor - added -

    case midiOutputFilter:      return &midiOutDesc;

InternalPluginFormat - added -

PluginDescription midiInDesc;

updated -
enum InternalFilterType
{
audioInputFilter = 0,
audioOutputFilter,
midiInputFilter,
midiOutputFilter,

    endOfFilterTypes
};

This gave me a Midiout plugin I can add, but it does not function.
I saw two different threads that had suggested changes to JUCE core code, but they must be too old, as it generated tons of errors. Plus I saw that midiout appeared to be implemented in those classes now.

I have written several stand alone apps that use midi in and out with JUCE and now I’m trying to convert some to vst3 plugins. Plus I wanted to have my own base host for other projects and I need midi out.

What is a method to add midi out to the demo host, or simplest structure to build one from scratch?
I have found lots of info on plugins, but almost nothing an creating VST host apps.

Thanks,
David


#2

The problem is that the demo host uses an AudioProcessorPlayer to host the AudioProcessorGraph. The AudioProcessorPlayer is really just a quick boilerplate class to to run a single AudioProcessor (the AudioProcessorGraph is an AudioProcessor itself which hosts other AudioProcessor) in your app. It takes the midi and audio callbacks of the AudioDeviceManager and passes them on to the processor. However, there is no callback for midi output. Midi output is actively pushed with sendMidiNow etc. The AudioProcessorPlayer won’t do this.

So for midi output you will need to host the AudioProcessorGraph yourself. I’ve done a quick implementation of this on my private github account if you want to know how to do this:

Just build the audio plugin host on the master branch of the above repo.

Note that the above audio plugin host does not support double precision audio processing.


#3

Hi Fabian,

I’ve recently hit the same need as discussed in this thread. I couldn’t find evidence of the quick implementation you describe in audio plugin host on your github (which would be very useful to see). Am I looking in the wrong spot (https://github.com/hogliux/JUCE)? Has it gotten moved? Any help greatly appreciated.

Thanks,
Andrew


#4

I’m looking for this too… Does your code branch still exist anywhere?

Cheers,

Rail


#5

No sorry. I don’t think I kept that branch around. I know it wasn’t all too hard though. Basically copy the code for the AudioProcessorPlayer and create a new one which also pushes the midi output.


#6

Thanks - I got it working :slight_smile:

Cheers,

Rail


#7

Okay, using this thread:

I made changes to the Host code and to AudioProcessorPlayer

Code changes are here:

It would be great if you considered adding this to the JUCE code base.

Cheers,

Rail