Mozzi  alpha 0.01.1t
sound synthesis library for Arduino
 All Classes Functions Typedefs
Public Member Functions
AudioDelayFeedback< NUM_BUFFER_SAMPLES > Class Template Reference

Audio delay line with feedback for comb filter, flange, chorus and short echo effects. More...

List of all members.

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.

Detailed Description

template<unsigned int NUM_BUFFER_SAMPLES>
class AudioDelayFeedback< NUM_BUFFER_SAMPLES >

Audio delay line with feedback for comb filter, flange, chorus and short echo effects.

Template Parameters:
NUM_BUFFER_SAMPLESis 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.


Constructor & Destructor Documentation

template<unsigned int NUM_BUFFER_SAMPLES>
AudioDelayFeedback< NUM_BUFFER_SAMPLES >::AudioDelayFeedback ( unsigned int  delaytime_cells) [inline]

Constructor.

Parameters:
delaytime_cellsdelay 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.

template<unsigned int NUM_BUFFER_SAMPLES>
AudioDelayFeedback< NUM_BUFFER_SAMPLES >::AudioDelayFeedback ( unsigned int  delaytime_cells,
char  feedback_level 
) [inline]

Constructor.

Parameters:
delaytime_cellsdelay 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_levelis the feedback level from -128 to 127 (representing -1 to 1).

Definition at line 49 of file AudioDelayFeedback.h.


Member Function Documentation

template<unsigned int NUM_BUFFER_SAMPLES>
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.

Parameters:
in_valuethe signal input.

Definition at line 58 of file AudioDelayFeedback.h.

template<unsigned int NUM_BUFFER_SAMPLES>
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.

Parameters:
in_valuethe signal input.
delaytime_cellsindicates 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.

template<unsigned int NUM_BUFFER_SAMPLES>
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.

Parameters:
delaytime_cellsindicates the delay time in terms of cells in the delay buffer.

Definition at line 108 of file AudioDelayFeedback.h.

template<unsigned int NUM_BUFFER_SAMPLES>
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.

template<unsigned int NUM_BUFFER_SAMPLES>
void AudioDelayFeedback< NUM_BUFFER_SAMPLES >::setDelayTimeCells ( unsigned int  delaytime_cells) [inline]

Set delay time expressed in samples.

Parameters:
delaytime_cellsdelay 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.

template<unsigned int NUM_BUFFER_SAMPLES>
void AudioDelayFeedback< NUM_BUFFER_SAMPLES >::setFeedbackLevel ( char  feedback_level) [inline]

Set the feedback gain.

Parameters:
feedback_levelis the feedback level from -128 to 127 (representing -1 to 1).

Definition at line 148 of file AudioDelayFeedback.h.

template<unsigned int NUM_BUFFER_SAMPLES>
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.

Parameters:
in_valuethe signal input.

Definition at line 97 of file AudioDelayFeedback.h.


The documentation for this class was generated from the following file: