LMMS
Loading...
Searching...
No Matches
dsp::simple_delay< N, T > Struct Template Reference

#include <delay.h>

Public Member Functions

 simple_delay ()
void reset ()
void put (T idata)
template<class U>
void get (U &odata, int delay)
process (T idata, int delay)
template<class U>
void get_interp (U &odata, int delay, float udelay)
get_interp_1616 (unsigned int delay)
process_comb (T in, unsigned int delay, float fb)
process_comb_lerp16 (T in, unsigned int delay, float udelay, float fb)
process_allpass_comb (T in, unsigned int delay, float fb)
process_allpass_comb_lerp16 (T in, unsigned int delay, float fb)

Public Attributes

auto_buffer< N, T > data
int pos

Detailed Description

template<int N, class T>
struct dsp::simple_delay< N, T >

Delay primitive. Can be used for most delay stuff, including variable (modulated) delays like chorus/flanger. Note that for modulated delay effects use of GetInterp is preferred, because it handles fractional positions and uses linear interpolation, which sounds better most of the time.

Parameters
Nmaximum length
Cnumber of channels read/written for each sample (1 mono, 2 stereo etc)

Constructor & Destructor Documentation

◆ simple_delay()

template<int N, class T>
dsp::simple_delay< N, T >::simple_delay ( )
inline

Member Function Documentation

◆ get()

template<int N, class T>
template<class U>
void dsp::simple_delay< N, T >::get ( U & odata,
int delay )
inline

Read one C-channel sample into odata[0], odata[1] etc into buffer. Don't use for modulated delays (chorus/flanger etc) unless you want them to crackle and generally sound ugly

Parameters
odatapointer to write into
delaydelay relative to current writing pos

◆ get_interp()

template<int N, class T>
template<class U>
void dsp::simple_delay< N, T >::get_interp ( U & odata,
int delay,
float udelay )
inline

Read one C-channel sample at fractional position. This version can be used for modulated delays, because it uses linear interpolation.

Parameters
odatavalue to write into
delaydelay relative to current writing pos
udelayfractional delay (0..1)

◆ get_interp_1616()

template<int N, class T>
T dsp::simple_delay< N, T >::get_interp_1616 ( unsigned int delay)
inline

Read one C-channel sample at fractional position. This version can be used for modulated delays, because it uses linear interpolation.

Parameters
odatavalue to write into
delaydelay relative to current writing pos
udelayfractional delay (0..1)

◆ process()

template<int N, class T>
T dsp::simple_delay< N, T >::process ( T idata,
int delay )
inline

Read and write during the same function call

◆ process_allpass_comb()

template<int N, class T>
T dsp::simple_delay< N, T >::process_allpass_comb ( T in,
unsigned int delay,
float fb )
inline

Comb allpass filter. The comb filter with additional direct path, which is supposed to cancel the coloration.

Parameters
ininput signal
delaydelay length (must be <N and integer)
fbfeedback (must be <1 or it will be unstable)

◆ process_allpass_comb_lerp16()

template<int N, class T>
T dsp::simple_delay< N, T >::process_allpass_comb_lerp16 ( T in,
unsigned int delay,
float fb )
inline

Comb allpass filter. The comb filter with additional direct path, which is supposed to cancel the coloration.

Parameters
ininput signal
delayfractional delay length (must be < 65536 * N)
fbfeedback (must be <1 or it will be unstable)

◆ process_comb()

template<int N, class T>
T dsp::simple_delay< N, T >::process_comb ( T in,
unsigned int delay,
float fb )
inline

Comb filter. Feedback delay line with given delay and feedback values

Parameters
ininput signal
delaydelay length (must be <N and integer)
fbfeedback (must be <1 or it will be unstable)

◆ process_comb_lerp16()

template<int N, class T>
T dsp::simple_delay< N, T >::process_comb_lerp16 ( T in,
unsigned int delay,
float udelay,
float fb )
inline

Comb filter with linear interpolation. Feedback delay line with given delay and feedback values Note that linear interpolation introduces some weird effects in frequency response.

Parameters
ininput signal
delayfractional delay length (must be < 65536 * N)
fbfeedback (must be <1 or it will be unstable)

◆ put()

template<int N, class T>
void dsp::simple_delay< N, T >::put ( T idata)
inline

Write one C-channel sample from idata[0], idata[1] etc into buffer

◆ reset()

template<int N, class T>
void dsp::simple_delay< N, T >::reset ( )
inline

Member Data Documentation

◆ data

template<int N, class T>
auto_buffer<N, T> dsp::simple_delay< N, T >::data

◆ pos

template<int N, class T>
int dsp::simple_delay< N, T >::pos

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