OpenShot Audio Library | OpenShotAudio 0.4.0
|
#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 |
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.
Definition at line 92 of file juce_DelayLine.h.
juce::dsp::DelayLine< SampleType, InterpolationType >::DelayLine |
Default constructor.
Definition at line 31 of file juce_DelayLine.cpp.
|
explicit |
Constructor.
Definition at line 37 of file juce_DelayLine.cpp.
SampleType juce::dsp::DelayLine< SampleType, InterpolationType >::getDelay |
Returns the current delay in samples.
Definition at line 61 of file juce_DelayLine.cpp.
|
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.
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.
channel | the target channel for the delay line. |
delayInSamples | sets the wanted fractional delay in samples, or -1 to use the value being used before or set with setDelay function. |
updateReadPointer | should be set to true if you use the function once for each sample, or false if you need multi-tap delay capabilities. |
Definition at line 112 of file juce_DelayLine.cpp.
Referenced by juce::dsp::DelayLine< SampleType, InterpolationType >::process().
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().
|
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.
Definition at line 170 of file juce_DelayLine.h.
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.
Definition at line 105 of file juce_DelayLine.cpp.
Referenced by juce::dsp::DelayLine< SampleType, InterpolationType >::process().
void juce::dsp::DelayLine< SampleType, InterpolationType >::reset |
Resets the internal state variables of the processor.
Definition at line 93 of file juce_DelayLine.cpp.
void juce::dsp::DelayLine< SampleType, InterpolationType >::setDelay | ( | SampleType | newDelayInSamples | ) |
Sets the delay in samples.
Definition at line 48 of file juce_DelayLine.cpp.
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.