logo
Main Page | Namespaces | Classes | Compounds | Files | Compound Members | Related

SynthCore::EnvData Class Reference

Class for storing envelope, and performing interpolation. More...

#include <envelope.h>

List of all members.

Public Types

enum  loopStateEnum { dontLoop, sustainedLoop, alwaysLoop }
 The different states. dontLoop = never loops. sustainedLoop = loops as long key is held. alwaysLoop = loops no matter what.


Public Methods

void clearEnvelope ()
 Clears the Envelope.

void setADSR (float A, float D, float S, float R)
 Creates an factory envelope with attack time A, decay time D, sustain level S (between 0 and 1), and Release time R;.

void setChoosen (int j)
int getChoosen ()
void getLimits (float &x0, float &y0, float &x1, float &y1)
void interpolateLinear ()
void interpolateSpline ()
 Cubic spline interpolation.

void interpolate ()
 Calls the chosen interpolation method.

void removePoint (int p)
void addPoint (float x, float y)
float getValue (long &time, bool loop)
std::string getXML (int indent)
 EnvData ()
 ~EnvData ()

Public Attributes

bool endOfEnvelope
 This flag is set when end of data is reached for the first time.

std::vector< coord * > points
 The anchor-points.

float * envdata
 Interpolated float data.

float sampleLength
 The interpolated array corresponds to this sample length.

int envsize
 The length of the interpolated array.

int beginLP
 Loop-region. the value is an index of 'points'-vector.

int endLP
 Loop-region. the value is an index of 'points'-vector.

int loopStart
 Loop-region: the value is an index of 'envdata'-array.

int loopEnd
 Loop-region: the value is an index of 'envdata'-array.

loopStateEnum loopState
 Defines the loop properties of the envelope.

int choosen
 Set to index of graphically selected anchor point.


Detailed Description

Class for storing envelope, and performing interpolation.

EnvData contains a vector ('points') which defines a number anchor-points in the envelope.

The interpolation routines converts these points into a float array ('envdata')

Todo:
The loop point is unused for now.

Definition at line 47 of file envelope.h.


Member Function Documentation

float SynthCore::EnvData::getValue long &    time,
bool    loop
[inline]
 

This is what you want to call in order to read the envelope data.

Todo:
This also depends on an interpolation method. Should be fixed.

Definition at line 246 of file envelope.cpp.

References endOfEnvelope, envdata, envsize, loopEnd, loopStart, and sampleLength.

Referenced by SynthCore::Envelope3::update().


The documentation for this class was generated from the following files:
Syntopia Project. Visit the web page, or the SourceForge page.
Docs made by Doxygen. Email: Mikael Christensen