Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   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   void controlChange(int number, StkFloat value);
00084 
00085  protected:
00086 
00087   StkFloat computeSample( void );
00088   int setupName(char* instr);
00089   int setupNum(int inst);
00090   int setFreqAndReson(int which, StkFloat freq, StkFloat reson);
00091   void setDecays(StkFloat sndDecay, StkFloat sysDecay);
00092   void setFinalZs(StkFloat z0, StkFloat z1, StkFloat z2);
00093   StkFloat wuter_tick();
00094   StkFloat tbamb_tick();
00095   StkFloat ratchet_tick();
00096 
00097   int instType_;
00098   int ratchetPos_, lastRatchetPos_;
00099   StkFloat shakeEnergy_;
00100   StkFloat inputs_[MAX_FREQS];
00101   StkFloat outputs_[MAX_FREQS][2];
00102   StkFloat coeffs_[MAX_FREQS][2];
00103   StkFloat sndLevel_;
00104   StkFloat baseGain_;
00105   StkFloat gains_[MAX_FREQS];
00106   int nFreqs_;
00107   StkFloat t_center_freqs_[MAX_FREQS];
00108   StkFloat center_freqs_[MAX_FREQS];
00109   StkFloat resons_[MAX_FREQS];
00110   StkFloat freq_rand_[MAX_FREQS];
00111   int freqalloc_[MAX_FREQS];
00112   StkFloat soundDecay_;
00113   StkFloat systemDecay_;
00114   StkFloat nObjects_;
00115   StkFloat totalEnergy_;
00116   StkFloat ratchet_, ratchetDelta_;
00117   StkFloat finalZ_[3];
00118   StkFloat finalZCoeffs_[3];
00119   StkFloat defObjs_[NUM_INSTR];
00120   StkFloat defDecays_[NUM_INSTR];
00121   StkFloat decayScale_[NUM_INSTR];
00122 
00123 };
00124 
00125 #endif

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