CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
16 kNumParameters = 16,
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
22 kNumParams
23 };
24
25 class WhiteNoiseInstrument : public Instrument {
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:
34 WhiteNoiseInstrument();
35 ~WhiteNoiseInstrument();
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