Scheduling midi notes to play in the future

Does JUCE include any kind of midi event scheduler other then the actual midi buffer? (in the context of a midi plugin) If I want to setup an 8 bar phrase to play back, for example, My understanding is that on each call to ProcessBlock I will need to add the relevant midi events to the midi buffer so that the host will send them on down the chain to the next plugins, etc. That is fine, but I’m wondering if JUCE has any built in classes to maintain a longer-term sequence of midi events that I can build up the sequence that needs to be played and then maybe on each call to process block just call a single method to do that work, or something of this nature? Or do i need to build this capability myself. its not a big deal, i just want to make sure I’m not reinventing the wheel if some kind of support is already in JUCE for maintaining a midi sequence longer then the current midi buffer. ??

1 Like

Not AFAIK, you need to build it yourself. I guess there are tons of ways to do it, but a simple one would be an array of values (notes) with the size of number of beats, then you count samples in the processBlock as a time measure to know when you will trigger next beat (that will depend on BPM, sample rate, block size, etc.). When the next beat has to be triggered, you just increase the array index and read the corresponding note value that you will enqueue as a midi message

1 Like

Yeap. If I build something myself I’ll make a class with a few more features for future use, but anyway I get your point. Thanks for responding.