00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CSL_KARPLUSSTRING_H
00018 #define CSL_KARPLUSSTRING_H
00019
00020 #include "CSL_Core.h"
00021
00022
00023 #include "Noise.h"
00024
00025 namespace csl {
00026
00030
00031 class KarplusString : public UnitGenerator, public Scalable, public Phased {
00032
00033 public:
00034 KarplusString();
00035 KarplusString(float frequency);
00036 void setFrequency(float frequency);
00037 void trigger();
00038 void dump();
00039
00040 void nextBuffer(Buffer &outputBuffer, unsigned outBufNum) throw (CException);
00041 virtual bool isActive() { return (mEnergy > 0); };
00042
00043 Buffer mDelayLine;
00044
00045 protected:
00046 void initDelayLine();
00047 unsigned mIndex;
00048 unsigned mDelayLength;
00049 unsigned mEnergy;
00050 float mFrequency;
00051
00052 };
00053
00054 }
00055
00056 #endif
00057