Port over some code from another project for basic midi stuff.