Jamoma API
0.6.0.a19
|
TTZerocross analyzes the incoming audio by looking for zero-crossings. More...
#include <TTZerocross.h>
Protected Member Functions | |
TTErr | updateMaxNumChannels (const TTValue &oldMaxNumChannels, TTValue &) |
This method gets called when the inherited maxNumChannels attribute is changed. More... | |
TTErr | updateSr () |
This method gets called when the inherited sr attribute (sample rate) is changed. More... | |
TTErr | processAudio (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs) |
Audio processing method. More... | |
TTErr | setSize (const TTValue &value) |
Set the size attribute. More... | |
TTErr | Clear () |
Reset the history used in the analysis. More... | |
Protected Attributes | |
TTUInt32 | mSize |
Attribute: size of the analysis buffer. | |
TTFloat64 | rSize |
reciprocal of the size attribute | |
TTBoolean | lastSampleWasOverZero |
was the last sample over zero? | |
TTUInt32 | counter |
counts zero-crossings | |
TTUInt32 | analysisLocation |
keep track of how many samples so far | |
TTZerocross analyzes the incoming audio by looking for zero-crossings.
When a zero crossing occurs it both reports the crossing and also keeps a count of the number of zero crossings per analysis period.
Definition at line 27 of file TTZerocross.h.
|
protected |
Reset the history used in the analysis.
Definition at line 55 of file TTZerocross.cpp.
References analysisLocation, counter, kTTErrNone, and lastSampleWasOverZero.
Referenced by updateMaxNumChannels().
|
protected |
Audio processing method.
WARNING: This unit requires 1 input and 2 outputs - it does not yet configure itself for other arrangements!
in | A pointer to a TTAudioSignal object that may contain any number of channels. This signal is considered the master, and thus it provides the vectorsize and number of channels should the two signals not be matched. |
out | A pointer to a TTAudioSignal object that has the output sample vectors. |
Definition at line 74 of file TTZerocross.cpp.
References analysisLocation, counter, kTTErrNone, lastSampleWasOverZero, TTAudioSignal::mSampleVectors, mSize, and rSize.
Set the size attribute.
value | New value for the attribute |
Definition at line 65 of file TTZerocross.cpp.
References kTTErrNone, mSize, and rSize.
This method gets called when the inherited maxNumChannels attribute is changed.
oldMaxNumChannels | The previous nuber of channels to process |
Unused |
Definition at line 49 of file TTZerocross.cpp.
References Clear().
|
protected |
This method gets called when the inherited sr attribute (sample rate) is changed.