Say I want to trigger a random note and velocity on an instrument every quarter note. What is the best way to achieve this in AudioKit V5?
The examples seem to use the sequencer to schedule sounds with proper timing, but then you have to add in the notes to the track in advance.
One solution is to pre-generate a bar of random quarter notes with looping enabled - when the bar of random notes is complete, clear the bar and replace with new random notes.
I'm wondering if there's a lower level way of doing this? Some kind of callback that is called with precise timing where I can generate the values as they're needed? Or another approach?
There's nothing that enforces you to have to obey the incoming note data or velocity from the sequencer. Just make your instrument respond to any note ons with a random note and velocity. That way you get the timing without worrying about anything else.