Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial


Shakers.h

00001 /***************************************************/
00053 /***************************************************/
00054 
00055 #ifndef STK_SHAKERS_H
00056 #define STK_SHAKERS_H
00057 
00058 #include "Instrmnt.h"
00059 
00060 const int MAX_FREQS = 8;
00061 const int NUM_INSTR = 24;
00062 
00063 class Shakers : public Instrmnt
00064 {
00065  public:
00067   Shakers();
00068 
00070   ~Shakers();
00071 
00073 
00077   void noteOn(StkFloat instrument, StkFloat amplitude);
00078 
00080   void noteOff(StkFloat amplitude);
00081 
00083   StkFloat tick();
00084 
00086   StkFloat *tick(StkFloat *vector, unsigned int vectorSize);
00087 
00089 
00095   StkFrames& tick( StkFrames& frames, unsigned int channel = 1 );
00096 
00098   void controlChange(int number, StkFloat value);
00099 
00100  protected:
00101 
00102   int setupName(char* instr);
00103   int setupNum(int inst);
00104   int setFreqAndReson(int which, StkFloat freq, StkFloat reson);
00105   void setDecays(StkFloat sndDecay, StkFloat sysDecay);
00106   void setFinalZs(StkFloat z0, StkFloat z1, StkFloat z2);
00107   StkFloat wuter_tick();
00108   StkFloat tbamb_tick();
00109   StkFloat ratchet_tick();
00110 
00111   int instType_;
00112   int ratchetPos_, lastRatchetPos_;
00113   StkFloat shakeEnergy_;
00114   StkFloat inputs_[MAX_FREQS];
00115   StkFloat outputs_[MAX_FREQS][2];
00116   StkFloat coeffs_[MAX_FREQS][2];
00117   StkFloat sndLevel_;
00118   StkFloat baseGain_;
00119   StkFloat gains_[MAX_FREQS];
00120   int nFreqs_;
00121   StkFloat t_center_freqs_[MAX_FREQS];
00122   StkFloat center_freqs_[MAX_FREQS];
00123   StkFloat resons_[MAX_FREQS];
00124   StkFloat freq_rand_[MAX_FREQS];
00125   int freqalloc_[MAX_FREQS];
00126   StkFloat soundDecay_;
00127   StkFloat systemDecay_;
00128   StkFloat nObjects_;
00129   StkFloat totalEnergy_;
00130   StkFloat ratchet_, ratchetDelta_;
00131   StkFloat finalZ_[3];
00132   StkFloat finalZCoeffs_[3];
00133   StkFloat defObjs_[NUM_INSTR];
00134   StkFloat defDecays_[NUM_INSTR];
00135   StkFloat decayScale_[NUM_INSTR];
00136 
00137 };
00138 
00139 #endif

The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.