00001 // 00002 // WaveShaper.h -- CSL wave-shaping oscillator class that uses a look-up table 00003 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT 00004 // 00005 #ifndef INCLUDE_WAVESHAPER_H 00006 #define INCLUDE_WAVESHAPER_H 00007 00008 #include "Oscillator.h" // my superclass 00009 00010 namespace csl { // my namespace 00011 00015 00016 class WaveShaper : public Sine { 00017 public: 00018 WaveShaper(); 00019 WaveShaper(float frequency, unsigned size = 8192); 00020 00021 void setTableLenght(unsigned length); 00022 unsigned tableLength() { return mTableSize; }; 00023 00024 Buffer mTransferFunction; // the wave-shaping look-up table (it's just a sample buffer) 00025 00026 protected: 00027 status mono_next_buffer(Buffer & inputBuffer, Buffer & outputBuffer, unsigned inBufNum, unsigned outBufNum); 00028 void initWaveTable(); // function to initialize the default shaping table 00029 00030 private: 00031 unsigned mTableSize; 00032 00033 }; // end of class spec. 00034 00035 } // end of namespace 00036 00037 #endif
1.5.8