Programming midi notes into a plugin

Hello! I have a synthesizer plugin that currently takes midi input from another channel inside of a DAW. I would like to program midi notes into the plugin so that when it is opened it is already playing a specific note or notes without the user having to play it themselves. Is there a way to do this? I’m trying to use the midi messages class but am having trouble implementing it. Any help would be appreciated thank you.

Hello! Have a look at the Arpeggiator Plugin JUCE demo project. You can generate a midi event with the MidiBuffer::addEvent method.