CSL  6.0
Clipper.h
Go to the documentation of this file.
1 //
2 // Clipper.h -- hard clipping processor
3 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT
4 //
5 
6 #ifndef CSL_Clipper_H
7 #define CSL_Clipper_H
8 
9 #include "CSL_Core.h"
10 
11 namespace csl {
12 
13 /// Whether to clip using the minimum, maximum or both values.
14 
15 typedef enum {
19 } ClipperFlags;
20 
21 ///
22 /// Clipper class
23 ///
24 
25 class Clipper : public Effect {
26 
27 public:
28  /// Constructor takes the input UGen and optionally the flags, min and max.
29  Clipper(UnitGenerator & input, float min = -1, float max = 1, ClipperFlags flags = kBoth);
30  ~Clipper();
31 
32  void dump(); ///< print the receiver for debugging
33 
34  void nextBuffer(Buffer &outputBuffer, unsigned outBufNum) throw (CException);
35 
36 private:
38  float mMin, mMax;
39 };
40 
41 }
42 
43 #endif
#define max(a, b)
Definition: matrix.h:156
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
Definition: Accessor.h:17
Effect – mix-in for classes that have unit generators as inputs (like filters).
Definition: CSL_Core.h:466
#define min(a, b)
Definition: matrix.h:157
float mMax
Definition: Clipper.h:38
void nextBuffer(Buffer &outputBuffer, unsigned outBufNum)
really compute the next buffer given an offset base channel; this is called by nextBuffer, possibly multiple times
Definition: Clipper.cpp:25
float mMin
Definition: Clipper.h:38
Clipper class.
Definition: Clipper.h:25
Clipper(UnitGenerator &input, float min=-1, float max=1, ClipperFlags flags=kBoth)
Constructor takes the input UGen and optionally the flags, min and max.
Definition: Clipper.cpp:14
ClipperFlags mFlags
Definition: Clipper.h:37
Buffer – the multi-channel sample buffer class (passed around between generators and IO guys)...
Definition: CSL_Core.h:106
ClipperFlags
Whether to clip using the minimum, maximum or both values.
Definition: Clipper.h:15
forward declaration
Definition: CSL_Core.h:241
void dump()
print the receiver for debugging
Definition: Clipper.cpp:19
Base class of CSL exceptions (written upper-case). Has a string message.