Class DelayLine
A single-channel circular delay line with integer and fractional (linearly interpolated) taps. The building block for delay, chorus, flanger and reverb effects. Writes are denormal-flushed so a decaying feedback tail cannot stall the CPU on subnormal arithmetic.
public sealed class DelayLine
- Inheritance
-
DelayLine
- Inherited Members
Constructors
DelayLine(int)
Creates a delay line able to produce up to
maxDelaySamples samples of delay.
public DelayLine(int maxDelaySamples)
Parameters
maxDelaySamplesintMaximum delay in samples. Must be at least 1.
Properties
MaxDelaySamples
Maximum delay in samples this line can produce.
public int MaxDelaySamples { get; }
Property Value
Methods
Read(int)
Reads the sample delaySamples samples in the past
(1 = most recently written).
public float Read(int delaySamples)
Parameters
delaySamplesintDelay in samples, from 1 to MaxDelaySamples.
Returns
Read(float)
Reads a fractional delay using linear interpolation between the two neighbouring samples.
public float Read(float delaySamples)
Parameters
delaySamplesfloatDelay in samples (may be fractional), from 1 to MaxDelaySamples.
Returns
Reset()
Clears the delay line.
public void Reset()
Write(float)
Writes one sample into the line, advancing the write head.
public void Write(float sample)
Parameters
samplefloat