Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DenormalizePosition ¶
DenormalizePosition returns the value of currVal in the startVal and endVal range
func NormalisePosition ¶
NormalisePosition returns the normalized [0-1] position for currPos, between startPos and endPos
Types ¶
type EaseIn ¶
type EaseIn struct {
Power float64
}
type EaseInOut ¶
type EaseInOut struct {
Power float64
}
func NewEaseInOut ¶
func NewEaseInOut() *EaseInOut
NewEaseInOut creates a new ease-in-out object for envelope processing. The has a slow start and end, and a fast middle section. The power determines the steepness of the curve and needs to be [>=1]. Values like 2-3 gives a smooth transition, while >5 gives a steep curve.
type EaseOut ¶
type EaseOut struct {
Power float64
}
func NewEaseOut ¶
NewEaseOut creates a new ease-out object for envelope processing. The curve has a fast start with a slow end. The power determines the steepness of the curve and needs to be [>=1]. Values like 2-3 gives a smooth transition, while >5 gives a steep curve.
type Exponential ¶
type Exponential struct {
Factor float64 // >5
}
func NewExponential ¶
func NewExponential(factor float64) *Exponential
NewExponential creates a new exponential interpolation object for envelope processing. Factor must be [>5].
func (Exponential) GetValue ¶
func (exp Exponential) GetValue(startPos, endPos, currPos uint) float64
GetValue does a exponential interpolation between startPos and endPos. Returns the normalized value [0-1] at currPos.
type InverseExponential ¶
type InverseExponential struct {
Factor float64 // >5
}
func NewInverseExponential ¶
func NewInverseExponential() *InverseExponential
NewInverseExponential creates a new inverse exponential interpolation object for envelope processing. Factor must be [>5].
func (InverseExponential) GetValue ¶
func (invexp InverseExponential) GetValue(startPos, endPos, currPos uint) float64
GetValue does an inverse exponential interpolation between startPos and endPos. Returns the normalized value [0-1] at currPos.
type InverseLogarithmic ¶
type InverseLogarithmic struct {
Base float64
}
func NewInverseLogarithmic ¶
func NewInverseLogarithmic(base float64) *InverseLogarithmic
NewInverseLogarithmic creates a new inverse logarithmic interpolation object for envelope processing. The base should be [>1]. Recommended default: 10
func (InverseLogarithmic) GetValue ¶
func (invlog InverseLogarithmic) GetValue(startPos, endPos, currPos uint) float64
GetValue does a logarithmic interpolation between startPos and endPos. Returns the normalized value [0-1] at currPos.
type LERP ¶
type LERP struct {
}
type Logarithmic ¶
type Logarithmic struct {
Base float64
}
func NewLogarithmic ¶
func NewLogarithmic(base float64) *Logarithmic
NewLogarithmic creates a new logarithmic interpolation object for envelope processing. The base should be [>1]. Recommended default: 10
func (Logarithmic) GetValue ¶
func (log Logarithmic) GetValue(startPos, endPos, currPos uint) float64
GetValue does a logarithmic interpolation between startPos and endPos. Returns the normalized value [0-1] at currPos.
type SCurve ¶
func NewSCurve ¶
NewSCurve creates a new SCurve object for envelope processing.
The sharpness determines the steepness of the S-curve. Low sharpness means a more gradual transition, high sharpness means a steeper curve. Use positive values here, like 1.0, 5.0, 10.0, ...
The midpoint specifies the X-axis value where the curve inflection occurs. This value should be in the range [0-1]