Generating Midi Messages from a JuceAudioPlugin

I am currently attempting to write a plugin which upon recieving midi events will generate midi events for given time periods. I have seen how to generate events upon recieving midi events, but not when no events have been recieved since the plugin on acts on reciept of messages. I can see only two ways of achieving this:

  1. upon recieving the particular events, send the set of events in one go and hope the host will handle the timing correctly.

  2. create a background thread/task within the plugin which generates those events on a timed interval.

Any other ideas?

Thanks,

ambrose adamson.

your plugin will always get regular callbacks, whether there are any messages or not. (Unless I’ve misunderstood what you mean?)

yep, that’s what I meant, it’s just that when I attempted to debug my plugin using tracktion as the host, it only ever seemed to trap my breakpoint in the process function on reciept of messages. I’ll check my breakpoints again.

Ambrose Adamson.