// name: Karplus.h #ifndef __KARPLUS_H__ #define __KARPLUS_h__ #include using namespace std; #define SAMPLE double class Karplus { public: Karplus(); Karplus(int midinum, int velocity); ~Karplus(); SAMPLE getNextSample(); void print(); // for debugging, prints myDelay vector private: int myMidinum; int myVelocity; int myDelayLen; double myAmplitude; double myAttenuation; long myReader; long myWriter; int mySampleIndex; // for getNextSample() SAMPLE * myDelay; void setDelayLen(); // sets myDelayLen according to midinum void setDelay(); // populates myDelay vector double mtof( int f ); // used in setDelayLen() }; #endif