I need to read MIDI files in order to do further processing with the notes.
I tried to do so with NAudio like this
MidiFile midi = new MidiFile("Test.mid");
foreach (MidiEvent note in midi.Events[1])
{
Console.Write(note.AbsoluteTime.ToString().PadRight(10));
Console.WriteLine(note.DeltaTime);
}
I was hoping to get the start of the note and the duration, but I get odd values, starting at 34654 (why?):
Question:
I need every MIDI note and
- The start time
- The length
- The channel index
How can I get the correct values using NAudio? If you have suggestions for a different library, please feel free to suggest it.