00001 // 00002 // KarplusString.h -- the simplest possible "physical model" string class 00003 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT 00004 // 00005 00006 /* TODO: 00007 Jorge . . . November 2005 00008 1) Add a dump() function. 00009 2) implement exceptions 00010 3) add DEBUG print code. 00011 4) make it scalable . . . 00012 5) allow for dynamic frequency . . . ? do we want that? 00013 6) add a trigger function . . . (do we need an envelope?) 00014 */ 00015 00016 00017 #ifndef CSL_KARPLUSSTRING_H 00018 #define CSL_KARPLUSSTRING_H 00019 00020 #include "CSL_Core.h" // my superclass 00021 //#include "RingBuffer.h" 00022 //#include "Filters.h" 00023 #include "Noise.h" 00024 00025 namespace csl { // my namespace 00026 00027 // KarplusString -- string model class 00028 00029 class KarplusString : public UnitGenerator, public Scalable, public Phased { 00030 00031 public: 00032 Buffer mDelayLine; 00033 KarplusString(float frequency); 00034 00035 void trigger(); 00036 00037 void dump(); 00038 00039 protected: 00040 void initDelayLine(); 00041 unsigned mIndex; 00042 unsigned mDelayLength; 00043 00044 void nextBuffer(Buffer &outputBuffer, unsigned outBufNum) throw (CException); 00045 00046 00047 }; // end of class spec. 00048 00049 } // end of namespace 00050 00051 #endif 00052
1.4.5-20051010