Creating MIDI CC messages and passing them to the host?


I am trying to make a very simple plugin that uses values from a few sliders to generate MIDI CCs that are passed to the host which outputs them to a piece of hardware. I understand that in order to “output” MIDI messages from a plugin, you need to create a copy of the buffer received from the host, add your messages and then pass this back to the host. This works fine with MIDI note messages but does not seem to work with MIDI CCs. I have looked at all of the tutorials and have only been able to find examples adding note messages to the buffer e.g. the arpeggiator tutorial. I feel like there should be a straightforward way of doing this that I am missing, any ideas? I’ve tried VST and VST3 with Reaper as the host. Another further question, should I be selecting “MIDI effect plugin” or “Plugin outputs MIDI” in the projucer settings?

Thanks very much in advance for anyone who can help me with the this.

It should work with VST, but not VST3. See this:

Ok thanks for the help. Since I’m just using MIDI as a means of getting a slider value from a plugin to a USB MIDI device (Arduino), I’m going to try continuously sending a note message that’s velocity is updated by a slider. The Arduino can then use the velocity value to perform it’s calculations. I guess it doesn’t matter if I use note messages or CCs because I’m customising how the Arduino uses the messages it receives, rather then trying to control a synth that follows the conventional use of different MIDI messages. Am I right in saying that all MIDI messages regardless of type are all delivered to and within the host at the same time since they are contained in the same buffer?

Sorry if any of this seems very trivial, I’m not that well versed in how MIDI works with plugins/Hosts.