Struct Modulator.Source

Namespace
SpessaSharp.SoundBank
Assembly
SpessaSharp.dll
public readonly record struct Modulator.Source : IEquatable<Modulator.Source>
Implements
Inherited Members

Constructors

Source(bool, bool, Index, bool, Type)

public Source(bool IsBipolar, bool IsNegative, Modulator.Source.Index SIndex, bool IsCC, ModulatorCurve.Type CurveType)

Parameters

IsBipolar bool

If this field is set to false, the controller should be mapped with a minimum value of 0 and a maximum value of 1. This is also called Unipolar. Thus, it behaves similar to the Modulation Wheel controller of the MIDI specification. If this field is set to true, the controller should be mapped with a minimum value of -1 and a maximum value of 1. This is also called Bipolar. Thus, it behaves similar to the Pitch Wheel controller of the MIDI specification.

IsNegative bool

If this field is set true, the direction of the controller should be from the maximum value to the minimum value. So, for example, if the controller source is Key Number, then a Key Number value of 0 corresponds to the maximum possible controller output, and the Key Number value of 127 corresponds to the minimum possible controller input.

SIndex Modulator.Source.Index

The index of the source. It can point to one of the MIDI controllers or one of the predefined sources, depending on the 'isCC' flag.

IsCC bool

If this field is set to true, the MIDI Controller Palette is selected. The ‘index’ field value corresponds to one of the 128 MIDI Continuous Controller messages as defined in the MIDI specification.

CurveType ModulatorCurve.Type

This field specifies how the minimum value approaches the maximum value.

Properties

CurveType

This field specifies how the minimum value approaches the maximum value.

public ModulatorCurve.Type CurveType { get; init; }

Property Value

ModulatorCurve.Type

IsBipolar

If this field is set to false, the controller should be mapped with a minimum value of 0 and a maximum value of 1. This is also called Unipolar. Thus, it behaves similar to the Modulation Wheel controller of the MIDI specification. If this field is set to true, the controller should be mapped with a minimum value of -1 and a maximum value of 1. This is also called Bipolar. Thus, it behaves similar to the Pitch Wheel controller of the MIDI specification.

public bool IsBipolar { get; init; }

Property Value

bool

IsCC

If this field is set to true, the MIDI Controller Palette is selected. The ‘index’ field value corresponds to one of the 128 MIDI Continuous Controller messages as defined in the MIDI specification.

public bool IsCC { get; init; }

Property Value

bool

IsNegative

If this field is set true, the direction of the controller should be from the maximum value to the minimum value. So, for example, if the controller source is Key Number, then a Key Number value of 0 corresponds to the maximum possible controller output, and the Key Number value of 127 corresponds to the minimum possible controller input.

public bool IsNegative { get; init; }

Property Value

bool

Name

public string Name { get; }

Property Value

string

SIndex

The index of the source. It can point to one of the MIDI controllers or one of the predefined sources, depending on the 'isCC' flag.

public Modulator.Source.Index SIndex { get; init; }

Property Value

Modulator.Source.Index

Methods

From(short)

public static Modulator.Source From(short sourceEnum)

Parameters

sourceEnum short

Returns

Modulator.Source

GetValue(ISf2Channel, short, Voice)

Gets the current value from this source.

public float GetValue(ISf2Channel channel, short pitchWheel, Voice voice)

Parameters

channel ISf2Channel

The MIDI channel to compute for.

pitchWheel short

The pitch wheel value, as channel determines if it's a per-note or a global value.

voice Voice

The voice to get the data for.

Returns

float

ID(ControllerSource)

public static int ID(Modulator.Source.ControllerSource e)

Parameters

e Modulator.Source.ControllerSource

Returns

int

Is(CC)

public bool Is(Midi.CC cc)

Parameters

cc Midi.CC

Returns

bool

SourceOf(int)

public static Modulator.Source.ControllerSource SourceOf(int i)

Parameters

i int

Returns

Modulator.Source.ControllerSource

ToSourceEnum()

public short ToSourceEnum()

Returns

short

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.