iso::synth::Grain Class Reference

Grain grain class for granular synthesis. More...

#include <iso_synth_grain.h>

Collaboration diagram for iso::synth::Grain:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Grain (GranularUnit *pUnit)
 create grain
 Grain (GranularUnit *pUnit, const Buffer &pAudio, const PointList &pPointList) throw (SynthException)
 create grain
 ~Grain ()
 destructor
void addGrain (Buffer &pBuffer) throw (SynthException)
 add audio from grain to buffer
void addGrain (Buffer &pBuffer, unsigned int pBufferOffset) throw (SynthException)
 add audio from grain to buffer
void addEnvelope (Channel &pChannel)
 add envelope from grain to channel
void addEnvelope (Channel &pChannel, unsigned int pChannelOffset)
 add envelope from grain to channel
bool finished () const
 return true if grain has reached it's end, false otherwise
void reset ()
 reset grain playback
void reset (const Buffer &pAudio, const PointList &pPointList) throw (SynthException)
 reset audio data, amplitude envelope and playback position
void reset (const Buffer &pAudio) throw (SynthException)
 reset audio data and playback position
void reset (const PointList &pPointList)
 reset amplitude envelope and playback position
void setAmplitude (const Frame &pAmplitude) throw (SynthException)
 set amplitude
virtual base::String info () const
 obtain textual grain information

Protected Member Functions

 Grain ()
 default constructor

Protected Attributes

GranularUnitmUnit
 pointer to the unit this grain belongs to
Buffer mAudio
 audio data
Channel mEnvelope
 envelope data
Frame mAmplitude
 amplitude data
PointList mPointList
 envelope point list
PointListInterpolStrategymEnvelopeStrategy
 envelope generator
unsigned int mCurrentPlayIndex
 internal index into audio buffer for copying

Static Protected Attributes

static unsigned int sFrameCount
 default frame count

Friends

std::ostream & operator<< (std::ostream &pOstream, const Grain &pGrain)
 print unit information

Detailed Description

Grain grain class for granular synthesis.

for granular synthesis

Created by Daniel Bisig on 6/14/07.


Constructor & Destructor Documentation

Grain::Grain ( GranularUnit pUnit  ) 

create grain

Parameters:
pUnit granular unit this grain belongs to

Grain::Grain ( GranularUnit pUnit,
const Buffer pAudio,
const PointList pPointList 
) throw (SynthException)

create grain

Parameters:
pUnit granular unit this grain belongs to
pAudio audio data
pPointList amplitude envelope
Exceptions:
SynthException channelcount mismatch between associated unit and audio buffer

Grain::~Grain (  ) 

destructor

Grain::Grain (  )  [protected]

default constructor


Member Function Documentation

void Grain::addGrain ( Buffer pBuffer  )  throw (SynthException)

add audio from grain to buffer

Parameters:
pBuffer buffer
Exceptions:
SynthException channelcount mismatch between associated unit and audio buffer

void Grain::addGrain ( Buffer pBuffer,
unsigned int  pBufferOffset 
) throw (SynthException)

add audio from grain to buffer

Parameters:
pBuffer buffer
pBufferOffset offset into buffer
Exceptions:
SynthException channelcount mismatch between associated unit and audio buffer

void Grain::addEnvelope ( Channel pChannel  ) 

add envelope from grain to channel

Parameters:
pChannel channel

void Grain::addEnvelope ( Channel pChannel,
unsigned int  pChannelOffset 
)

add envelope from grain to channel

Parameters:
pChannel channel
pChannelOffset offset into channel

bool Grain::finished (  )  const

return true if grain has reached it's end, false otherwise

void Grain::reset (  ) 

reset grain playback

playback of grain will start again at it's beginning

void Grain::reset ( const Buffer pAudio,
const PointList pPointList 
) throw (SynthException)

reset audio data, amplitude envelope and playback position

Parameters:
pAudio audio data
pPointList amplitude envelope
Exceptions:
SynthException channelcount mismatch between associated unit and audio buffer

void Grain::reset ( const Buffer pAudio  )  throw (SynthException)

reset audio data and playback position

Parameters:
pAudio audio data
Exceptions:
SynthException channelcount mismatch between associated unit and audio buffer

void Grain::reset ( const PointList pPointList  ) 

reset amplitude envelope and playback position

Parameters:
pPointList amplitude envelope

void Grain::setAmplitude ( const Frame pAmplitude  )  throw (SynthException)

set amplitude

Parameters:
pAmplitude amplitude
Exceptions:
SynthException channelcount mismatch between associated unit and amplitude frame

base::String Grain::info (  )  const [virtual]

obtain textual grain information

Returns:
String containing grain information


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOstream,
const Grain pGrain 
) [friend]

print unit information


Member Data Documentation

unsigned int Grain::sFrameCount [static, protected]

default frame count

GranularUnit* iso::synth::Grain::mUnit [protected]

pointer to the unit this grain belongs to

Buffer iso::synth::Grain::mAudio [protected]

audio data

Channel iso::synth::Grain::mEnvelope [protected]

envelope data

Frame iso::synth::Grain::mAmplitude [protected]

amplitude data

PointList iso::synth::Grain::mPointList [protected]

envelope point list

PointListInterpolStrategy* iso::synth::Grain::mEnvelopeStrategy [protected]

envelope generator

unsigned int iso::synth::Grain::mCurrentPlayIndex [protected]

internal index into audio buffer for copying


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 14:18:45 2011 for synth by  doxygen 1.5.1