~ubuntu-branches/ubuntu/karmic/muse/karmic-proposed

« back to all changes in this revision

Viewing changes to synti/stklib/DrumSynt.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
/*  Master Class for Drum Synthesizer      */
 
3
/*  by Perry R. Cook, 1995-96              */
 
4
/*                                         */
 
5
/*  This instrument contains a bunch of    */
 
6
/*  RawWvIn objects, run through a bunch   */
 
7
/*  of one-pole filters.  All the          */
 
8
/*  corresponding rawwave files have been  */
 
9
/*  sampled at 22050 Hz.  Thus, if the     */
 
10
/*  compile-time SRATE = 22050, then       */
 
11
/*  no interpolation is used.  Otherwise,  */
 
12
/*  the rawwave data is appropriately      */
 
13
/*  interpolated for the current SRATE.    */
 
14
/*  You can specify the maximum Polyphony  */
 
15
/*  (maximum number of simultaneous voices)*/
 
16
/*  in a #define in the .h file.           */
 
17
/*                                         */
 
18
/*  Modified for RawWvIn class             */
 
19
/*  by Gary P. Scavone (4/99)              */
 
20
/*******************************************/
 
21
 
 
22
#if !defined(__DrumSynt_h)
 
23
#define __DrumSynt_h
 
24
 
 
25
#include "Instrmnt.h"
 
26
#include "RawWvIn.h"
 
27
#include "OnePole.h"
 
28
 
 
29
#define DRUM_NUMWAVES 11
 
30
#define DRUM_POLYPHONY 4
 
31
 
 
32
class DrumSynt : public Instrmnt
 
33
{
 
34
  protected:  
 
35
    RawWvIn  *waves[DRUM_POLYPHONY];
 
36
    OnePole  *filters[DRUM_POLYPHONY];
 
37
    int      sounding[DRUM_POLYPHONY];
 
38
    int      numSounding;
 
39
  public:
 
40
    DrumSynt();
 
41
    ~DrumSynt();
 
42
    virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
 
43
    void noteOff(MY_FLOAT amp);
 
44
    virtual MY_FLOAT tick();
 
45
};
 
46
 
 
47
#endif