Midi Machine OnNote and OnFrame question

A question about priorities of the functions: there are two functions, OnNote and OnFrame. What happens if one occurs while the other is in process? Say the program is in the middle of an OnFrame routine, indexing through an array, and an OnNote event occurs. Is the OnNote ignored? Delayed till after the OnFrame is finished? Is the OnFrame function interupted? Likewise (and probably less likely) what happens when an OnNote is processing and an OnFrame event occurs?

In a similar vein, can two OnNote events collide? Like two notes being played near simultaneously (eg both notes hammered on together) and processed and output by the guitar to midi engine as simultaneous (eg two midi note are output G2M as the same time but different notes). How is that handled in the Midi Machine? Will the OnNote just report one? Or will both be reported sequentially?

I’m asking these questions, because every now and then I seem to lose a note on or off midi command coming out of the Midi Machine. I’m playing exactly the same sequence out of a looper pedal, but when the midi machine is active, I’m sometimes missing a Note On or Note Off type midi output from the MM when two notes are playing. It seems ok in the Midi stream when the MM is not running - I get two midi notes out.

I’m running G2M in Samplitude Pro X6 BTW on a 12th gen i7 PC so plenty of processing power/memory.

Thanks, appreciate any insight into this.

Its made so that there are no threading issues. OnNote is called first for each note, and then OnFrame after.

If you loose a note, it may be because of the MIDI 1.0 convention that a note is identified by its midi pitch at onset. If you change those midi pitches to have unison notes there is no way in MIDI 1.0 to distinguish among them.

In MG3 this will be addressed by MIDI MPE/2.0, but also complicate the MIDI MACHINE framework a bit.

OK, thanks, that helps clarify :slight_smile: