CSL 5.2

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

- File List
- File Members

SimpleSines.h
Go to the documentation of this file.
1 //
2 // SimpleSines.h -- specification of the simple waveform generators used as CSL tutorial examples
3 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT
4 //
5 // What's here:
6 // SimpleSine -- the simplest sine oscillator class, this version has no dynamic controls
7 // SineAsPhased -- same as the above, except that it inherits its freq/phase members from Phased
8 // SineAsScaled -- this version has dynamic scale/offset controls, like most CSL UGens
9
10 #ifndef CSL_SIMPLESINE_H
11 #define CSL_SIMPLESINE_H
12
13 #include "CSL_Core.h" // include the main CSL header; this includes CSL_Types.h and CGestalt.h
14
15 namespace csl { // All these classes live in their own C++ namespace
16
17 ///
18 /// SimpleSine -- The simplest CSL sine oscillator class
19 ///
20
21 class SimpleSine : public UnitGenerator {
22
23 public:
24 SimpleSine(); ///< Constructors
25 SimpleSine(float frequency);
26 SimpleSine(float frequency, float phase);
27 ~SimpleSine(); ///< Destructor
28
29 /// the monoNextBuffer method is where the DSP takes place
30 void nextBuffer(Buffer & outputBuffer, unsigned outBufNum) throw (CException);
31
32 protected:
33 float mFrequency; ///< my frequency value in Hz
34 float mPhase; ///< my instantaneous phase in Radians
35 };
36
37 ///
38 /// SineAsPhased -- A sine oscillator that uses the Phased mix-in class,
39 /// meaning that we inherit mFrequency and mPhase and macros for dynamic control
40 ///
41
42 class SineAsPhased : public UnitGenerator, public Phased {
43
44 public:
45 SineAsPhased(); ///< Constructors
46 SineAsPhased(float frequency);
47 SineAsPhased(float frequency, float phase);
48 ~SineAsPhased(); ///< Destructor
49
50 /// the monoNextBuffer method is where the DSP takes place
51 void nextBuffer(Buffer & outputBuffer, unsigned outBufNum) throw (CException);
52 void dump(); ///< pretty-print the receiver
53 };
54
55 ///
56 /// SineAsScaled -- A sine oscillator that also has scale and offset as dynamic controls (from Scalable)
57 /// (Note the tripple inheritance)
58 ///
59
60 class SineAsScaled : public UnitGenerator, public Phased, public Scalable {
61
62 public:
63 SineAsScaled(); ///< Constructors
64 SineAsScaled(float frequency);
65 SineAsScaled(float frequency, float phase);
66 SineAsScaled(float frequency, float phase, float ampl, float offset);
67 ~SineAsScaled(); ///< Destructor
68
69 /// the monoNextBuffer method is where the DSP takes place
70 void nextBuffer(Buffer & outputBuffer, unsigned outBufNum) throw (CException);
71 void dump(); ///< pretty-print the receiver
72 };
73
74 }
75
76 #endif