def m21_midievent_to_event(midievent):
    """Convert a music21 MidiEvent to a tuple of MIDI bytes."""
    status = midievent.data + midievent.channel - 1
    return (status, midievent.pitch, midievent.velocity)