~ubuntu-branches/ubuntu/feisty/muse/feisty

« back to all changes in this revision

Viewing changes to synti/stklib/Shakers.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-23 17:28:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020423172823-w8yplzr81a759xa3
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**********************************************************/
 
2
/*  PhISEM (Physically Informed Stochastic Event Modeling */
 
3
/*    by Perry R. Cook, Princeton, February 1997          */
 
4
/*                                                        */
 
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            */
 
14
/*                                                        */
 
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
/**********************************************************/
 
23
 
 
24
#if !defined(__Shakers_h)
 
25
#define __Shakers_h
 
26
 
 
27
#include "Instrmnt.h"
 
28
 
 
29
#define MAX_FREQS 8
 
30
#define NUM_INSTR 13
 
31
 
 
32
class Shakers : public Instrmnt
 
33
{
 
34
 protected:  
 
35
  int instType;
 
36
  int setFreqAndReson(int which, MY_FLOAT freq, MY_FLOAT reson);
 
37
  int ratchetPos, lastRatchetPos;
 
38
  MY_FLOAT shakeEnergy;
 
39
  MY_FLOAT inputs[MAX_FREQS];
 
40
  MY_FLOAT outputs[MAX_FREQS][2];
 
41
  MY_FLOAT coeffs[MAX_FREQS][2];
 
42
  MY_FLOAT sndLevel;
 
43
  MY_FLOAT baseGain;
 
44
  MY_FLOAT gains[MAX_FREQS];
 
45
  int num_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];
 
51
  MY_FLOAT soundDecay;
 
52
  MY_FLOAT systemDecay;
 
53
  MY_FLOAT num_objects;
 
54
  MY_FLOAT collLikely;
 
55
  MY_FLOAT totalEnergy;
 
56
  MY_FLOAT ratchet,ratchetDelta;
 
57
  MY_FLOAT finalZ[3];
 
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];
 
66
 public:
 
67
  Shakers();
 
68
  ~Shakers();
 
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);
 
73
  MY_FLOAT tick();
 
74
  virtual void controlChange(int number, MY_FLOAT value);
 
75
};
 
76
 
 
77
#endif