Audio delay line with feedback for comb filter, flange, chorus and short echo effects. More...
Public Member Functions | |
AudioDelayFeedback () | |
Constructor. | |
AudioDelayFeedback (unsigned int delaytime_cells) | |
Constructor. | |
AudioDelayFeedback (unsigned int delaytime_cells, char feedback_level) | |
Constructor. | |
int | next (char in_value) |
Input a value to the delay and retrieve the signal in the delay line at the position delaytime_cells. | |
int | next (char in_value, unsigned int delaytime_cells) |
Input a value to the delay and retrieve the signal in the delay line at the position delaytime_cells, updating all positions and feedback from the output to the input. | |
void | write (char in_value) |
Input a value to the delay but don't change the read position or retrieve the output signal. | |
int | read (unsigned int delaytime_cells) |
Retrieve the signal in the delay line at the position delaytime_cells. | |
int | read () |
Retrieve the signal in the delay line at the current delaytime_cells. | |
void | setDelayTimeCells (unsigned int delaytime_cells) |
Set delay time expressed in samples. | |
void | setFeedbackLevel (char feedback_level) |
Set the feedback gain. |
Audio delay line with feedback for comb filter, flange, chorus and short echo effects.
NUM_BUFFER_SAMPLES | is the length of the delay buffer in samples, and should be a power of two. The maximum delay length which will fit in an atmega328 is half that of a plain AudioDelay object, in this case 256 cells, or about 15 milliseconds. AudioDelayFeedback uses int sized cells to accomodate the higher amplitude of direct input to the delay as well as the feedback, without losing precision. Output is only the delay line signal. If you want to mix the delay with the input, do it in your sketch. AudioDelayFeedback uses more processing than a plain AudioDelay, but allows for more dramatic effects with feedback. |
Definition at line 18 of file AudioDelayFeedback.h.
AudioDelayFeedback< NUM_BUFFER_SAMPLES >::AudioDelayFeedback | ( | unsigned int | delaytime_cells | ) | [inline] |
Constructor.
delaytime_cells | delay time expressed in cells. For example, 128 cells delay at AUDIO_RATE would produce a time delay of 128/16384 = 0.0078125 s = 7.8 ms Put another way, num_cells = delay_seconds * AUDIO_RATE. |
Definition at line 39 of file AudioDelayFeedback.h.
AudioDelayFeedback< NUM_BUFFER_SAMPLES >::AudioDelayFeedback | ( | unsigned int | delaytime_cells, |
char | feedback_level | ||
) | [inline] |
Constructor.
delaytime_cells | delay time expressed in cells. For example, 128 cells delay at AUDIO_RATE would produce a time delay of 128/16384 = 0.0078125 s = 7.8 ms Put another way, num_cells = delay_seconds * AUDIO_RATE. |
feedback_level | is the feedback level from -128 to 127 (representing -1 to 1). |
Definition at line 49 of file AudioDelayFeedback.h.
int AudioDelayFeedback< NUM_BUFFER_SAMPLES >::next | ( | char | in_value | ) | [inline] |
Input a value to the delay and retrieve the signal in the delay line at the position delaytime_cells.
in_value | the signal input. |
Definition at line 58 of file AudioDelayFeedback.h.
int AudioDelayFeedback< NUM_BUFFER_SAMPLES >::next | ( | char | in_value, |
unsigned int | delaytime_cells | ||
) | [inline] |
Input a value to the delay and retrieve the signal in the delay line at the position delaytime_cells, updating all positions and feedback from the output to the input.
This is the simplest way to use AudioDelayFeedback(), like an effects box with no extra fancy holes or controls.
in_value | the signal input. |
delaytime_cells | indicates the delay time in terms of cells in the delay buffer. It doesn't change the stored internal value of _delaytime_cells. |
Definition at line 80 of file AudioDelayFeedback.h.
int AudioDelayFeedback< NUM_BUFFER_SAMPLES >::read | ( | unsigned int | delaytime_cells | ) | [inline] |
Retrieve the signal in the delay line at the position delaytime_cells.
It doesn't change the stored internal value of _delaytime_cells or feedback the output to the input.
delaytime_cells | indicates the delay time in terms of cells in the delay buffer. |
Definition at line 108 of file AudioDelayFeedback.h.
int AudioDelayFeedback< NUM_BUFFER_SAMPLES >::read | ( | ) | [inline] |
Retrieve the signal in the delay line at the current delaytime_cells.
It doesn't change the stored internal value of _delaytime_cells or feedback the output to the input.
Definition at line 122 of file AudioDelayFeedback.h.
void AudioDelayFeedback< NUM_BUFFER_SAMPLES >::setDelayTimeCells | ( | unsigned int | delaytime_cells | ) | [inline] |
Set delay time expressed in samples.
delaytime_cells | delay time expressed in cells, with each cell played per tick of AUDIO_RATE. For example, 128 cells delay at AUDIO_RATE would produce a time delay of 128/16384 = 0.0078125 s = 7.8 ms Put another way, num_cells = delay_seconds * AUDIO_RATE. |
Definition at line 138 of file AudioDelayFeedback.h.
void AudioDelayFeedback< NUM_BUFFER_SAMPLES >::setFeedbackLevel | ( | char | feedback_level | ) | [inline] |
Set the feedback gain.
feedback_level | is the feedback level from -128 to 127 (representing -1 to 1). |
Definition at line 148 of file AudioDelayFeedback.h.
void AudioDelayFeedback< NUM_BUFFER_SAMPLES >::write | ( | char | in_value | ) | [inline] |
Input a value to the delay but don't change the read position or retrieve the output signal.
in_value | the signal input. |
Definition at line 97 of file AudioDelayFeedback.h.