1
/**********************************************************/
2
/* PhISEM (Physically Informed Stochastic Event Modeling */
3
/* by Perry R. Cook, Princeton, February 1997 */
5
/* Meta-model that simulates all of: */
6
/* Maraca Simulation by Perry R. Cook, Princeton, 1996-7 */
7
/* Sekere Simulation by Perry R. Cook, Princeton, 1996-7 */
8
/* Cabasa Simulation by Perry R. Cook, Princeton, 1996-7 */
9
/* Bamboo Windchime Simulation, by Perry R. Cook, 1996-7 */
10
/* Water Drops Simulation, by Perry R. Cook, 1996-7 */
11
/* Tambourine Simulation, by Perry R. Cook, 1996-7 */
12
/* Sleighbells Simulation, by Perry R. Cook, 1996-7 */
13
/* Guiro Simulation, by Perry R. Cook, 1996-7 */
15
/**********************************************************/
16
/* PhOLIES (Physically-Oriented Library of */
17
/* Imitated Environmental Sounds), Perry Cook, 1997-9 */
18
/* Stix1 (walking on brittle sticks) */
19
/* Crunch1 (like new fallen snow, or not) */
20
/* Wrench (basic socket wrench, friend of guiro) */
21
/* Sandpapr (sandpaper) */
22
/**********************************************************/
24
#if !defined(__Shakers_h)
32
class Shakers : public Instrmnt
36
int setFreqAndReson(int which, MY_FLOAT freq, MY_FLOAT reson);
37
int ratchetPos, lastRatchetPos;
39
MY_FLOAT inputs[MAX_FREQS];
40
MY_FLOAT outputs[MAX_FREQS][2];
41
MY_FLOAT coeffs[MAX_FREQS][2];
44
MY_FLOAT gains[MAX_FREQS];
46
MY_FLOAT t_center_freqs[MAX_FREQS];
47
MY_FLOAT center_freqs[MAX_FREQS];
48
MY_FLOAT resons[MAX_FREQS];
49
MY_FLOAT freq_rand[MAX_FREQS];
50
int freqalloc[MAX_FREQS];
56
MY_FLOAT ratchet,ratchetDelta;
58
MY_FLOAT finalZCoeffs[3];
59
void setDecays(MY_FLOAT sndDecay, MY_FLOAT sysDecay);
60
void setFinalZs(MY_FLOAT z0, MY_FLOAT z1, MY_FLOAT z2);
61
MY_FLOAT wuter_tick();
62
MY_FLOAT ratchet_tick();
63
MY_FLOAT defObjs[NUM_INSTR];
64
MY_FLOAT defDecays[NUM_INSTR];
65
MY_FLOAT decayScale[NUM_INSTR];
69
int setupName(char* instr);
70
int setupNum(int inst);
71
virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
72
virtual void noteOff(MY_FLOAT amp);
74
virtual void controlChange(int number, MY_FLOAT value);