I have something along the lines of:
```
private void openFile_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
Nullable<bool> fileResult = dlg.ShowDialog();
if(fileResult.HasValue && fileResult.Value)
{
MidiFile midiFile = new MidiFile(dlg.FileName);
Debug.WriteLine(midiFile.Tracks); //Always 1
}
}
```
I have checked the midi file in other programs and definitely contains more than one track.
Attached is a midi that I can reproduce this issue with.
Comments: I'm afraid I can't that MIDI file, but I suspect it's just a Type 0 MIDI file. In MIDI, there is a difference between a "track" and a "channel". MIDI has 16 channels that you can use, and in a Type 0 MIDI file, all the events for all the channels are stored on a single channel, whilst in Type 1 files you can create as many tracks as you want.
```
private void openFile_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
Nullable<bool> fileResult = dlg.ShowDialog();
if(fileResult.HasValue && fileResult.Value)
{
MidiFile midiFile = new MidiFile(dlg.FileName);
Debug.WriteLine(midiFile.Tracks); //Always 1
}
}
```
I have checked the midi file in other programs and definitely contains more than one track.
Attached is a midi that I can reproduce this issue with.
Comments: I'm afraid I can't that MIDI file, but I suspect it's just a Type 0 MIDI file. In MIDI, there is a difference between a "track" and a "channel". MIDI has 16 channels that you can use, and in a Type 0 MIDI file, all the events for all the channels are stored on a single channel, whilst in Type 1 files you can create as many tracks as you want.