00001 /***************************************************/ 00013 /***************************************************/ 00014 00015 #ifndef GRANULATOR_H 00016 #define GRANULATOR_H 00017 00018 #include "Trigger.h" 00019 #include "OscilTimout.h" 00020 #include "Envelope.h" 00021 #include "GenTable.h" 00022 #include "Random.h" 00023 00024 class Granulator : public AudioDrome 00025 { 00026 public: 00027 Granulator (const float &sr, const unsigned int &maxOverlap, GenTable* wave, GenTable* window); 00028 virtual ~Granulator (); 00029 virtual void setDefaults (); 00030 void setOverlap (const unsigned int &maxOverlap); 00031 void setWave (GenTable* wave); 00032 void setWindow (GenTable* window); 00033 void setLevel (const float &volume); 00034 void setWidth (const float &width); 00035 void setAttack (const float &attack); 00036 void setDecay (const float &decay); 00037 void setLength (const float &length); 00038 void setDensity (const float &density); 00039 void setFrequency (const float &frequency); 00040 void setPhase (const float &phase); 00041 void setRndLength (const float &rndLength); 00042 void setRndDensity (const float &rndDensity); 00043 void setRndFrequency (const float &rndFrequency); 00044 void setRndPhase (const float &rndPhase); 00045 virtual void outSig (float& LeftSig,float& RigthSig); 00046 protected: 00047 unsigned int _overlap; 00048 unsigned int* _oscAct; 00049 Random* _rand; 00050 Trigger* _trig; 00051 GenTable* _Wave; 00052 GenTable* _Win; 00053 OscilTimout** _osc; 00054 Envelope** _env; 00055 float* _Left; 00056 float* _Rigth; 00057 float _Volume; 00058 float _Width; 00059 float _Attack; 00060 float _Decay ; 00061 float _Length; 00062 float _Density; 00063 float _Frequency; 00064 float _Phase; 00065 float _RndLength; 00066 float _RndDensity; 00067 float _RndFrequency; 00068 float _RndPhase; 00069 }; 00070 #endif