46 template<
class MemoryType>
98 memory_ = std::make_unique<MemoryType>(size);
135 virtual void process(
int num_samples)
override;
303 JUCE_LEAK_DETECTOR(
Delay)
A flexible delay line effect processor that can operate in various styles and apply filtering.
Definition delay.h:47
poly_float tickCleanUnfiltered(poly_float audio_in, poly_float period, poly_float feedback, poly_float wet, poly_float dry)
A single-sample tick for a clean, unfiltered delay line.
Definition delay.cpp:368
poly_float wet_
Current wet mix value.
Definition delay.h:292
virtual ~Delay()
Virtual destructor.
Definition delay.h:114
void processCleanUnfiltered(const poly_float *audio_in, int num_samples, poly_float current_period, poly_float current_feedback, poly_float current_wet, poly_float current_dry)
Processes a clean, unfiltered delay without clamping or filtering.
Definition delay.cpp:183
poly_float tickMonoPingPong(poly_float audio_in, poly_float period, poly_float feedback, poly_float filter_gain, poly_float low_coefficient, poly_float high_coefficient, poly_float wet, poly_float dry)
A single-sample tick for a mono ping-pong delay line.
Definition delay.cpp:438
poly_float feedback_
Current feedback value.
Definition delay.h:291
Style
Styles of delay.
Definition delay.h:81
@ kNumStyles
Definition delay.h:86
@ kClampedDampened
Definition delay.h:87
@ kMono
Definition delay.h:82
@ kMidPingPong
Definition delay.h:85
@ kPingPong
Definition delay.h:84
@ kClampedUnfiltered
Definition delay.h:88
@ kStereo
Definition delay.h:83
@ kUnclampedUnfiltered
Definition delay.h:89
void processPingPong(const poly_float *audio_in, int num_samples, poly_float current_period, poly_float current_feedback, poly_float current_filter_gain, poly_float current_low_coefficient, poly_float current_high_coefficient, poly_float current_wet, poly_float current_dry)
Processes a ping-pong delay, alternating the delayed signal between channels.
Definition delay.cpp:298
virtual void processWithInput(const poly_float *audio_in, int num_samples) override
Processes a block of audio from a given input buffer.
Definition delay.cpp:83
OnePoleFilter low_pass_
Low-pass filter for damping/frequency shaping.
Definition delay.h:300
poly_float tick(poly_float audio_in, poly_float period, poly_float feedback, poly_float filter_gain, poly_float low_coefficient, poly_float high_coefficient, poly_float wet, poly_float dry)
A single-sample tick for a filtered delay line.
Definition delay.cpp:392
static constexpr mono_float kDefaultPeriod
Default delay period in samples.
Definition delay.h:51
static poly_float getFilterRadius(poly_float spread)
Computes the filter radius based on spread.
Definition delay.h:62
std::unique_ptr< MemoryType > memory_
Internal memory buffer for delay line.
Definition delay.h:289
Processor * clone() const override
Clones this Processor for polyphonic expansion. Must be overridden by subclasses.
Definition delay.h:116
void processMonoPingPong(const poly_float *audio_in, int num_samples, poly_float current_period, poly_float current_feedback, poly_float current_filter_gain, poly_float current_low_coefficient, poly_float current_high_coefficient, poly_float current_wet, poly_float current_dry)
Processes a mono ping-pong delay, collapsing input before ping-ponging.
Definition delay.cpp:333
poly_float last_frequency_
Tracks last frequency for smoothing delay time changes.
Definition delay.h:290
Delay()
Protected default constructor for derived classes.
Definition delay.h:287
poly_float filter_gain_
Gain applied before filtering stages.
Definition delay.h:298
virtual void process(int num_samples) override
Processes a block of audio using the connected inputs.
Definition delay.cpp:68
@ kFrequency
Base delay frequency.
Definition delay.h:70
@ kFeedback
Feedback amount.
Definition delay.h:72
@ kWet
Wet mix amount.
Definition delay.h:69
@ kFilterCutoff
Filter cutoff (in MIDI note).
Definition delay.h:75
@ kNumInputs
Definition delay.h:77
@ kDamping
Damping control.
Definition delay.h:73
@ kFilterSpread
Filter spread around cutoff.
Definition delay.h:76
@ kStyle
Delay style selection.
Definition delay.h:74
@ kFrequencyAux
Auxiliary delay frequency (for stereo/ping-pong).
Definition delay.h:71
@ kAudio
Input audio signal.
Definition delay.h:68
poly_float tickDamped(poly_float audio_in, poly_float period, poly_float feedback, poly_float low_coefficient, poly_float wet, poly_float dry)
A single-sample tick for a damped delay line using a low-pass filter.
Definition delay.cpp:408
void hardReset() override
Hard-resets the delay line and internal filters.
Definition delay.cpp:43
void processUnfiltered(const poly_float *audio_in, int num_samples, poly_float current_period, poly_float current_feedback, poly_float current_wet, poly_float current_dry)
Processes an unfiltered delay with possible feedback saturation.
Definition delay.cpp:208
static constexpr mono_float kMinDampNote
Minimum MIDI note for damping frequency.
Definition delay.h:53
poly_float low_coefficient_
Low-pass filter coefficient.
Definition delay.h:296
void setMaxSamples(int max_samples)
Sets the maximum number of samples for the delay.
Definition delay.cpp:57
Delay(int size)
Constructs a Delay processor with a given memory size.
Definition delay.h:97
poly_float period_
Current delay period in samples.
Definition delay.h:294
static constexpr mono_float kMaxDampNote
Maximum MIDI note for damping frequency.
Definition delay.h:54
poly_float tickUnfiltered(poly_float audio_in, poly_float period, poly_float feedback, poly_float wet, poly_float dry)
A single-sample tick for an unfiltered delay line with saturation.
Definition delay.cpp:380
void processDamped(const poly_float *audio_in, int num_samples, poly_float current_period, poly_float current_feedback, poly_float current_low_coefficient, poly_float current_wet, poly_float current_dry)
Processes a damped delay line using a low-pass filter for damping.
Definition delay.cpp:268
OnePoleFilter high_pass_
High-pass filter for shaping.
Definition delay.h:301
static constexpr mono_float kDelayHalfLife
Time constant for smoothing frequency transitions.
Definition delay.h:52
poly_float high_coefficient_
High-pass filter coefficient.
Definition delay.h:297
poly_float dry_
Current dry mix value.
Definition delay.h:293
static constexpr mono_float kSpreadOctaveRange
Constants for internal calculations.
Definition delay.h:50
poly_float tickPingPong(poly_float audio_in, poly_float period, poly_float feedback, poly_float filter_gain, poly_float low_coefficient, poly_float high_coefficient, poly_float wet, poly_float dry)
A single-sample tick for a ping-pong delay line.
Definition delay.cpp:422
A one-pole filter implementation with optional nonlinear saturation.
Definition one_pole_filter.h:22
Base class for all signal-processing units in Vital.
Definition processor.h:212
#define VITAL_ASSERT(x)
Definition common.h:11
Declares classes for time-domain memory storage and retrieval with cubic interpolation.
force_inline poly_float min(poly_float left, poly_float right)
Returns the minimum of two poly_floats lane-by-lane.
Definition poly_utils.h:334
force_inline poly_float max(poly_float left, poly_float right)
Returns the maximum of two poly_floats lane-by-lane.
Definition poly_utils.h:327
Contains classes and functions used within the Vital synthesizer framework.
Delay< StereoMemory > StereoDelay
StereoDelay is a Delay processor specialized with StereoMemory.
Definition delay.h:307
constexpr int kNotesPerOctave
Number of semitones per octave.
Definition common.h:51
Delay< Memory > MultiDelay
MultiDelay is a Delay processor specialized with Memory.
Definition delay.h:310
float mono_float
Definition common.h:33
Declares the Processor class and related structures for handling audio processing in a polyphonic con...
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600