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
IsBipolarboolIf 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.
IsNegativeboolIf 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.
SIndexModulator.Source.IndexThe index of the source. It can point to one of the MIDI controllers or one of the predefined sources, depending on the 'isCC' flag.
IsCCboolIf 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.
CurveTypeModulatorCurve.TypeThis 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
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
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
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
Name
public string Name { get; }
Property Value
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
Methods
From(short)
public static Modulator.Source From(short sourceEnum)
Parameters
sourceEnumshort
Returns
GetValue(ISf2Channel, short, Voice)
Gets the current value from this source.
public float GetValue(ISf2Channel channel, short pitchWheel, Voice voice)
Parameters
channelISf2ChannelThe MIDI channel to compute for.
pitchWheelshortThe pitch wheel value, as channel determines if it's a per-note or a global value.
voiceVoiceThe voice to get the data for.
Returns
ID(ControllerSource)
public static int ID(Modulator.Source.ControllerSource e)
Parameters
Returns
Is(CC)
public bool Is(Midi.CC cc)
Parameters
Returns
SourceOf(int)
public static Modulator.Source.ControllerSource SourceOf(int i)
Parameters
iint
Returns
ToSourceEnum()
public short ToSourceEnum()
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.