63 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
66 StkFloat
tick(
void );
80 void sampleRateChanged( StkFloat newRate, StkFloat oldRate );
91 if ( target_ > value_ ) {
93 if ( value_ >= target_ ) {
100 if ( value_ <= target_ ) {
105 lastFrame_[0] = value_;
113 #if defined(_STK_DEBUG_)
114 if ( channel >= frames.
channels() ) {
115 oStream_ <<
"Envelope::tick(): channel and StkFrames arguments are incompatible!";
120 StkFloat *samples = &frames[channel];
121 unsigned int hop = frames.
channels();
122 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
STK linear line envelope class.
Definition: Envelope.h:22
void keyOn(void)
Set target = 1.
Definition: Envelope.h:35
Envelope & operator=(const Envelope &e)
Assignment operator.
void setTarget(StkFloat target)
Set the target value.
~Envelope(void)
Class destructor.
int getState(void) const
Return the current envelope state (0 = at target, 1 otherwise).
Definition: Envelope.h:60
Envelope(void)
Default constructor.
StkFloat tick(void)
Compute and return one output sample.
Definition: Envelope.h:88
void keyOff(void)
Set target = 0.
Definition: Envelope.h:38
void setValue(StkFloat value)
Set current and target values to value.
void setRate(StkFloat rate)
Set the rate.
void setTime(StkFloat time)
Set the rate based on a positive time duration (seconds).
StkFloat lastOut(void) const
Return the last computed output value.
Definition: Envelope.h:63
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