decode note-on and note-off events