Move processing MIDI events to a separate function for all plugins to
make it easier to process multiple streams of MIDI data.
(with the added bonus of cleaner code)