just a few thoughts… not a full programm or even right, anyway it has to morph to a running programm by doin it… i do not - so just a few ideas…
no not done… but i am in a bit in note processing… and have programmed my own note processing devices (with built in sequencer based on MIOS stuff)
so the note stream is getting delayed? to the next tic? maybe not, so to the next beat? but what is the next beat? the source material can be 3/4, 4/4, 5/4, 7/4, 9/4, 11/4 13/4,
so you have to set the counter in your device to the Beat-Structure, of course only when the currently played beat is finished, you could do that with programchange or controll change from your seqencer (ableton?) clips cc function… but that change will then only happen to the next beat (if it is above… for example a currently played 4/4 @ step 15 has to be finished before a 13/4 can be set…
i would run the seq.c and set the tact counter via control change, for ammount i would simply solder a pot to j5A, trippled mode = tact system 3/4
the sequencer tic output + the number generator/counter i would send to a function in main.c where the “buffer arrays = notestacks” are getting triggered.
the buffers itself i would fill in the midi-notify function.
and then your brain has to work…
if you delay a 32the length note-on-message to the next 4/4 beat, and 32th later you delay the note-off-message to the same next 4/4 beat, your probably hear nothing
so you have to counter the tics off the note-on-note-off time,
and then my brain stop getting a clue… you will need a “input buffer” and a “waiting buffer”…
so the easyest way is maybe to make a trigger-function that handles all 127 notes for a channel(hi priority) l, and have a second function that handles note off calculation (which is not hi priority) and dump out note offs - a frtos xtag which is called every ms for example,
the note on off tic time calculation i would do with a flag set in the midi notification function, the flag counter itself is in the trigger function which itself is drivcen from the seq.c? tic sending…
the calculated note off tic time then will be written into the note off buffer - or start the the second function which handles note off calculation (counter every millisecond…)
what should be the interface? programchange/cc + that controlls like on maxforlive? well the hardware will be the easy job…
michi