ASPiK SDK
|
The FX-Functions module contains specialized audio DSP C++ functions that are inlcuded with and documented in Will Pirkle's new plugin programming book. These objects are described with even more documentation in this book and are free to use in your projects, commercial or personal. More...
Functions | |
bool | checkFloatUnderflow (double &value) |
Perform underflow check; returns true if we did underflow (user may not care) | |
double | doLinearInterpolation (double x1, double x2, double y1, double y2, double x) |
performs linear interpolation of x distance between two (x,y) points; returns interpolated value | |
double | doLinearInterpolation (double y1, double y2, double fractional_X) |
performs linear interpolation of fractional x distance between two adjacent (x,y) points; returns interpolated value | |
double | doLagrangeInterpolation (double *x, double *y, int n, double xbar) |
implements n-order Lagrange Interpolation | |
void | boundValue (double &value, double minValue, double maxValue) |
Bound a value to min and max limits. | |
double | doUnipolarModulationFromMin (double unipolarModulatorValue, double minValue, double maxValue) |
Perform unipolar modulation from a min value up to a max value using a unipolar modulator value. | |
double | doUnipolarModulationFromMax (double unipolarModulatorValue, double minValue, double maxValue) |
Perform unipolar modulation from a max value down to a min value using a unipolar modulator value. | |
double | doBipolarModulation (double bipolarModulatorValue, double minValue, double maxValue) |
Perform bipolar modulation about a center that his halfway between the min and max values. | |
double | unipolarToBipolar (double value) |
calculates the bipolar [-1.0, +1.0] value FROM a unipolar [0.0, +1.0] value | |
double | bipolarToUnipolar (double value) |
calculates the unipolar [0.0, +1.0] value FROM a bipolar [-1.0, +1.0] value | |
double | raw2dB (double raw) |
calculates dB for given input | |
double | dB2Raw (double dB) |
converts dB to raw value | |
double | peakGainFor_Q (double Q) |
calculates the peak magnitude for a given Q | |
double | dBPeakGainFor_Q (double Q) |
calculates the peak magnitude in dB for a given Q | |
double | doWhiteNoise () |
calculates a random value between -1.0 and +1.0 | |
double | sgn (double xn) |
calculates sgn( ) of input | |
double | calcWSGain (double xn, double saturation, double asymmetry) |
calculates gain of a waveshaper | |
double | atanWaveShaper (double xn, double saturation) |
calculates arctangent waveshaper | |
double | tanhWaveShaper (double xn, double saturation) |
calculates hyptan waveshaper | |
double | softClipWaveShaper (double xn, double saturation) |
calculates hyptan waveshaper | |
double | fuzzExp1WaveShaper (double xn, double saturation, double asymmetry) |
calculates fuzz exp1 waveshaper | |
double | getMagResponse (double theta, double a0, double a1, double a2, double b1, double b2) |
returns the magnitude resonse of a 2nd order H(z) transfer function | |
ComplexNumber | complexMultiply (ComplexNumber c1, ComplexNumber c2) |
returns the complex product of two complex numbers | |
void | calcEdgeFrequencies (double fc, double Q, double &f_Low, double &f_High) |
calculagte low and high edge frequencies of BPF or BSF | |
int | findEdgeTargetBin (double testFreq, double bin1Freq) |
find bin for target frequency | |
bool | getTransitionBandData (double testFreq, double bin1Freq, unsigned int relax_Bins, TransitionBandData &transitionData) |
get bin data for a filter's transitino band (see FX book for details) | |
bool | calculateBrickwallMagArray (BrickwallMagData &magData) |
calculate an arra of magnitude points from brickwall specifications | |
bool | calculateAnalogMagArray (AnalogMagData &magData) |
calculate an arra of magnitude points from analog filter specifications | |
void | freqSample (int N, double A[], double h[], int symm) |
calcuate the IR for an array of magnitude points using the frequency sampling method. NOTE: very old function that is all over the internet. | |
double | getMagnitude (double re, double im) |
calculates magnitude of a complex numb er | |
double | getPhase (double re, double im) |
calculates phase of a complex numb er | |
double | principalArg (double phaseIn) |
calculates proncipal argument of a phase value; this is the wrapped value on the range of [-pi, +pi] | |
bool | resample (double *input, double *output, uint32_t inLength, uint32_t outLength, interpolation interpType=interpolation::kLinear, double scalar=1.0, double *outWindow=nullptr) |
function that resamples an input array of length N into an output array of length M. You can set the interpolation type (linear or lagrange) and you can supply an optional window array that the resampled array will be processed through. | |
std::unique_ptr< double[]> | makeWindow (unsigned int windowLength, unsigned int hopSize, windowType window, double &gainCorrectionValue) |
creates a new std::unique_ptr<double[]> array for a given window lenght and type. | |
unsigned int | countForRatio (rateConversionRatio ratio) |
returns the up or downsample ratio as a numeric value | |
double * | getFilterIRTable (unsigned int FIRLength, rateConversionRatio ratio, unsigned int sampleRate) |
returns the up or downsample ratio as a numeric value | |
double ** | decomposeFilter (double *filterIR, unsigned int FIRLength, unsigned int ratio) |
performs a polyphase decomposition on a big FIR into a set of sub-band FIRs | |
SpeakerArrangement | Steinberg::Vst::ASPiK::getSupportedSpeakerArrangement (uint32_t index) |
implements n-order Lagrange Interpolation | |
uint32_t | Steinberg::Vst::ASPiK::getChannelFormatForSpkrArrangement (SpeakerArrangement arr) |
implements n-order Lagrange Interpolation | |
The FX-Functions module contains specialized audio DSP C++ functions that are inlcuded with and documented in Will Pirkle's new plugin programming book. These objects are described with even more documentation in this book and are free to use in your projects, commercial or personal.
Download them from https://www.willpirkle.com/Downloads/fxobjects.zip and then you may drop them into your ASPiK's PluginObject folder and import them into your Visual Studio or XCode projects (you need to do this manually for several reasons, one involving FFTW and that is why it is not a direct part of the SDK). These objects are 100% free for you to use in your commercial or non-commercial plugins. See the ASPiK licensing agreement for details.
|
inline |
calculates arctangent waveshaper
@atanWaveShaper
xn | - the input value |
saturation | - the saturation control |
|
inline |
calculates the unipolar [0.0, +1.0] value FROM a bipolar [-1.0, +1.0] value
@bipolarToUnipolar
value | - value to convert |
|
inline |
Bound a value to min and max limits.
@boundValue
value | - value to bound |
minValue | - lower bound limit |
maxValue | - upper bound limit |
|
inline |
calculagte low and high edge frequencies of BPF or BSF
@calcEdgeFrequencies
fc | - the center frequency of the BPF or BSF |
Q | - the Q (fc/BW) of the filter |
f_Low | - the returned low edge frequency |
f_High | - the returned high edge frequency |
|
inline |
calculate an arra of magnitude points from analog filter specifications
@calculateAnalogMagArray
magData | - the the target magnitude data |
|
inline |
calculate an arra of magnitude points from brickwall specifications
@calculateBrickwallMagArray
magData | - the the target magnitude data |
|
inline |
calculates gain of a waveshaper
@calcWSGain
xn | - the input value |
saturation | - the saturation control |
asymmetry | - the degree of asymmetry |
|
inline |
Perform underflow check; returns true if we did underflow (user may not care)
@checkFloatUnderflow
value | - the value to check for underflow |
|
inline |
returns the complex product of two complex numbers
@complexMultiply
c1,c2 | - complex numbers to multiply |
|
inline |
returns the up or downsample ratio as a numeric value
@countForRatio
ratio | - enum class ratio value |
|
inline |
converts dB to raw value
@dBTo_Raw
dB | - value to convert to raw |
|
inline |
calculates the peak magnitude in dB for a given Q
@dBPeakGainFor_Q
Q | - the Q value |
|
inline |
performs a polyphase decomposition on a big FIR into a set of sub-band FIRs
@decomposeFilter
filterIR | - pointer to filter IR array |
FIRLength | - lenght of IR array |
ratio | - up or down sampling ratio |
|
inline |
Perform bipolar modulation about a center that his halfway between the min and max values.
@doBipolarModulation
bipolarModulatorValue | - modulation value on range [-1.0, +1.0] |
minValue | - lower modulation limit |
maxValue | - upper modulation limit |
|
inline |
implements n-order Lagrange Interpolation
@doLagrangeInterpolation
x | - Pointer to an array containing the x-coordinates of the input values |
y | - Pointer to an array containing the y-coordinates of the input values |
n | - the order of the interpolator, this is also the length of the x,y input arrays |
xbar | - The x-coorinates whose y-value we want to interpolate |
|
inline |
performs linear interpolation of x distance between two (x,y) points; returns interpolated value
@doLinearInterpolation
x1 | - the x coordinate of the first point |
x2 | - the x coordinate of the second point |
y1 | - the y coordinate of the first point |
y2 | - the 2 coordinate of the second point |
x | - the interpolation location |
|
inline |
performs linear interpolation of fractional x distance between two adjacent (x,y) points; returns interpolated value
@doLinearInterpolation
y1 | - the y coordinate of the first point |
y2 | - the 2 coordinate of the second point |
x | - the interpolation location as a fractional distance between x1 and x2 (which are not needed) |
|
inline |
Perform unipolar modulation from a max value down to a min value using a unipolar modulator value.
@doUnipolarModulationFromMax
unipolarModulatorValue | - modulation value on range [0.0, +1.0] |
minValue | - lower modulation limit |
maxValue | - upper modulation limit |
|
inline |
Perform unipolar modulation from a min value up to a max value using a unipolar modulator value.
@doUnipolarModulationFromMin
unipolarModulatorValue | - modulation value on range [0.0, +1.0] |
minValue | - lower modulation limit |
maxValue | - upper modulation limit |
|
inline |
calculates a random value between -1.0 and +1.0
@doWhiteNoise
|
inline |
find bin for target frequency
@findEdgeTargetBin
testFreq | - the target frequency |
bin1Freq | - the frequency of bin 1 |
|
inline |
calcuate the IR for an array of magnitude points using the frequency sampling method. NOTE: very old function that is all over the internet.
@freqSample
N | - Number of filter coefficients |
A[] | - Sample points of desired response [N/2] |
symmetry | - Symmetry of desired filter |
h[] | - the output array of impulse response |
|
inline |
calculates fuzz exp1 waveshaper
@fuzzExp1WaveShaper
xn | - the input value |
saturation | - the saturation control |
uint32_t Steinberg::Vst::ASPiK::getChannelFormatForSpkrArrangement | ( | SpeakerArrangement | arr | ) |
implements n-order Lagrange Interpolation
@getChannelFormatForSpkrArrangement
SpeakerArrangement | the VST speaker arrangement |
|
inline |
returns the up or downsample ratio as a numeric value
@getFilterIRTable
FIRLength | - lenght of FIR |
ratio | - the conversinon ratio |
sampleRate | - the sample rate |
|
inline |
calculates magnitude of a complex numb er
@getMagnitude
re | - complex number real part |
im | - complex number imaginary part |
|
inline |
returns the magnitude resonse of a 2nd order H(z) transfer function
@getMagResponse
theta | - the angular frequency to apply |
a0,a1,a2,b1,b2 | - the transfer function coefficients |
|
inline |
calculates phase of a complex numb er
@getPhase
re | - complex number real part |
im | - complex number imaginary part |
SpeakerArrangement Steinberg::Vst::ASPiK::getSupportedSpeakerArrangement | ( | uint32_t | index | ) |
implements n-order Lagrange Interpolation
@getSupportedSpeakerArrangement
index | index of channel I/O struct |
|
inline |
get bin data for a filter's transitino band (see FX book for details)
@getTransitionBandData
testFreq | - the target frequency |
bin1Freq | - the frequency of bin 1 |
relax_Bins | - numebr of bins to relax the filter specification |
transitionData | - the output parameter containing the data |
|
inline |
creates a new std::unique_ptr<double[]> array for a given window lenght and type.
@makeWindow
windowLength | - length of window array (does NOT need to be power of 2) |
hopSize | - hopSize for vococerf applications, may set to 0 for non vocoder use |
gainCorrectionValue | - return variable that contains the window gain correction value |
|
inline |
calculates the peak magnitude for a given Q
@peakGainFor_Q
Q | - the Q value |
|
inline |
calculates proncipal argument of a phase value; this is the wrapped value on the range of [-pi, +pi]
@principalArg
phaseIn | - value to convert |
|
inline |
calculates dB for given input
@rawTo_dB
raw | - value to convert to dB |
|
inline |
function that resamples an input array of length N into an output array of length M. You can set the interpolation type (linear or lagrange) and you can supply an optional window array that the resampled array will be processed through.
@resample
input | - input array |
output | - output array |
inLength | - length N of input buffer |
outLength | - length M of output buffer |
interpType | - linear or lagrange interpolation |
scalar | - output scaling value (optional) |
outWindow | - output windowing buffer (optional) |
|
inline |
calculates sgn( ) of input
@sgn
xn | - the input value |
|
inline |
calculates hyptan waveshaper
@softClipWaveShaper
xn | - the input value |
saturation | - the saturation control |
|
inline |
calculates hyptan waveshaper
@tanhWaveShaper
xn | - the input value |
saturation | - the saturation control |
|
inline |
calculates the bipolar [-1.0, +1.0] value FROM a unipolar [0.0, +1.0] value
@unipolarToBipolar
value | - value to convert |