OpenShot Audio Library | OpenShotAudio 0.4.0
juce::dsp::DelayLine< SampleType, InterpolationType > Class Template Reference

#include <juce_DelayLine.h>

Public Member Functions

 DelayLine ()
 
 DelayLine (int maximumDelayInSamples)
 
void setDelay (SampleType newDelayInSamples)
 
SampleType getDelay () const
 
void prepare (const ProcessSpec &spec)
 
void setMaximumDelayInSamples (int maxDelayInSamples)
 
int getMaximumDelayInSamples () const noexcept
 
void reset ()
 
void pushSample (int channel, SampleType sample)
 
SampleType popSample (int channel, SampleType delayInSamples=-1, bool updateReadPointer=true)
 
template<typename ProcessContext >
void process (const ProcessContext &context) noexcept
 

Detailed Description

template<typename SampleType, typename InterpolationType = DelayLineInterpolationTypes::Linear>
class juce::dsp::DelayLine< SampleType, InterpolationType >

A delay line processor featuring several algorithms for the fractional delay calculation, block processing, and sample-by-sample processing useful when modulating the delay in real time or creating a standard delay effect with feedback.

Note: If you intend to change the delay in real time, you may want to smooth changes to the delay systematically using either a ramp or a low-pass filter.

See also
SmoothedValue, FirstOrderTPTFilter

Definition at line 92 of file juce_DelayLine.h.

Constructor & Destructor Documentation

◆ DelayLine() [1/2]

template<typename SampleType , typename InterpolationType >
juce::dsp::DelayLine< SampleType, InterpolationType >::DelayLine

Default constructor.

Definition at line 31 of file juce_DelayLine.cpp.

◆ DelayLine() [2/2]

template<typename SampleType , typename InterpolationType >
juce::dsp::DelayLine< SampleType, InterpolationType >::DelayLine ( int  maximumDelayInSamples)
explicit

Constructor.

Definition at line 37 of file juce_DelayLine.cpp.

Member Function Documentation

◆ getDelay()

template<typename SampleType , typename InterpolationType >
SampleType juce::dsp::DelayLine< SampleType, InterpolationType >::getDelay

Returns the current delay in samples.

Definition at line 61 of file juce_DelayLine.cpp.

◆ getMaximumDelayInSamples()

template<typename SampleType , typename InterpolationType = DelayLineInterpolationTypes::Linear>
int juce::dsp::DelayLine< SampleType, InterpolationType >::getMaximumDelayInSamples ( ) const
inlinenoexcept

Gets the maximum possible delay in samples.

For very short delay times, the result of getMaximumDelayInSamples() may differ from the last value passed to setMaximumDelayInSamples().

Definition at line 126 of file juce_DelayLine.h.

◆ popSample()

template<typename SampleType , typename InterpolationType >
SampleType juce::dsp::DelayLine< SampleType, InterpolationType >::popSample ( int  channel,
SampleType  delayInSamples = -1,
bool  updateReadPointer = true 
)

Pops a single sample from one channel of the delay line.

Use this function to modulate the delay in real time or implement standard delay effects with feedback.

Parameters
channelthe target channel for the delay line.
delayInSamplessets the wanted fractional delay in samples, or -1 to use the value being used before or set with setDelay function.
updateReadPointershould be set to true if you use the function once for each sample, or false if you need multi-tap delay capabilities.
See also
setDelay, pushSample, process

Definition at line 112 of file juce_DelayLine.cpp.

Referenced by juce::dsp::DelayLine< SampleType, InterpolationType >::process().

◆ prepare()

template<typename SampleType , typename InterpolationType >
void juce::dsp::DelayLine< SampleType, InterpolationType >::prepare ( const ProcessSpec spec)

Initialises the processor.

Definition at line 68 of file juce_DelayLine.cpp.

Referenced by juce::dsp::Chorus< SampleType >::prepare().

◆ process()

template<typename SampleType , typename InterpolationType = DelayLineInterpolationTypes::Linear>
template<typename ProcessContext >
void juce::dsp::DelayLine< SampleType, InterpolationType >::process ( const ProcessContext &  context)
inlinenoexcept

Processes the input and output samples supplied in the processing context.

Can be used for block processing when the delay is not going to change during processing. The delay must first be set by calling setDelay.

See also
setDelay

Definition at line 170 of file juce_DelayLine.h.

◆ pushSample()

template<typename SampleType , typename InterpolationType >
void juce::dsp::DelayLine< SampleType, InterpolationType >::pushSample ( int  channel,
SampleType  sample 
)

Pushes a single sample into one channel of the delay line.

Use this function and popSample instead of process if you need to modulate the delay in real time instead of using a fixed delay value, or if you want to code a delay effect with a feedback loop.

See also
setDelay, popSample, process

Definition at line 105 of file juce_DelayLine.cpp.

Referenced by juce::dsp::DelayLine< SampleType, InterpolationType >::process().

◆ reset()

template<typename SampleType , typename InterpolationType >
void juce::dsp::DelayLine< SampleType, InterpolationType >::reset

Resets the internal state variables of the processor.

Definition at line 93 of file juce_DelayLine.cpp.

◆ setDelay()

template<typename SampleType , typename InterpolationType >
void juce::dsp::DelayLine< SampleType, InterpolationType >::setDelay ( SampleType  newDelayInSamples)

Sets the delay in samples.

Definition at line 48 of file juce_DelayLine.cpp.

◆ setMaximumDelayInSamples()

template<typename SampleType , typename InterpolationType >
void juce::dsp::DelayLine< SampleType, InterpolationType >::setMaximumDelayInSamples ( int  maxDelayInSamples)

Sets a new maximum delay in samples.

Also clears the delay line.

This may allocate internally, so you should never call it from the audio thread.

Definition at line 84 of file juce_DelayLine.cpp.


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