Refactor MIDI stuff to have engine listeners and automation