Jamoma API  0.6.0.a19
TTWavetable.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspGeneratorLib
4  *
5  * @brief GeneratorLib: Generate a basic, cycling waveform using a wavetable.
6  *
7  * @details Wavetable is currently limited to using an internal buffer for managing its waveshape. Shape options include sine, triangle and sawtooth.
8  *
9  * @see TTBuffer, TTSampleMatrix, TTMatrix, TTAudioSignal
10  *
11  * @authors Tim Place, Nathan Wolek
12  *
13  * @copyright Copyright © 2003-2013 by Timothy Place & Nathan Wolek @n
14  * This code is licensed under the terms of the "New BSD License" @n
15  * http://creativecommons.org/licenses/BSD/
16  */
17 
18 #ifndef __TT_WAVETABLE_H__
19 #define __TT_WAVETABLE_H__
20 
21 
22 #include "TTDSP.h"
23 #include "TTBuffer.h"
24 
25 
26 /** TTWavetable is a table-lookup oscillator. The wavetable is implemented as a TTBuffer. */
29 
30 protected:
31 
32  TTSymbol mMode;
33  TTFloat64 mFrequency;
34  TTFloat64 mGain;
35  TTFloat64 mLinearGain;
36  TTSymbol mInterpolation; ///< should be none, linear, or eventually something better...
37  TTUInt32 mSize; ///< how many samples in the wave table
38  TTFloat64 mIndex;
39  TTFloat64 mIndexDelta;
40  TTAudioBuffer mInternalBuffer;
41  TTSampleMatrixPtr mWavetable;
42 
43  /** This method gets called when the inherited sample-rate attribute is changed. */
45 
46  /** Process method */
48 
49  /** Process method */
51 
52  /** Process method */
54 
55  /** Setter for the mode attribute.
56  This is a symbol that names the waveform that fills the buffer.
57  If the symbol is the string "externalBuffer", then a second symbol names the buffer to use in the buffer hash. */
58  TTErr setMode(const TTValue& value);
59 
60  /** Setter for the frequency attribute in Hz. */
61  TTErr setFrequency(const TTValue& value);
62 
63  /** Setter for the gain attribute in dB. */
64  TTErr setGain(const TTValue& value);
65 
66  /** Setter for the interpolation attribute.
67  This determines the process method that is used. */
68  TTErr setInterpolation(const TTValue& value);
69 
70  /** Setter for the size attribute. Size is set as the number of samples in the table. */
71  TTErr setSize(const TTValue& newSize);
72 };
73 
74 
75 #endif // __TT_WAVETABLE_H__
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTErr updateSampleRate(const TTValue &, TTValue &)
This method gets called when the inherited sample-rate attribute is changed.
Definition: TTWavetable.cpp:59
TTErr setGain(const TTValue &value)
Setter for the gain attribute in dB.
Wrap TTBuffer instances for convenience.
Definition: TTBuffer.h:199
TTUInt32 mSize
how many samples in the wave table
Definition: TTWavetable.h:37
TTErr setInterpolation(const TTValue &value)
Setter for the interpolation attribute.
TTErr setFrequency(const TTValue &value)
Setter for the frequency attribute in Hz.
Definition: TTWavetable.cpp:66
Jamoma DSP Library.
TTWavetable is a table-lookup oscillator.
Definition: TTWavetable.h:27
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
Container object that holds some audio in a chunk of memory.
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
TTErr setMode(const TTValue &value)
Setter for the mode attribute.
Definition: TTWavetable.cpp:74
TTErr processWithNoInterpolation(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Process method.
TTErr setSize(const TTValue &newSize)
Setter for the size attribute.
A simple container for an array of TTAudioSignal pointers.
TTErr processAsLFO(TTAudioSignalArrayPtr, TTAudioSignalArrayPtr outputs)
Process method.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTErr processWithLinearInterpolation(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Process method.
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
TTBuffer manages the check-in/out of TTSampleMatrix pointers.
TTSymbol mInterpolation
should be none, linear, or eventually something better...
Definition: TTWavetable.h:36
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34