Delay time is set with the initialization function setInputAndDelayTime(SPKitProcessor* input, SPKitFloat dt), where input is the object's signal input and dt is delay time in seconds. setInputAndDelayTime() should be used instead of the standard initialization function setInput().
SPKitFBDelay stores the delayed samples in a buffer, which is initialized to contain sample values of 0.
The only difference from the regular delay line class SPKitDelay is that the delay buffer of SPKitFBDelay is one sample smaller.
SPKitFBDelay defines a setInputAndDelayTime() function for initialization and setting the delay time. SPKitFBDelay also overrides getSample().
The function allocates dt * inputChannelCount * inputSamplingRate samples for buffer.
Calls SPKitProcessor::setInput().
On each call, getSample() reads one sample from buffer and stores it to outputSample. Then the function reads a new sample from input and stores it to buffer.
Increments oldestSampleIndex.
The function returns 0 on end of signal, 1 otherwise.
Kai Lassfolk / University of Helsinki / kpl@elisir.helsinki.fi
This class is based on an earlier Objective-C implementation by Janne Halmkrona.