// Create a player, and play the music!
try {
Pattern pattern = Pattern.loadPattern(new File(inFilename));
Player player = new Player();
player.saveMidi(pattern, new File(outFilename));
player.play(pattern);
player.close();
} catch (IOException e)
{
e.printStackTrace();