29 for (
int i = 0; i < num_samples; ++i) {
31 dest[i] = current_value;
40 current_value_ =
utils::maskLoad(current_value, current_value_, equal_mask);
50 for (
int i = 0; i < num_samples; ++i) {
51 current_value += delta_value;
57 for (
int i = num_samples; i < max_samples; ++i)
58 dest[i] = current_value_;
force_inline int getSampleRate() const
Retrieves the current (effective) sample rate.
Definition processor.h:326
force_inline Output * output(unsigned int index=0) const
Retrieves the Output pointer at a given index.
Definition processor.h:616
virtual void enable(bool enable)
Enables or disables this Processor.
Definition processor.h:318
void linearInterpolate(int num_samples, poly_mask linear_mask)
Performs a linear interpolation if conditions are met for a smoother transition.
Definition smooth_value.cpp:43
virtual void process(int num_samples) override
Processes a block of samples, updating the smoothed value output.
Definition smooth_value.cpp:14
static constexpr mono_float kSmoothCutoff
The cutoff frequency for smoothing, controlling how fast the value settles.
Definition smooth_value.h:26
SmoothValue(mono_float value=0.0f)
Constructs a new SmoothValue with an initial value.
Definition smooth_value.cpp:12
A Processor that maintains and outputs a constant poly_float value.
Definition value.h:24
poly_float value_
The constant output value.
Definition value.h:69
static constexpr mono_float kSmoothCutoff
The cutoff frequency for smoothing at control rate.
Definition smooth_value.h:94
virtual void process(int num_samples) override
Processes the control-rate smoothing for the given number of samples.
Definition smooth_value.cpp:64
SmoothValue(mono_float value=0.0f)
Constructs a new SmoothValue (control-rate) with an initial value.
Definition smooth_value.cpp:62
A control-rate variant of the Value processor.
Definition value.h:82
Contains faster but less accurate versions of utility math functions, such as exponential,...
force_inline mono_float exp(mono_float exponent)
Definition futils.h:132
force_inline bool equal(poly_float left, poly_float right)
Checks if two poly_floats are equal lane-by-lane. Returns true if all lanes match.
Definition poly_utils.h:341
force_inline poly_float maskLoad(poly_float zero_value, poly_float one_value, poly_mask reset_mask)
Selects between two values (zero_value or one_value) based on a mask in each lane.
Definition poly_utils.h:351
force_inline poly_float interpolate(poly_float from, poly_float to, mono_float t)
Performs a linear interpolation between two poly_floats using a scalar t in [0..1].
Definition poly_utils.h:182
Contains classes and functions used within the Vital synthesizer framework.
constexpr mono_float kPi
Pi constant.
Definition common.h:36
float mono_float
Definition common.h:33
Declares the SmoothValue classes, providing time-smoothed transitions for values.
poly_float * buffer
Pointer to the output buffer.
Definition processor.h:110
int buffer_size
Current buffer size in samples.
Definition processor.h:114
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
static force_inline mask_simd_type vector_call equal(simd_type one, simd_type two)
Compares two SIMD float registers for equality, element-wise.
Definition poly_values.h:954
Represents a vector of integer values using SIMD instructions.
Definition poly_values.h:56
static force_inline uint32_t vector_call anyMask(simd_type value)
Returns a bitmask that indicates which bytes/elements in the register are non-zero.
Definition poly_values.h:352