/*******************************************/ /* Master Class for Drum Synthesizer */ /* by Perry R. Cook, 1995-96 */ /* */ /* This instrument contains a bunch of */ /* RawWvIn objects, run through a bunch */ /* of one-pole filters. All the */ /* corresponding rawwave files have been */ /* sampled at 22050 Hz. Thus, if the */ /* compile-time SRATE = 22050, then */ /* no interpolation is used. Otherwise, */ /* the rawwave data is appropriately */ /* interpolated for the current SRATE. */ /* You can specify the maximum Polyphony */ /* (maximum number of simultaneous voices)*/ /* in a #define in the .h file. */ /* */ /* Modified for RawWvIn class */ /* by Gary P. Scavone (4/99) */ /*******************************************/ #include "Tabla.h" #include Tabla :: Tabla() : Instrmnt() { int i; for (i=0;iclear(); /* then */ tempWv = waves[0]; tempFilt = filters[0]; for (i=0;isetRate((MY_FLOAT) (22050.0/SRATE)); } waves[numSounding-1]->normalize((MY_FLOAT) 0.4); filters[numSounding-1]->setPole((MY_FLOAT) 0.999 - ((MY_FLOAT) vel * NORM_7 * 0.6)); filters[numSounding-1]->setGain(vel / (MY_FLOAT) 128.0); } else { waves[notDone]->reset(); filters[notDone]->setPole((MY_FLOAT) 0.999 - ((MY_FLOAT) vel * NORM_7 * 0.6)); filters[notDone]->setGain(vel / (MY_FLOAT) 128.0); } #if defined(_debug_) printf("Number Sounding = %i\n",numSounding); for (i=0;itick(waves[i]->lastOut()); if (waves[i]->informTick() == 1) { delete waves[i]; tempFilt = filters[i]; for (j=i;jclear(); sounding[j] = -1; numSounding -= 1; i -= 1; } i++; } return output; }