Jamoma API  0.6.0.a19
TTOverdrive.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspEffectsLib
4  *
5  * @brief #TTOverdrive is a soft saturation distortion effect.
6  *
7  * @authors Tim Place, Trond Lossius
8  *
9  * @copyright Copyright © 2008, Tim Place @n
10  * This code is licensed under the terms of the "New BSD License" @n
11  * http://creativecommons.org/licenses/BSD/
12  */
13 
14 
15 #ifndef __TT_OVERDRIVE_H__
16 #define __TT_OVERDRIVE_H__
17 
18 #include "TTDSP.h"
19 
20 // silly stuff to get symbols exported so we can subclass this class in external code
21 #ifdef TT_PLATFORM_WIN
22  #ifdef TT_EFFECTS_LIB
23  #define TT_OVERDRIVE_EXPORT __declspec(dllexport)
24  #else
25  #define TT_OVERDRIVE_EXPORT __declspec(dllimport)
26  #endif
27 #else
28  #ifdef TT_EFFECTS_LIB
29  #define TT_OVERDRIVE_EXPORT TTDSP_EXPORT
30  #else
31  #define TT_OVERDRIVE_EXPORT
32  #endif
33 #endif
34 
35 
36 /** TTOverdrive is an audio processor that provides a soft saturation or overdrive effect to "warm" a sound up. */
37 class TT_OVERDRIVE_EXPORT TTOverdrive : public TTAudioObjectBase {
39 
40 protected:
41 
42  TTFloat64 mDrive; ///< Attribute: The amount of saturation to apply
43  TTBoolean mDcBlocker; ///< Attribute: Pass processed signal through a DC blocking filter?
44  TTBoolean mMode; ///< Attribute: What distortion function to use
45  TTFloat64 mPreamp; ///< Attribute: linear gain for preamp (attr setter sets it in dB)
46  TTFloat64 s,
47  b,
48  nb,
49  z,
50  scale;
51  TTAudioObject dcBlockerUnit; ///< A TTDCBlock object
52 
53  /** This method gets called when the inherited maxNumChannels attribute is changed. */
54  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
55 
56  /** Process method when mode == 0 */
57  TTErr processMode0(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
58 
59  /** Process method when mode == 1 */
60  TTErr processMode1(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
61 
62 public:
63 
64  /** Setter for the mode attribute. */
65  TTErr setDrive(const TTValue& value);
66 
67  /** Setter for the mode attribute. */
68  TTErr setDcBlocker(const TTValue& value);
69 
70  /** Setter for the mode attribute. */
71  TTErr setMode(const TTValue& value);
72 
73  /** Getter for the mode attribute. */
74  TTErr getPreamp(TTValue& value);
75  /** Setter for the mode attribute. */
76  TTErr setPreamp(const TTValue& value);
77 
78  /** Reset the DC Blocker. */
79  TTErr clear();
80 };
81 
82 
83 #endif // __TT_OVERDRIVE_H__
TTOverdrive is an audio processor that provides a soft saturation or overdrive effect to "warm" a sou...
Definition: TTOverdrive.h:37
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTFloat64 mPreamp
Attribute: linear gain for preamp (attr setter sets it in dB)
Definition: TTOverdrive.h:45
TTFloat64 mDrive
Attribute: The amount of saturation to apply.
Definition: TTOverdrive.h:42
Wrap audio objects for convenience.
Jamoma DSP Library.
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
TTAudioObject dcBlockerUnit
A TTDCBlock object.
Definition: TTOverdrive.h:51
A simple container for an array of TTAudioSignal pointers.
TTBoolean mMode
Attribute: What distortion function to use.
Definition: TTOverdrive.h:44
TTBoolean mDcBlocker
Attribute: Pass processed signal through a DC blocking filter?
Definition: TTOverdrive.h:43
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34