I'd like to build a MIDI-level arpeggiator in Plug'N Script. This would require me to schedule events in time that would occur separately from the MIDI stream.
Has anyone managed to schedule events to be processed later in time in Plug'N Script?
I'm aware of how to do this with the MIDI metronome signals, but seek something more flexible. The target MIDI controller doesn't generate these.
Thanks everyone!
any way to schedule events in time in Plug'n Script?
-
- KVRer
- 23 posts since 28 Jun, 2021
One approach would be to create a buffer of MIDI notes each time a note is received in the input stream. Process that buffer to delay the notes as desired. If a new note comes in at the input stream, clear the buffer and fill it with new notes.
It would be nice to see an official example that shows how to delay MIDI events, or schedule future events. An arp, MIDI echo / delay, etc would be welcome.
It would be nice to see an official example that shows how to delay MIDI events, or schedule future events. An arp, MIDI echo / delay, etc would be welcome.
-
Blue Cat Audio Blue Cat Audio https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=39981
- KVRAF
- 5846 posts since 8 Sep, 2004 from Paris (France)
To schedule events in the future you indeed have to store them in a buffer, and wait until enough time has passed by. Each note in the buffer should have a timestamp in the future, and you subtract the length of the audio buffer until it reaches a value below the length of the audio buffer. When this happens it is time to send the event to the output.