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 00012 // WaveShaper -- Wave-shaping oscillator class 00013 00014 class WaveShaper : public Sine { 00015 public: 00016 WaveShaper(); 00017 WaveShaper(float frequency, unsigned size = 8192); 00018 00019 void setTableLenght(unsigned length); 00020 unsigned tableLength() { return mTableSize; }; 00021 00022 Buffer mTransferFunction; // the wave-shaping look-up table (it's just a sample buffer) 00023 00024 protected: 00025 status mono_next_buffer(Buffer & inputBuffer, Buffer & outputBuffer, unsigned inBufNum, unsigned outBufNum); 00026 void initWaveTable(); // function to initialize the default shaping table 00027 00028 private: 00029 unsigned mTableSize; 00030 00031 }; // end of class spec. 00032 00033 } // end of namespace 00034 00035 #endif
1.4.5-20051010