130 void process(
int num_samples)
override;
159 while (scale < ratio)
216 poly_int indices = (
poly_int(write_index_ * poly_float::kSize) - offset) & allpass_mask_;
217 return poly_float(lookup[indices[0]], lookup[indices[1]], lookup[indices[2]], lookup[indices[3]]);
228 buffer[0] = buffer[max_feedback_size_];
229 buffer[max_feedback_size_ + 1] = buffer[1];
230 buffer[max_feedback_size_ + 2] = buffer[2];
231 buffer[max_feedback_size_ + 3] = buffer[3];
244 std::unique_ptr<StereoMemory> memory_;
254 std::unique_ptr<mono_float[]> feedback_memories_[
kNetworkSize];
364 int max_allpass_size_;
369 int max_feedback_size_;
384 int poly_allpass_mask_;
386 JUCE_LEAK_DETECTOR(
Reverb)
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
A Processor implementing a dense feedback network reverb.
Definition reverb.h:16
void hardReset() override
Resets the reverb, clearing buffer contents and resetting filters.
Definition reverb.cpp:483
static constexpr float kMinDelay
Minimum delay (in samples) used for certain time-domain operations.
Definition reverb.h:31
void setSampleRate(int sample_rate) override
Overrides base class to update reverb internal buffers at a new sample rate.
Definition reverb.cpp:462
force_inline poly_float readAllpass(const mono_float *lookup, poly_int offset)
Reads from the all-pass filters using integer offsets.
Definition reverb.h:215
static constexpr mono_float kT60Amplitude
Amplitude at which we consider the reverb tail to effectively end (T60).
Definition reverb.h:21
static constexpr int kDefaultSampleRate
Default sample rate used for internal buffer initialization.
Definition reverb.h:41
force_inline int getBufferScale(int sample_rate)
Computes a buffer scaling factor based on current sample rate.
Definition reverb.h:156
static constexpr int kMinSizePower
Minimum size exponent for reverb buffer scale.
Definition reverb.h:71
static constexpr int kExtraLookupSample
Extra samples in the buffer to allow for interpolation overflow.
Definition reverb.h:56
virtual ~Reverb()
Default destructor.
Definition reverb.h:123
force_inline poly_float readFeedback(const mono_float *const *lookups, poly_float offset)
Reads from the feedback delay line with polynomial interpolation.
Definition reverb.h:197
force_inline float getSampleRateRatio(int sample_rate)
Returns the ratio of the current sample rate to kBaseSampleRate.
Definition reverb.h:146
void setOversampleAmount(int oversample_amount) override
Overrides base class to handle changes in oversampling factor.
Definition reverb.cpp:472
static constexpr int kNetworkContainers
Number of poly_float-sized containers covering the entire network.
Definition reverb.h:66
static const poly_float kFeedbackDelays[kNetworkContainers]
Fixed feedback delays (in samples) for each container.
Definition reverb.h:91
void setupBuffersForSampleRate(int sample_rate)
Adjusts internal buffer sizes and states for the given sample rate.
Definition reverb.cpp:79
@ kNumInputs
Total number of inputs.
Definition reverb.h:112
@ kChorusFrequency
Frequency of the chorus LFO (Hz)
Definition reverb.h:107
@ kPreHighCutoff
Pre-filter high cutoff (MIDI note)
Definition reverb.h:101
@ kSize
Overall size (scales buffer size exponent)
Definition reverb.h:109
@ kChorusAmount
Amount of chorusing applied to feedback lines.
Definition reverb.h:106
@ kStereoWidth
Stereo width parameter (not used in all reverb modes)
Definition reverb.h:108
@ kAudio
Audio input buffer.
Definition reverb.h:98
@ kHighGain
High-frequency attenuation (dB)
Definition reverb.h:105
@ kDelay
Additional pre-delay in samples.
Definition reverb.h:110
@ kPreLowCutoff
Pre-filter low cutoff (MIDI note)
Definition reverb.h:100
@ kHighCutoff
Internal feedback high cutoff (MIDI note)
Definition reverb.h:104
@ kLowCutoff
Internal feedback low cutoff (MIDI note)
Definition reverb.h:102
@ kDecayTime
Reverb decay time in seconds.
Definition reverb.h:99
@ kLowGain
Low-frequency attenuation (dB)
Definition reverb.h:103
@ kWet
Dry/wet mix.
Definition reverb.h:111
static constexpr mono_float kAllpassFeedback
Feedback coefficient for all-pass filter sections.
Definition reverb.h:26
static constexpr int kBaseSampleRate
Reference sample rate for the base reverb time calculations.
Definition reverb.h:36
virtual Processor * clone() const override
Creates a clone of this Processor. (Not implemented for Reverb).
Definition reverb.h:238
static const poly_int kAllpassDelays[kNetworkContainers]
Fixed all-pass filter delays for each container.
Definition reverb.h:86
static constexpr int kBaseAllpassBits
Base bits used for the all-pass filters’ buffer size.
Definition reverb.h:61
static constexpr int kBaseFeedbackBits
Base bits used for feedback buffer size calculations.
Definition reverb.h:51
Reverb()
Constructs a Reverb processor with default configuration.
Definition reverb.cpp:41
static constexpr int kMaxSizePower
Maximum size exponent for reverb buffer scale.
Definition reverb.h:76
void process(int num_samples) override
Processes audio by pulling from the kAudio input buffer.
Definition reverb.cpp:113
static constexpr float kSizePowerRange
The exponent range (max minus min).
Definition reverb.h:81
void processWithInput(const poly_float *audio_in, int num_samples) override
Processes a block of audio using a provided input buffer.
Definition reverb.cpp:128
static constexpr int kNetworkSize
Number of feedback delay lines in the network.
Definition reverb.h:46
force_inline void wrapFeedbackBuffer(mono_float *buffer)
Wraps the feedback buffer to preserve continuity for polynomial interpolation.
Definition reverb.h:227
#define VITAL_ASSERT(x)
Definition common.h:11
#define force_inline
Definition common.h:23
force_inline poly_float floor(poly_float value)
Floors each lane in value.
Definition poly_utils.h:777
force_inline matrix getPolynomialInterpolationMatrix(poly_float t_from)
Creates a matrix for polynomial interpolation given a starting poly_float t_from.
Definition poly_utils.h:205
force_inline matrix getValueMatrix(const mono_float *buffer, poly_int indices)
Creates a matrix of 4 poly_float lanes from a single buffer at varying indices.
Definition poly_utils.h:262
force_inline poly_int toInt(poly_float floats)
Casts a poly_float to poly_int by truncation.
Definition poly_utils.h:748
Contains classes and functions used within the Vital synthesizer framework.
float mono_float
Definition common.h:33
Declares the Processor class and related structures for handling audio processing in a polyphonic con...
A structure representing a 4x1 matrix of poly_float rows.
Definition matrix.h:19
force_inline poly_float multiplyAndSumRows(const matrix &other)
Multiplies and sums corresponding rows of this matrix with another matrix.
Definition matrix.h:93
force_inline void transpose()
Transposes the matrix in-place.
Definition matrix.h:44
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
Represents a vector of integer values using SIMD instructions.
Definition poly_values.h:56