CSL  5.2
WhiteNoiseInstrument.h
Go to the documentation of this file.
1 //
2 // WhiteNoiseInstrument.h -- Simple filtered noise instrument class.
3 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT
4 //
5 
6 #ifndef INCLUDE_WhiteNoise_Instrument_H
7 #define INCLUDE_WhiteNoise_Instrument_H
8 
9 #include "Instrument.h"
10 #include "CSL_All.h"
11 
12 namespace csl {
13 
14 enum {
15  // Global
17  // Parameters Tags
18  kThresh = 0, // Spectral filtering threshhold
19  kWindowSize, // Size of the FFT filtering window
20  kNumBins, // Number of spectral bins
21  kOut, // Output gain
23 };
24 
26 
27 protected: // These are the UGens of the DSP graph (i.e., the FM instrument)
28  ADSR mAEnv; // amplitude & filter frequency envelopes
29  WhiteNoise mSig; // White Noise signal
30  Butter mLpfilter; // This filters the white noise
31  MulOp mAPul; // the output and frequency value multiplier guys
32 
33 public:
36 
37 // Plug functions
38 
39  unsigned num_accessors();
40  void get_accessors(Accessor **);
41  void set_parameter(unsigned selector, void * value);
42  void play_osc_note(char * types, void * args, char * endOfArgs);
43  void playMIDI(float dur, int chan, int key, int vel);
44 
45 };
46 
47 }
48 
49 #endif