Added logic to interpret midi numbers, and to send midi events.