Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial
00001 /***************************************************/ 00031 /***************************************************/ 00032 00033 #ifndef STK_BLITSQUARE_H 00034 #define STK_BLITSQUARE_H 00035 00036 #include "Generator.h" 00037 00038 class BlitSquare: public Generator 00039 { 00040 public: 00042 BlitSquare( StkFloat frequency = 220.0 ); 00043 00045 ~BlitSquare(); 00046 00048 void reset(); 00049 00051 00054 void setPhase( StkFloat phase ) { phase_ = PI * phase; }; 00055 00057 00060 StkFloat getPhase() const { return phase_ / PI; }; 00061 00063 void setFrequency( StkFloat frequency ); 00064 00066 00078 void setHarmonics( unsigned int nHarmonics = 0 ); 00079 00080 protected: 00081 00082 void updateHarmonics( void ); 00083 StkFloat computeSample( void ); 00084 00085 unsigned int nHarmonics_; 00086 unsigned int m_; 00087 StkFloat rate_; 00088 StkFloat phase_; 00089 StkFloat p_; 00090 StkFloat a_; 00091 StkFloat lastBlitOutput_; 00092 StkFloat dcbState_; 00093 }; 00094 00095 #endif
The Synthesis ToolKit in C++ (STK) |
©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |