Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial
00001 /***************************************************/ 00014 /***************************************************/ 00015 00016 #ifndef STK_SINEWAVE_H 00017 #define STK_SINEWAVE_H 00018 00019 const unsigned long TABLE_SIZE = 2048; 00020 00021 #include "Generator.h" 00022 00023 class SineWave : public Generator 00024 { 00025 public: 00027 SineWave( void ); 00028 00030 virtual ~SineWave( void ); 00031 00033 void reset( void ); 00034 00036 00039 void setRate( StkFloat rate ) { rate_ = rate; }; 00040 00042 00048 void setFrequency( StkFloat frequency ); 00049 00051 void addTime( StkFloat time ); 00052 00054 00059 void addPhase( StkFloat angle ); 00060 00062 00067 void addPhaseOffset( StkFloat angle ); 00068 00069 protected: 00070 00071 StkFloat computeSample( void ); 00072 void sampleRateChanged( StkFloat newRate, StkFloat oldRate ); 00073 00074 static StkFrames table_; 00075 StkFloat time_; 00076 StkFloat rate_; 00077 StkFloat phaseOffset_; 00078 00079 }; 00080 00081 #endif
The Synthesis ToolKit in C++ (STK) |
©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |