title: Playing midi files with MusicPlayer & Music Sequence
body: <p>I've successfully gotten iOS to play a .mid (midi) file with a soundfont sample using the following code:</p>
  
  <pre><code>-(void) playMusic:(NSString*) name
  {
      NSString *presetURLPath = [[NSBundle mainBundle] pathForResource:@"GortsMiniPianoJ1" ofType:@"SF2"];
      NSURL * presetURL = [NSURL fileURLWithPath:presetURLPath]; 
      [self loadFromDLSOrSoundFont: (NSURL *)presetURL withPatch: (int)3];
  
      NSString *midiFilePath = [[NSBundle mainBundle] pathForResource:name ofType:@"mid"];
      NSURL * midiFileURL = [NSURL fileURLWithPath:midiFilePath];
  
      NewMusicPlayer(&amp;musicPlayer);
  
      if (NewMusicSequence(&amp;musicSequence) != noErr) 
      {
          [NSException raise:@"play" format:@"Can't create MusicSequence"];  
      }
  
      if(MusicSequenceFileLoad(musicSequence, (CFURLRef)midiFileURL, 0, 0 != noErr)) 
      {
          [NSException raise:@"play" format:@"Can't load MusicSequence"];
      }
  
      MusicPlayerSetSequence(musicPlayer, musicSequence);
      MusicSequenceSetAUGraph(musicSequence, _processingGraph);
      MusicPlayerPreroll(musicPlayer);
      MusicPlayerStart(musicPlayer);
  }
  </code></pre>
  
  <p>However, the problem comes when I then try to play a second file when the first is still playing.</p>
  
  <p>I've tried many variations. Firstly, the above code will play both tracks simultaneously. Or, I've tried:</p>
  
  <pre><code>DisposeMusicPlayer(musicPlayer);
  DisposeMusicSequence(musicSequence);
  </code></pre>
  
  <p>Before the <code>NewMusicPlayer(&amp;musicPlayer)</code>, but this produces a weird version of the tune with only sporadic notes being played. </p>
  
  <p>I'd love to simply call this method, and the next track to be played.</p>