Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial


Asymp Class Reference

#include <Asymp.h>

Inheritance diagram for Asymp:

Envelope Generator Stk List of all members.

Detailed Description

STK asymptotic curve envelope class.

This class implements a simple envelope generator which asymptotically approaches a target value. The algorithm used is of the form:

x[n] = a x[n-1] + (1-a) target,

where a = exp(-T/tau), T is the sample period, and tau is a time constant. The user can set the time constant (default value = 0.3) and target value. Theoretically, this recursion never reaches its target, though the calculations in this class are stopped when the current value gets within a small threshold value of the target (at which time the current value is set to the target). It responds to keyOn and keyOff messages by ramping to 1.0 on keyOn and to 0.0 on keyOff.

by Perry R. Cook and Gary P. Scavone, 1995 - 2004.

Definition at line 33 of file Asymp.h.

Public Member Functions

 Asymp (void)
 Default constructor.

 ~Asymp (void)
 Class destructor.

void keyOn (void)
 Set target = 1.

void keyOff (void)
 Set target = 0.

void setTau (StkFloat tau)
 Set the asymptotic rate via the time factor tau (must be > 0).

void setTime (StkFloat time)
 Set the asymptotic rate based on a time duration (must be > 0).

void setTarget (StkFloat target)
 Set the target value.

StkFloat tick (void)
 Return one envelope output value.

StkFloat * tick (StkFloat *vector, unsigned int vectorSize)
 Compute vectorSize outputs and return them in vector.

StkFramestick (StkFrames &frames, unsigned int channel=1)
 Fill a channel of the StkFrames object with computed outputs.


Member Function Documentation

void Asymp::setTau StkFloat  tau  ) 
 

Set the asymptotic rate via the time factor tau (must be > 0).

The rate is computed as described above. The value of tau must be greater than zero. Values of tau close to zero produce fast approach rates, while values greater than 1.0 produce rather slow rates.

StkFrames& Asymp::tick StkFrames frames,
unsigned int  channel = 1
[virtual]
 

Fill a channel of the StkFrames object with computed outputs.

The channel argument should be one or greater (the first channel is specified by 1). An StkError will be thrown if the channel argument is zero or it is greater than the number of channels in the StkFrames object.

Reimplemented from Envelope.


The documentation for this class was generated from the following file:
The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.