How do you output MIDI to a DAW

midi
windows

#1

Hi everyone.

I am new to JUCE, and I’m not super familiar with how MIDI works, so this might be really basic.

I am trying to make a plugin that outputs MIDI to the DAW, where it can be sent to plugins. My problem is that midiOutput::getDevices() only returns one device (Microsoft GS Wavetable Synth).
When I send MIDI messages, they do not even go through the DAW, but directly output sound. What do I have to do differently to make it go though the DAW?


#2

You should make a VST plugin that outputs MIDI into the MIDI buffer given to processBlock and hope it works in the DAW application to generate MIDI for the following plugins in the processing chain in some way.

You should not really attempt doing it with the JUCE hardware MIDI output stuff. Especially on Windows it is painful since there is no native inter application MIDI support, 3rd party drivers are needed for that. And plugins should not attempt to use the MIDI or audio hardware directly anyway, they should be left for the host application’s use.


#3

OHHH thank you!

I’ll try and figure that out!


#4

Note that you need to have the right settings in the Projucer for the plugin project to have even a chance it will work. (The use case of a plugin generating MIDI output without any MIDI input is not very well supported by the plugin formats and hosts. But it can work with some hosts with the right set up.)


#5

This isn’t 100% related, but I have more questions that I haven’t been able to figure out on my own, and I don’t think it’s worth its own topic.

Let’s say I want to make the simplest plugin possible, one that just receives MIDI notes, and sends them through (doing absolutely nothing). I would need to check “Plugin MIDI input” and “Plugin MIDI output” in projucer, right? And I would write no code at all in the processBlock, because I do not want to alter the MIDI messages at all.
I did this, and it seems to work fine! MIDI events go in, and they come out. But then, I cleared the midiBuffer in the processBlock. I expected this to just stop any MIDI from passing through the plugin, but when I test it, the midi data still goes through. I cannot figure out why.

I must be misunderstanding the way that the midiBuffer parameter works.


#6

I am not an expert with the MIDI plugins stuff but I do know from reading the topics here on the forum that those kinds of plugins are quite tricky to implement and there are all kinds of surprising behaviors with them. So then it’s not really a surprise that even if you clear the incoming buffer the MIDI events still get through the plugin. It could be something in the JUCE plugin client code or something in the host causing that to happen.


#7

You could look at my process block Plygon


You could also try the JUCE tutorial plugins.
There are a few other midi only plugins up on my git.
Good luck


#8

Thank you!
I’ll try out your code when I have the chance.

I will say that I did try the tutorials, but figured I had done something wrong, and even the arpeggiator example didn’t work. That makes me think that maybe I’m doing something wrong in FL Studio…