record midi to file