i used this small js-thing for experimentation and checking the midi event offsets.. the (normally black) gfx area flashes red for a moment if the events for the current block is _not_ sorted by offset properly. or, actually, when any of the midi events have an offset which is smaller than any of the previous events in the block.. i have a track playing with an item full of midi notes, and at the same time hammer away on an external midi keyboard, and also, at the same time another track which is sending midi events to this track.. seems like (especially) the realtime midi keyboard events are not sorted in with the rest, but appended to the end of the list of events... so, again, will the midi events be sorted by reaper in the future, will there be a kind of sort_events() function in js, or should i still do the sorting myself for plugins where the order is really important? if not, there could be conflicts, note off coming in before note on, etc... or i could check every single event for every sample or every block i process, which could be quite inefficient in some situations, with lots of events, very-very small note length, etc, ... Code: