Rewrite to use python-midi library