SPKitFeedback


User's Guide

SPKitFeedback outputs the summed signal of two inputs. This class may be used to form a feedback loop in the signal chain.

The first input is connected to a SPKitSum instance with the standard setInput(SPKitProcessor*) function. The feedback signal is connected with the setFeedbackInput(SPKitProcessor*) function.

SPKitFeedback has a setFeedbackTime(SPKitFloat) function for controlling how long the feedback loop is allowed to "ring".

Here is an example. For another example, see SPKitComb.


Programmer's Reference

Defined in <spkit/feedback.h>
Inherits from SPKitProcessor

SPKitFeedback defines a setFeedbackInput() function for connecting the feedback signal and overrides getSample().

Public Members

SPKitError setInput(SPKitProcessor* newInput)
connect an input to the object and initialize it. Adds newInput to inputList.

Calls SPKitProcessor::setInput().

void setFeedbackInput(SPKitProcessor* fip)
connect the feedback signal to the object. Sets feedbackInput to fip.
void setFeedbackTime(SPKitFloat* value)
set feedBackTime (in seconds) to value.
int getSample(SPKitSample& outputSample)
retrieve a processed audio sample

getSample() requests a sample from its input and feedbackInput, stores the sum of the sample values in outputSample.

The function returns 0 when all its inputs run out of samples, 1 otherwise.

Protected Members

SPKitProcessor* feedbackInput
feedback signal input
SPKitFloat feedbackTime
amount of seconds the feedbackLoop is allowed to "ring" after end of input signal
SPKitInt feedbackSampleCount
feedbackTime in samples (times inputChannelCount).
SPKitInt feedbackSampleIndex
an index for counting remaining samples needed to be read from feedbackInput
int haveInput
a boolean value. Initially set to 1. Set to 0 at end of signal from input.

Return to SPKit home

Kai Lassfolk / University of Helsinki / kpl@elisir.helsinki.fi