https://www.native-instruments.com/foru ... png.54931/
I want to build a simple inline z-1 function that returns the output of the prior sample. I just want to do this as a simple function.
I presume this can be done simply by storing the value of the current sample in a variable, then retrieving that variable's output on the next sample in a continuous loop.
ie. In the Class Overdrive:
Code: Select all
Private:
double unitMemory = 0;
inline double getUnitDelay(&input) {
double output = unitMemory;
unitMemory = input;
return output;
}
Code: Select all
double Overdrive::getOutput(double &input, "other parameters") {
double inputUnitDelayed = getUnitDelay(input);
double integral = ....;
double integralUnitDelayed = getUnitDelay(integral);
....
double output = ...;
return output;
If I use this multiple times in the same class like this (ie. getUnitDelay(input), then getUnitDelay(integral)) will it still work? Ie. will they get the unitMemory = 0 on initialization, but then assign their own values within each function independently?