a few optimizations on the cb_midi_event_list callback function