183 void process(
int num_samples)
override;
A class for generating and storing a line shape, defined by a series of points and associated powers.
Definition line_generator.h:20
force_inline int resolution() const
Gets the resolution of the line's internal buffer.
Definition line_generator.h:266
force_inline vital::mono_float * getCubicInterpolationBuffer() const
Gets a pointer to the buffer used for cubic interpolation.
Definition line_generator.h:298
Base class for all signal-processing units in Vital.
Definition processor.h:212
force_inline Input * input(unsigned int index=0) const
Retrieves the Input pointer at a given index.
Definition processor.h:587
A versatile Low-Frequency Oscillator (LFO) for audio synthesis, supporting multiple sync modes and sm...
Definition synth_lfo.h:16
virtual Processor * clone() const override
Clones the SynthLfo processor, creating a new instance with the same settings.
Definition synth_lfo.h:173
force_inline poly_mask getReleaseMask()
Determines which voices are in the release state based on note triggers.
Definition synth_lfo.h:163
void processTrigger()
Handles trigger events (note on/off), resets, and updates masks for held states.
Definition synth_lfo.cpp:19
LfoState audio_rate_state_
State used during audio-rate processing.
Definition synth_lfo.h:254
poly_float processAudioRateSustainEnvelope(int num_samples, poly_float current_phase, poly_float current_offset, poly_float delta_offset)
Processes the LFO in "Sustain Envelope" mode at audio rate.
Definition synth_lfo.cpp:200
poly_float trigger_delay_
The delay (in seconds) to apply before the LFO starts after a trigger.
Definition synth_lfo.h:258
void process(int num_samples) override
Processes a block of samples, updating the LFO output.
Definition synth_lfo.cpp:441
void correctToTime(double seconds)
Updates the LFO to align with a given time in seconds, enabling synchronization with an external cloc...
Definition synth_lfo.cpp:460
void processAudioRate(int num_samples)
Processes the LFO at audio rate (per sample).
Definition synth_lfo.cpp:406
static constexpr float kMinHalfLife
Definition synth_lfo.h:118
@ kValue
Definition synth_lfo.h:56
@ kOscPhase
Definition synth_lfo.h:57
@ kOscFrequency
Definition synth_lfo.h:58
@ kNumOutputs
Definition synth_lfo.h:59
std::shared_ptr< double > sync_seconds_
Shared pointer to an external time reference for syncing.
Definition synth_lfo.h:262
poly_int trigger_sample_
The sample index at which the note was triggered.
Definition synth_lfo.h:257
poly_float processAudioRateLoopPoint(int num_samples, poly_float current_phase, poly_float current_offset, poly_float delta_offset)
Processes the LFO in "LoopPoint" mode at audio rate.
Definition synth_lfo.cpp:307
void processControlRate(int num_samples)
Processes the LFO at control rate (e.g., once per block) instead of every sample.
Definition synth_lfo.cpp:63
static constexpr mono_float kMaxPower
Definition synth_lfo.h:116
poly_mask held_mask_
A mask indicating which voices are currently held (for sustain envelope modes).
Definition synth_lfo.h:256
SyncType
Different synchronization modes for the LFO.
Definition synth_lfo.h:72
@ kEnvelope
Definition synth_lfo.h:75
@ kSustainEnvelope
Definition synth_lfo.h:76
@ kSync
Definition synth_lfo.h:74
@ kLoopPoint
Definition synth_lfo.h:77
@ kNumSyncTypes
Definition synth_lfo.h:79
@ kTrigger
Definition synth_lfo.h:73
@ kLoopHold
Definition synth_lfo.h:78
LineGenerator * source_
The LineGenerator providing the waveform data for the LFO.
Definition synth_lfo.h:260
force_inline poly_float getValueAtPhase(mono_float *buffer, poly_float resolution, poly_int max_index, poly_float phase)
Retrieves the LFO value at a given phase using a cubic interpolation on the line generator data.
Definition synth_lfo.h:129
@ kNumSyncOptions
Definition synth_lfo.h:98
@ kKeytrack
Definition synth_lfo.h:97
@ kTempo
Definition synth_lfo.h:94
@ kTripletTempo
Definition synth_lfo.h:96
@ kDottedTempo
Definition synth_lfo.h:95
@ kTime
Definition synth_lfo.h:93
force_inline poly_float getValueAtPhase(poly_float phase)
Retrieves the LFO value at a given phase using the internal line generator source.
Definition synth_lfo.h:148
LfoState control_rate_state_
State used during control-rate processing.
Definition synth_lfo.h:253
poly_float processAudioRateEnvelope(int num_samples, poly_float current_phase, poly_float current_offset, poly_float delta_offset)
Processes the LFO in "Envelope" sync mode at audio rate.
Definition synth_lfo.cpp:151
SynthLfo(LineGenerator *source)
Constructs a SynthLfo processor with a given LineGenerator source.
Definition synth_lfo.cpp:11
bool was_control_rate_
Tracks if the previous processing block was at control rate.
Definition synth_lfo.h:252
poly_float processAudioRateLfo(int num_samples, poly_float current_phase, poly_float current_offset, poly_float delta_offset)
Processes the LFO in regular LFO mode (Trigger or Sync) at audio rate.
Definition synth_lfo.cpp:255
poly_float processAudioRateLoopHold(int num_samples, poly_float current_phase, poly_float current_offset, poly_float delta_offset)
Processes the LFO in "LoopHold" mode at audio rate.
Definition synth_lfo.cpp:356
static constexpr float kHalfLifeRatio
Definition synth_lfo.h:117
@ kPhase
Definition synth_lfo.h:35
@ kFade
Definition synth_lfo.h:40
@ kSmoothMode
Definition synth_lfo.h:39
@ kSmoothTime
Definition synth_lfo.h:41
@ kDelay
Definition synth_lfo.h:43
@ kFrequency
Definition synth_lfo.h:34
@ kSyncType
Definition synth_lfo.h:38
@ kNumInputs
Definition synth_lfo.h:45
@ kStereoPhase
Definition synth_lfo.h:42
@ kAmplitude
Definition synth_lfo.h:36
@ kNoteCount
Definition synth_lfo.h:44
@ kNoteTrigger
Definition synth_lfo.h:37
#define force_inline
Definition common.h:23
force_inline poly_float clamp(poly_float value, mono_float min, mono_float max)
Clamps each lane of a vector to [min, max].
Definition poly_utils.h:306
force_inline poly_float toFloat(poly_int integers)
Casts a poly_int to poly_float lane-by-lane.
Definition poly_utils.h:733
force_inline matrix getCatmullInterpolationMatrix(poly_float t)
Creates a Catmull-Rom interpolation matrix from a poly_float t.
Definition poly_utils.h:227
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.
@ kVoiceOff
Definition common.h:80
float mono_float
Definition common.h:33
Declares the Processor class and related structures for handling audio processing in a polyphonic con...
poly_mask trigger_mask
Mask for triggered voices.
Definition processor.h:115
poly_float trigger_value
Trigger values for voices.
Definition processor.h:116
Holds the state of the LFO for either control-rate or audio-rate processing.
Definition synth_lfo.h:107
poly_float offset
The current LFO offset (phase offset).
Definition synth_lfo.h:112
poly_float delay_time_passed
How much time has passed since the LFO was triggered or started its delay.
Definition synth_lfo.h:108
poly_float smooth_value
The stored value for applying smoothing between updates.
Definition synth_lfo.h:110
poly_float fade_amount
Controls how much fade has been applied (not directly updated here).
Definition synth_lfo.h:111
poly_float fade_amplitude
The current fade-in amplitude value.
Definition synth_lfo.h:109
poly_float phase
The current LFO phase.
Definition synth_lfo.h:113
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
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