Added test code for midi functions