Jamoma API  0.6.0.a19
TTPhasor.h
1 /*
2  * TTBlue Cycling Ramp Generator
3  * Copyright © 2003, Timothy Place
4  *
5  * License: This code is licensed under the terms of the "New BSD License"
6  * http://creativecommons.org/licenses/BSD/
7  */
8 
9 #ifndef __TT_PHASOR_H__
10 #define __TT_PHASOR_H__
11 
12 #include "TTDSP.h"
13 
14 
15 /** Generates a audio sawtooth signal */
18 
19 protected:
20 
21  TTFloat64 mFrequency; ///< ramp time in milliseconds
22  TTSampleValue mPhase, phaseInternal; ///< current location in the ramp
23  TTFloat64 mOffset; ///< offset value (adding DC)
24 
25  TTFloat64 rampMilliseconds; ///< ramp time in milliseconds
26  TTUInt32 rampSamples; ///< ramp time in samples
27  TTFloat64 step; ///< step size
28  TTFloat64 linearGain; ///< actual gain coefficient derived from attrGain
29 
30  /** Receives notifications when there are changes to the inherited
31  sr attribute. */
33 
34  /** Internal method called when the ramp is triggered (by setting the rampTime) */
35  void setStep();
36 
37  /** Process method -- This method is special! It does not use it's input! */
39 
40  /** Setter for the frequency attribute in Hertz. */
41  TTErr setFrequency(const TTValue& newValue);
42  /** Setter for the frequency attribute in Hertz. */
43  TTErr setPhase(const TTValue& newValue);
44 
45  /** Setter the gain attribute in dB. */
46  TTErr setGain(const TTValue& newValue);
47 
48  /** Getter for the gain attribute. */
49  TTErr getGain(TTValue& value);
50 
51  /** Unit Tests */
52  virtual TTErr test(TTValue& returnedTestInfo);
53 };
54 
55 
56 #endif // __TT_PHASOR_H__
TTSampleValue phaseInternal
current location in the ramp
Definition: TTPhasor.h:22
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTUInt32 rampSamples
ramp time in samples
Definition: TTPhasor.h:26
TTFloat64 linearGain
actual gain coefficient derived from attrGain
Definition: TTPhasor.h:28
Generates a audio sawtooth signal.
Definition: TTPhasor.h:16
Jamoma DSP Library.
TTFloat64 rampMilliseconds
ramp time in milliseconds
Definition: TTPhasor.h:25
TTFloat64 mOffset
offset value (adding DC)
Definition: TTPhasor.h:23
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
TTFloat64 mFrequency
ramp time in milliseconds
Definition: TTPhasor.h:21
TTErr setFrequency(const TTValue &newValue)
Setter for the frequency attribute in Hertz.
Definition: TTPhasor.cpp:49
void setStep()
Internal method called when the ramp is triggered (by setting the rampTime)
Definition: TTPhasor.cpp:65
TTErr setGain(const TTValue &newValue)
Setter the gain attribute in dB.
Definition: TTPhasor.cpp:86
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Process method – This method is special! It does not use it's input!
Definition: TTPhasor.cpp:101
A simple container for an array of TTAudioSignal pointers.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
TTErr updateSampleRate(const TTValue &, TTValue &)
Receives notifications when there are changes to the inherited sr attribute.
Definition: TTPhasor.cpp:42
TTErr setPhase(const TTValue &newValue)
Setter for the frequency attribute in Hertz.
Definition: TTPhasor.cpp:75
TTFloat64 TTSampleValue
A value representing a single audio sample.
Definition: TTBase.h:230
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
TTFloat64 step
step size
Definition: TTPhasor.h:27
virtual TTErr test(TTValue &returnedTestInfo)
Unit Tests.
TTErr getGain(TTValue &value)
Getter for the gain attribute.
Definition: TTPhasor.cpp:92