Table of Contents

Class OfflineMidiRenderer

Namespace
NAudio.Midi
Assembly
NAudio.Midi.dll

Renders a MidiFileSequence through an IMidiInstrument offline (faster than real time), to an in-memory buffer or a WAV file. The rendering is sample-accurate (events are dispatched at their exact frame), deterministic, and needs no audio hardware.

public static class OfflineMidiRenderer
Inheritance
OfflineMidiRenderer
Inherited Members

Methods

Render(MidiFileSequence, IMidiInstrument, double)

Renders the sequence to an interleaved float buffer, including a release tail. The instrument's sample rate drives the render.

public static float[] Render(MidiFileSequence sequence, IMidiInstrument instrument, double tailSeconds = 2)

Parameters

sequence MidiFileSequence
instrument IMidiInstrument
tailSeconds double

Returns

float[]

RenderToWaveFile(MidiFileSequence, IMidiInstrument, string, double)

Renders the sequence straight to a WAV file (32-bit float), streaming in blocks so memory stays flat regardless of length.

public static void RenderToWaveFile(MidiFileSequence sequence, IMidiInstrument instrument, string outputPath, double tailSeconds = 2)

Parameters

sequence MidiFileSequence
instrument IMidiInstrument
outputPath string
tailSeconds double