clean up midi parsing