Virtual Midi Instruments

So as a little side project I have a couple of RPi’s hanging about and some touchscreens from a previous project. What I want to do is have an app on my lappy / desktop to accepts updates over the network and pipes them into a DAW in the form of midi.

I realise this is troublesome in windows because of midi limitiations so I’m going to forget about that for now. I can build juce apps on RPi’s fine and I can get comes over the network between RPi’s app and a host app on my PC. What I can’t figure out is how to get say OSX to see a running juce app as a midi instrument…

MainComponent::MainComponent()
{
    setSize (800, 600);
    
    midiOutput = MidiOutput::openDevice(0);
    setAudioChannels (2, 2);
    startTimerHz(1);
}

void MainComponent::timerCallback() {
    midiOutput->sendMessageNow(MidiMessage::noteOn(1,69,(float)127/127));
    midiOutput->sendMessageNow(MidiMessage::noteOff(1,69, (float)127/127));
}

I thought may just work to send a note each second…

Use MidiOutput::createNewDevice instead of MidiOutput::openDevice. It will create a Virtual Device that other apps can open.

ah cool cheers… That works great. I was going to ask how I name the intrument but it forces it in the constructor which is cool