Class MidiFileSequence
A MIDI file loaded into the sequencing core: its channel events placed on an EventTimeline<T> at the canonical PPQ (CanonicalPpq), and its tempo changes built into an ITempoMap. Feed it through a SequencedMidiPlayer (or OfflineMidiRenderer) to play it on any IMidiInstrument — the NAudio.Sampler engine, a synthesiser, a hosted VST instrument.
Note/CC/pitch-bend/aftertouch/program and sysex events are kept; other
meta events are dropped except SetTempo, which builds the tempo map.
public sealed class MidiFileSequence
- Inheritance
-
MidiFileSequence
- Inherited Members
Properties
EndTick
The canonical tick of the last event (0 if empty).
public long EndTick { get; }
Property Value
TempoMap
The tempo map built from the file's SetTempo events.
public ITempoMap TempoMap { get; }
Property Value
TimeSignatureMap
The time-signature map built from the file's time-signature meta events (4/4 from tick 0 when the file specifies none). Always non-null.
public TimeSignatureMap TimeSignatureMap { get; }
Property Value
Timeline
The channel events at canonical PPQ.
public EventTimeline<MidiEvent> Timeline { get; }
Property Value
Methods
DurationFrames(int, double)
The number of audio frames needed to render the whole sequence plus a release tail, at the given sample rate.
public long DurationFrames(int sampleRate, double tailSeconds)
Parameters
Returns
FromFile(string)
Loads and parses a MIDI file.
public static MidiFileSequence FromFile(string path)
Parameters
pathstring
Returns
FromMidiFile(MidiFile)
Builds a sequence from an already-parsed MidiFile.
public static MidiFileSequence FromMidiFile(MidiFile midiFile)
Parameters
midiFileMidiFile