SPKitWaveShaper reads signal from bufInput at initialization time and stores it in a lookup table. SPKitWaveShaper processes the input signal by matching the input sample values with the values stored in the lookup table. The input samples are converted to indeces for the lookup table so that an input sample value of -1.0 is taken to be the index of the first item and a value of 1.0 is taken to be the index of the last item.
Linear interpolation is used to smooth out the output signal.
The function initializes the transfer function storage buffer by reading it from bufInput . The lookup table is stored in buffer . The result is stored in outputSample .