Skip to content
This repository has been archived by the owner on Dec 10, 2017. It is now read-only.

MidiFile Class

Chooper100 edited this page Apr 23, 2016 · 3 revisions

Represents a loaded *.mid file.

Namespace: ReadMIDI

Syntax

public class MidiFile

Constructors

Name Description
MidiFile(string path) Loads a *.mid file from the specified path.

Properties

Name Description
DeltaTicksPerQuarterNote Gets the amount of delta ticks per quarter beat.
TrackCount Gets the amount of tracks, as defined by the MIDI file.
FileFormat Gets the format of the MIDI file.
Tracks Gets the list of tracks and their data.

Example

private void LoadMIDIFile()
{
    // Create the file path
    string path = "test.mid";

    // Load the MIDI file
    MidiFile midi = new MidiFile(path);

    // Output track count
    Console.WriteLine("Track count: " + midi.TrackCount.ToString());
}
Clone this wiki locally