Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial


BlitSquare.h

00001 /***************************************************/
00027 /***************************************************/
00028 
00029 #ifndef STK_BLITSQUARE_H
00030 #define STK_BLITSQUARE_H
00031 
00032 #include "Generator.h"
00033 
00034 class BlitSquare: public Generator
00035 {
00036  public:
00038   BlitSquare( StkFloat frequency = 220.0 );
00039 
00041   ~BlitSquare();
00042 
00044   void reset();
00045 
00047 
00050   void setPhase( StkFloat phase ) { phase_ = PI * phase; };
00051 
00053 
00056   StkFloat getPhase() const { return phase_ / PI; };
00057 
00059   void setFrequency( StkFloat frequency );
00060 
00062 
00074   void setHarmonics( unsigned int nHarmonics = 0 );
00075 
00076  protected:
00077 
00078   void updateHarmonics( void );
00079   StkFloat computeSample( void );
00080 
00081   unsigned int nHarmonics_;
00082   unsigned int m_;
00083   StkFloat rate_;
00084   StkFloat phase_;
00085   StkFloat p_;
00086   StkFloat offset_;
00087 };
00088 
00089 #endif

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