title: ios - mixing midi files, each with own sound font
body: <p>I'm looking for a way to mix 2 or more midi files, each with their own sound font files. I've found the following code for one file and tried to do multiple music players but i guess that shouldn't be the right approach. Also i get some weird pop sound every second. </p>
  
  <p>So is there any other way, maybe without the musicplayer and musicsequence methods, using only au units?</p>
  
  <p>Here's the code i found in another thread:</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>