Mozzi  version v2.0
sound synthesis library for Arduino
ControlDelay< NUM_BUFFER_SAMPLES, T > Class Template Reference

Control-rate delay line for delaying control signals. More...

#include <ControlDelay.h>

+ Inheritance diagram for ControlDelay< NUM_BUFFER_SAMPLES, T >:

Detailed Description

template<unsigned int NUM_BUFFER_SAMPLES, class T = int>
class ControlDelay< NUM_BUFFER_SAMPLES, T >

Control-rate delay line for delaying control signals.

For example, this could be used to produce echo-like effects using multiple instances of the same voice, when AudioDelay would be too short for an actual audio echo. This is in fact just a wrapper of the AudioDelay code.

Template Parameters
NUM_BUFFER_SAMPLESis the length of the delay buffer in samples. This should be a power of two.
thetype of numbers to use for the signal in the delay. The default is int8_t, but int could be useful when adding manual feedback. When using int, the input should be limited to 15 bits width, ie. -16384 to 16383.

Definition at line 29 of file ControlDelay.h.

Public Member Functions

int next (int 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. More...
 
int next (int in_value)
 Input a value to the delay and retrieve the signal in the delay line at the position delaytime_cells. More...
 
void set (unsigned int delaytime_cells)
 Set the delay time, measured in cells. More...
 
int read (unsigned int delaytime_cells)
 Retrieve the signal in the delay line at the position delaytime_cells. More...
 

Member Function Documentation

◆ next() [1/2]

int AudioDelay< NUM_BUFFER_SAMPLES, int >::next ( int  in_value)
inlineinherited

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 77 of file AudioDelay.h.

◆ next() [2/2]

int AudioDelay< NUM_BUFFER_SAMPLES, int >::next ( int  in_value,
unsigned int  delaytime_cells 
)
inlineinherited

Input a value to the delay and retrieve the signal in the delay line at the position delaytime_cells.

Parameters
in_valuethe signal input.
delaytime_cellssets the delay time in terms of cells in the delay buffer.

Definition at line 59 of file AudioDelay.h.

◆ read()

int AudioDelay< NUM_BUFFER_SAMPLES, int >::read ( unsigned int  delaytime_cells)
inlineinherited

Retrieve the signal in the delay line at the position delaytime_cells.

It doesn't change the stored internal value of _delaytime_cells.

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

Definition at line 104 of file AudioDelay.h.

◆ set()

void AudioDelay< NUM_BUFFER_SAMPLES, int >::set ( unsigned int  delaytime_cells)
inlineinherited

Set the delay time, measured in cells.

Parameters
delaytime_cellshow many cells to delay the input signal by.

Definition at line 94 of file AudioDelay.h.