snd_midi_event_encode encoes only first MIDI message. Instead, keep pumping snd_midi_event_encode_byte and when it indicates a fully-formed ALSA sequencer event seen, output it, and if any events output after processing all bytes in the buffer, then drain the output.
Still need to better understand whether need snd_midi_event_reset_encode call is necessary.
snd_midi_event_encode encoes only first MIDI message. Instead, keep pumping snd_midi_event_encode_byte and when it indicates a fully-formed ALSA sequencer event seen, output it, and if any events output after processing all bytes in the buffer, then drain the output. Still need to better understand whether need snd_midi_event_reset_encode call is necessary.