Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


Shakers.h

00001 #ifndef STK_SHAKERS_H
00002 #define STK_SHAKERS_H
00003 
00004 #include "Instrmnt.h"
00005 
00006 namespace stk {
00007 
00008 /***************************************************/
00060 /***************************************************/
00061 
00062 const int MAX_FREQS = 8;
00063 const int NUM_INSTR = 24;
00064 
00065 class Shakers : public Instrmnt
00066 {
00067  public:
00069   Shakers( void );
00070 
00072   ~Shakers( void );
00073 
00075 
00079   void noteOn( StkFloat instrument, StkFloat amplitude );
00080 
00082   void noteOff( StkFloat amplitude );
00083 
00085   void controlChange( int number, StkFloat value );
00086 
00088   StkFloat tick( unsigned int channel = 0 );
00089 
00090  protected:
00091 
00092   int setupName( char* instr );
00093   int setupNum( int inst );
00094   int setFreqAndReson( int which, StkFloat freq, StkFloat reson );
00095   void setDecays( StkFloat sndDecay, StkFloat sysDecay );
00096   void setFinalZs( StkFloat z0, StkFloat z1, StkFloat z2 );
00097   StkFloat wuter_tick( void );
00098   StkFloat tbamb_tick( void );
00099   StkFloat ratchet_tick( void );
00100 
00101   int instType_;
00102   int ratchetPos_, lastRatchetPos_;
00103   StkFloat shakeEnergy_;
00104   StkFloat inputs_[MAX_FREQS];
00105   StkFloat outputs_[MAX_FREQS][2];
00106   StkFloat coeffs_[MAX_FREQS][2];
00107   StkFloat sndLevel_;
00108   StkFloat baseGain_;
00109   StkFloat gains_[MAX_FREQS];
00110   int nFreqs_;
00111   StkFloat t_center_freqs_[MAX_FREQS];
00112   StkFloat center_freqs_[MAX_FREQS];
00113   StkFloat resons_[MAX_FREQS];
00114   StkFloat freq_rand_[MAX_FREQS];
00115   int freqalloc_[MAX_FREQS];
00116   StkFloat soundDecay_;
00117   StkFloat systemDecay_;
00118   StkFloat nObjects_;
00119   StkFloat totalEnergy_;
00120   StkFloat ratchet_, ratchetDelta_;
00121   StkFloat finalZ_[3];
00122   StkFloat finalZCoeffs_[3];
00123   StkFloat defObjs_[NUM_INSTR];
00124   StkFloat defDecays_[NUM_INSTR];
00125   StkFloat decayScale_[NUM_INSTR];
00126 
00127 };
00128 
00129 } // stk namespace
00130 
00131 #endif

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