private void SetRealValue(double value, EChangeType changeType) { if (!DSPFunctions.IsZero(Math.Abs(RealValue - value))) { RealValue = value; OnValueChange?.Invoke(changeType); } }
public FrequencyParameter(string name, string label, string shortLabel, double min = 1, double max = 20000, bool canBeAutomated = true) : base(name, label, shortLabel, min, max, 1, canBeAutomated) { if (Min < 0 || DSPFunctions.IsZero(Min)) { throw new ArgumentException(); } }
public double ModifyValue(double currentValue, int sampleNumber) { var gain = Gain.Value; if (DSPFunctions.IsZero(gain)) { return(currentValue); } var amplitude = GetCurrentAmplitude(sampleNumber); gain *= amplitude * Math.Min(currentValue, 1 - currentValue); return(DSPFunctions.Clamp01(currentValue + gain)); }
private bool IsRealValueTrue() { return(!DSPFunctions.IsZero(GetRealValue())); }