Are you waiting that the program play all the midi file?
Are you trying to stop it?
Test with a shorter file
I think both. With your posted program when i play and try stop, then program say error - not respond. In my program i just tested with two sounds and continue aries and taurus line. When i try it plays aries sound but then program stopt and no respond before i had a chance lisin taurus sound. My sound start play from calculation answer in date.