33 const StkFloat TARGET_THRESHOLD = 0.000001;
76 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
79 StkFloat
tick(
void );
93 void sampleRateChanged( StkFloat newRate, StkFloat oldRate );
106 value_ = factor_ * value_ + constant_;
109 if ( target_ > value_ ) {
110 if ( target_ - value_ <= TARGET_THRESHOLD ) {
116 if ( value_ - target_ <= TARGET_THRESHOLD ) {
121 lastFrame_[0] = value_;
129 #if defined(_STK_DEBUG_)
130 if ( channel >= frames.
channels() ) {
131 oStream_ <<
"Asymp::tick(): channel and StkFrames arguments are incompatible!";
136 StkFloat *samples = &frames[channel];
137 unsigned int hop = frames.
channels();
138 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
STK asymptotic curve envelope class.
Definition: Asymp.h:36
void keyOff(void)
Set target = 0.
void keyOn(void)
Set target = 1.
StkFloat tick(void)
Compute and return one output sample.
Definition: Asymp.h:102
void setTarget(StkFloat target)
Set the target value.
void setValue(StkFloat value)
Set current and target values to value.
StkFloat lastOut(void) const
Return the last computed output value.
Definition: Asymp.h:76
int getState(void) const
Return the current envelope state (0 = at target, 1 otherwise).
Definition: Asymp.h:73
void setTime(StkFloat time)
Set the asymptotic rate based on a time duration (must be > 0).
~Asymp(void)
Class destructor.
Asymp(void)
Default constructor.
void setTau(StkFloat tau)
Set the asymptotic rate via the time factor tau (must be > 0).
void setT60(StkFloat t60)
Set the asymptotic rate such that the target value is perceptually reached (to within -60dB of the ta...
STK abstract unit generator parent class.
Definition: Generator.h:21
An STK class to handle vectorized audio data.
Definition: Stk.h:287
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition: Stk.h:415
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition: Stk.h:418
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
The STK namespace.
Definition: ADSR.h:8