pub struct DelayBuffer<F: Flt> { /* private fields */ }
Expand description

This is a delay buffer/line with linear and cubic interpolation.

It’s the basic building block underneath the all-pass filter, comb filters and delay effects. You can use linear and cubic and no interpolation to access samples in the past. Either by sample offset or time (millisecond) based.

Implementations

Creates a delay buffer with about 5 seconds of capacity at 8*48000Hz sample rate.

Creates a delay buffer with the given amount of samples capacity.

Sets the sample rate that is used for milliseconds => sample conversion.

Reset the delay buffer contents and write position.

Feed one sample into the delay line and increment the write pointer. Please note: For sample accurate feedback you need to retrieve the output of the delay line before feeding in a new signal.

Combines DelayBuffer::cubic_interpolate_at and DelayBuffer::feed into one convenient function.

Combines DelayBuffer::linear_interpolate_at and DelayBuffer::feed into one convenient function.

Combines DelayBuffer::nearest_at and DelayBuffer::feed into one convenient function.

Fetch a sample from the delay buffer at the given tim with linear interpolation.

  • delay_time_ms - Delay time in milliseconds.

Fetch a sample from the delay buffer at the given offset with linear interpolation.

  • s_offs - Sample offset in samples.

Fetch a sample from the delay buffer at the given time with cubic interpolation.

  • delay_time_ms - Delay time in milliseconds.

Fetch a sample from the delay buffer at the given offset with cubic interpolation.

  • s_offs - Sample offset in samples into the past of the DelayBuffer from the current write (or the “now”) position.

Fetch a sample from the delay buffer at the given time without any interpolation.

  • delay_time_ms - Delay time in milliseconds.

Fetch a sample from the delay buffer at the given number of samples in the past.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.