Play Specific MIDI Track Using MD_MIDIFile?

Does anyone know if there is there a way to play a specific track in a MIDI file using the MD_MIDIFile library? I am looking through the docs and I was able to display the number of tracks using SMF.getTrackCount but I am not seeing something that I could use to specify a single track to play.

I think I found my answer: MD_MFTrack Class. Not sure how I missed this before but I will check it out.

I've been trying to use the MD_MFTrack class but getting stuck. I am able to get the track count and then I use the left/right buttons to select the track number and store it in 'selTrk'. I created an MD_MFTrack object named 'MFT' and I have added a case to the MD_MIDIFile_Play_LCD.ino example that attempts to play the track number in 'selTrk' but it gets hung up. I am probably not using the methods correctly. Can anyone help point me in the right direction?

		case MSProcessTrk:
		// Play the specified MIDI track
		MFT.load(selTrk, *fname);
		
		if (!MFT.getEndOfTrack())
		{
			MFT.getNextEvent(*fname, 0);
			
			char  sBuf[10];
			
			sprintf(sBuf, "CurTrk%2d", selTrk);
			LCDMessage(0, LCD_COLS-strlen(sBuf), sBuf, true);
		}
		else
		s = MSClose;

You play a specific track in a MIDI file by ignoring all the callbacks with MIDI information that don't include the track you want to listen to. Similarly you could ignore a track by playing all the others.

You should never need to use anything in MFTrack directly.

I appreciate the advice. Do you happen to have a quick example you could share of ignoring the callbacks?

Not really, but it is straightforward. You will see from example the callback code that the pev->channel field nominates the channel associated with the callback. Just use an if statement to filter out the channel you want to handle (ie, just do Serial.write() if the channel matches your desired channel).

void midiCallback(midi_event *pev)
// Called by the MIDIFile library when a file event needs to be processed
// thru the midi communications interface.
// This callback is set up in the setup() function.
{
#if USE_MIDI
  if ((pev->data[0] >= 0x80) && (pev->data[0] <= 0xe0))
  {
    Serial.write(pev->data[0] | pev->channel);
    Serial.write(&pev->data[1], pev->size-1);
  }
  else
    Serial.write(pev->data, pev->size);
#endif
  DEBUG("\n");
  DEBUG(millis());
  DEBUG("\tM T");
  DEBUG(pev->track);
  DEBUG(":  Ch ");
  DEBUG(pev->channel+1);
  DEBUG(" Data ");
  for (uint8_t i=0; i<pev->size; i++)
  {
  DEBUGX(pev->data[i]);
    DEBUG(' ');
  }
}