Table of Contents

Class ModulatorType

Namespace
NAudio.SoundFont
Assembly
NAudio.Core.dll

Modulator source enumerator — the controller that drives a Modulator. Decodes the 16-bit "Sf2 modulator source" bit-field (SoundFont 2.04 §8.2): bits 0-6 are the controller index, bit 7 selects a MIDI continuous controller, bit 8 is the direction, bit 9 is the polarity, and bits 10-15 are the transform/source type.

public class ModulatorType
Inheritance
ModulatorType
Inherited Members

Constructors

ModulatorType(ushort)

Decodes a 16-bit SoundFont modulator source enumeration. Public so the synthesiser can build the implicit default modulators (SoundFont 2.04 §8.4) and so callers can construct modulator routings programmatically.

public ModulatorType(ushort raw)

Parameters

raw ushort

Properties

ControllerSource

The general controller source, valid when IsMidiContinuousController is false.

public ControllerSourceEnum ControllerSource { get; }

Property Value

ControllerSourceEnum

Direction

Direction: false = min-to-max (increasing), true = max-to-min (decreasing).

public bool Direction { get; }

Property Value

bool

IsMidiContinuousController

Whether the source is a MIDI continuous controller (true) or one of the general controllers in ControllerSource (false).

public bool IsMidiContinuousController { get; }

Property Value

bool

MidiContinuousControllerNumber

The MIDI continuous controller number, valid when IsMidiContinuousController is true.

public ushort MidiContinuousControllerNumber { get; }

Property Value

ushort

Polarity

Polarity: false = unipolar (0..1), true = bipolar (-1..1).

public bool Polarity { get; }

Property Value

bool

RawValue

The raw 16-bit source enumeration this type was decoded from. Used to test two modulators for identity (SoundFont 2.04 §9.5).

public ushort RawValue { get; }

Property Value

ushort

SourceType

The transform/source curve applied to the controller value.

public SourceTypeEnum SourceType { get; }

Property Value

SourceTypeEnum

Methods

ToString()

public override string ToString()

Returns

string