SynthLab SDK
|
Crossfades two values (from A to B) More...
#include <synthbase.h>
Public Member Functions | |
XFader () | |
simple construction | |
XFader (uint32_t _xfadeTime_Samples) | |
Constructs the object with initial crossfade time in samples. More... | |
void | reset () |
Resets object to initialized state. More... | |
void | setXFadeTime (uint32_t _xfadeTime_Samples) |
Set the current crossfade time. More... | |
void | startCrossfade () |
void | stopCrossfade () |
bool | isCrossfading () |
bool | crossfade (XFadeType xfadeType, double inputA, double inputB, double &output) |
Perform crossfade FROM A to B on a pair of input values to oroduce a single output value. More... | |
Protected Attributes | |
uint32_t | xfadeTime_Samples = 4410 |
the target crossfade time | |
uint32_t | xfadeTime_Counter = 0 |
counter for timer | |
bool | running = false |
state variable | |
Crossfades two values (from A to B)
SynthLab::XFader::XFader | ( | uint32_t | _xfadeTime_Samples | ) |
Constructs the object with initial crossfade time in samples.
_xfadeTime_Samples | the time in samples |
bool SynthLab::XFader::crossfade | ( | XFadeType | xfadeType, |
double | inputA, | ||
double | inputB, | ||
double & | output | ||
) |
Perform crossfade FROM A to B on a pair of input values to oroduce a single output value.
xfadeType | specifies the kind of crossfade XFadeType::kConstantPower, kSquareLaw, kLinear |
inputA | input value for the A channel that is crossfaded FROM |
inputB | input value for the B channel that is crossfaded TO |
output | output value returned from function |
void SynthLab::XFader::reset | ( | ) |
Resets object to initialized state.
initialization
void SynthLab::XFader::setXFadeTime | ( | uint32_t | _xfadeTime_Samples | ) |
Set the current crossfade time.
fader functions