Jamoma API
0.6.0.a19
|
This implements the Tukey window function described here: http://en.wikipedia.org/wiki/File:Window_function_(Tukey;alpha%3D_0.5).png This is alternate implementation of what Roads (1996 p 170, 2001 p 88) typically refers to as a quasi-Gaussian window. More...
#include <TTTukeyWindow.h>
Protected Member Functions | |
TTErr | calculateValue (const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt data) |
Calculate y = f(x) for a single value. More... | |
TTErr | processAudio (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs) |
A standard audio processing method as used by TTBlue objects. More... | |
TTErr | test (TTValue &returnedTestInfo) |
Unit test for the window function unit. More... | |
Protected Attributes | |
TTFloat64 | mAlpha |
ratio of window fades to total window duration. 0 <= alpha <= 1., 0 = no fades, 1 = no sustain | |
This implements the Tukey window function described here: http://en.wikipedia.org/wiki/File:Window_function_(Tukey;alpha%3D_0.5).png This is alternate implementation of what Roads (1996 p 170, 2001 p 88) typically refers to as a quasi-Gaussian window.
It is easier to ensure that x and y values will scale properly with this formula as opposed to the one given by Roads.
Where 0. <= x <= 1. and 0. <= mAlpha <= 1.: y = 0.5 * (1 + cos ( pi * ((twoOverAlpha * x) - 1))) : for the attack = 1 : for the sustain = 0.5 * (1 + cos ( pi * ((twoOverAlpha * x) - twoOverAlpha + 1))) : for the release
Definition at line 42 of file TTTukeyWindow.h.
|
inlineprotected |
Calculate y = f(x) for a single value.
x | The input value to the window function. |
y | The resulting value for the window function. |
data | Not used. |
Definition at line 53 of file TTTukeyWindow.cpp.
References kTTErrNone, kTTPi, and mAlpha.
Referenced by processAudio().
|
protected |
A standard audio processing method as used by TTBlue objects.
inputs | The input vector that is to be processed. |
outputs | The resulting windowed vector. |
Definition at line 78 of file TTTukeyWindow.cpp.
References calculateValue().
Unit test for the window function unit.
returnedTestInfo | The outcome from the performed unit test. |
Reimplemented from TTAudioObjectBase.
Definition at line 58 of file TTTukeyWindow.test.cpp.
References TTAudioSignal::allocWithVectorSize(), TTAudioSignal::mSampleVectors, TTAudioObjectBase::process(), TTObjectBase::setAttributeValue(), TT, TTObjectBaseInstantiate(), and TTObjectBaseRelease().