csl::Envelope Class Reference

#include <Envelope.h>

Inheritance diagram for csl::Envelope:

csl::UnitGenerator csl::Scalable csl::Model csl::Controllable csl::ADSR csl::AR csl::RandEnvelope csl::Triangle

List of all members.

Public Member Functions

 Envelope ()
 Envelope (LineMode mode, double t, double x1, double y1, double x2=NULL, double y2=1.0, double x3=NULL, double y3=1.0, double x4=NULL, double y4=1.0, double x5=NULL, double y5=1.0, double x6=NULL, double y6=1.0)
 Envelope class.
 Envelope (LineMode mode, double t, unsigned int size, double x[], double y[])
 Envelope (double t, double x1, double y1, double x2=NULL, double y2=1.0, double x3=NULL, double y3=1.0, double x4=NULL, double y4=1.0, double x5=NULL, double y5=1.0, double x6=NULL, double y6=1.0)
 Envelope (double t, unsigned int size, double x[], double y[])
virtual ~Envelope ()
virtual bool isActive ()
 This answers whether I'm active (ptr < end).
void addBreakpoint (double startTime, double value)
void setMode (LineMode mode)
virtual void setDuration (float d)
 set/scale durations
virtual void scaleTimes (float s)
 scale durations
virtual void reset ()
 reset internal time to restart envelope
virtual void trigger ()
 reset internal time to restart envelope
virtual void dump ()
 Pretty-printer.
virtual void nextBuffer (Buffer &outputBuffer, unsigned outBufNum) throw (CException)
 The main FrameStream work method.

Protected Member Functions

unsigned int privateNextBuffer (CPoint *breakpoint, LineSegment *segment, float *buffer, unsigned int numFrames)
 Internal helper method for computing the next buffer.
void createSegments ()
 Allocate memory for the segments.
void calculateSegments ()
 Calculate the internal data.

Protected Attributes

float mDuration
 Total duration, typically in seconds.
float mCurrentMark
 How far we have read.
Breakpoints mSegmentMap
LineSegment ** mSegments
double * mValues
unsigned mSize


Detailed Description

Envelope: a collection of LineSegments; may have an input (scale) and act like a processor, or have no input and act like a control UGen. I inherit Scalable setScale, setOffset for inputs

Constructor & Destructor Documentation

csl::Envelope::Envelope (  )  [inline]

Envelope::Envelope ( LineMode  mode,
double  t,
double  x1,
double  y1,
double  x2 = NULL,
double  y2 = 1.0,
double  x3 = NULL,
double  y3 = 1.0,
double  x4 = NULL,
double  y4 = 1.0,
double  x5 = NULL,
double  y5 = 1.0,
double  x6 = NULL,
double  y6 = 1.0 
)

Envelope class.

Lots of useful constructors

References createSegments(), and mSegmentMap.

Envelope::Envelope ( LineMode  mode,
double  t,
unsigned int  size,
double  x[],
double  y[] 
)

References createSegments(), and mSegmentMap.

Envelope::Envelope ( double  t,
double  x1,
double  y1,
double  x2 = NULL,
double  y2 = 1.0,
double  x3 = NULL,
double  y3 = 1.0,
double  x4 = NULL,
double  y4 = 1.0,
double  x5 = NULL,
double  y5 = 1.0,
double  x6 = NULL,
double  y6 = 1.0 
)

References createSegments(), and mSegmentMap.

Envelope::Envelope ( double  t,
unsigned int  size,
double  x[],
double  y[] 
)

References createSegments(), and mSegmentMap.

Envelope::~Envelope (  )  [virtual]

References mSegmentMap, mSegments, and mValues.


Member Function Documentation

bool Envelope::isActive (  )  [virtual]

This answers whether I'm active (ptr < end).

Reimplemented from csl::UnitGenerator.

Reimplemented in csl::RandEnvelope.

References mCurrentMark, and mDuration.

void Envelope::addBreakpoint ( double  startTime,
double  value 
)

void Envelope::setMode ( LineMode  mode  ) 

References mSegments, and mSize.

void Envelope::setDuration ( float  d  )  [virtual]

void Envelope::scaleTimes ( float  s  )  [virtual]

scale durations

Reimplemented in csl::RandEnvelope.

References calculateSegments(), mDuration, mSegmentMap, mSegments, mSize, mValues, and csl::LineSegment::reset().

Referenced by setDuration().

void Envelope::reset (  )  [virtual]

reset internal time to restart envelope

Reset time to 0.0 to restart envelope.

Reimplemented in csl::RandEnvelope.

References mCurrentMark, mSegments, and mSize.

Referenced by initial_test(), and trigger().

void Envelope::trigger ( void   )  [virtual]

void Envelope::dump ( void   )  [virtual]

Pretty-printer.

Reimplemented from csl::UnitGenerator.

Reimplemented in csl::RandEnvelope.

References csl::LineSegment::dump(), csl::logMsg(), mDuration, mSegments, mSize, and mValues.

void Envelope::nextBuffer ( Buffer outputBuffer,
unsigned  outBufNum 
) throw (CException) [virtual]

The main FrameStream work method.

Reimplemented from csl::UnitGenerator.

Reimplemented in csl::RandEnvelope.

References DECLARE_SCALABLE_CONTROLS, csl::kLogError, LOAD_SCALABLE_CONTROLS, csl::logMsg(), mFrameRate, UPDATE_SCALABLE_CONTROLS, and x.

unsigned int csl::Envelope::privateNextBuffer ( CPoint breakpoint,
LineSegment segment,
float *  buffer,
unsigned int  numFrames 
) [protected]

Internal helper method for computing the next buffer.

void Envelope::createSegments (  )  [protected]

Allocate memory for the segments.

References calculateSegments(), mSegmentMap, mSegments, and mValues.

Referenced by addBreakpoint(), and Envelope().

void Envelope::calculateSegments (  )  [protected]


Member Data Documentation

float csl::Envelope::mDuration [protected]

float csl::Envelope::mCurrentMark [protected]

How far we have read.

Referenced by calculateSegments(), isActive(), csl::AR::release(), csl::ADSR::release(), and reset().

double* csl::Envelope::mValues [protected]

unsigned csl::Envelope::mSize [protected]


The documentation for this class was generated from the following files:

Generated on Thu Sep 17 23:14:17 2009 for CSL by  doxygen 1.5.8