99 void process(
int num_samples)
override;
110 void process(RandomState* state,
int num_samples);
Base class for all signal-processing units in Vital.
Definition processor.h:212
A Low-Frequency Oscillator (LFO) that generates random modulation signals.
Definition random_lfo.h:16
RandomLfo()
Constructs a RandomLfo processor with default parameters.
Definition random_lfo.cpp:22
std::shared_ptr< double > sync_seconds_
A shared double holding the sync reference time in seconds.
Definition random_lfo.h:169
std::shared_ptr< double > last_sync_
A shared double holding the last sync time for comparison.
Definition random_lfo.h:170
utils::RandomGenerator random_generator_
A random generator to produce random values for the LFO.
Definition random_lfo.h:166
std::shared_ptr< RandomState > shared_state_
A shared RandomState (used when syncing across instances).
Definition random_lfo.h:164
virtual Processor * clone() const override
Clones the RandomLfo, creating an identical instance.
Definition random_lfo.h:89
void process(int num_samples) override
Processes a block of samples.
Definition random_lfo.cpp:109
RandomType
The types of random waveforms supported by RandomLfo.
Definition random_lfo.h:72
@ kSampleAndHold
Definition random_lfo.h:74
@ kNumStyles
Definition random_lfo.h:77
@ kSinInterpolate
Definition random_lfo.h:75
@ kLorenzAttractor
Definition random_lfo.h:76
@ kPerlin
Definition random_lfo.h:73
void processSampleAndHold(RandomState *state, int num_samples)
Processes the LFO in Sample-And-Hold mode.
Definition random_lfo.cpp:191
void correctToTime(double seconds)
Adjusts the LFO to match a specific time reference (in seconds), for synchronization.
Definition random_lfo.cpp:283
poly_int updatePhase(RandomState *state, int num_samples)
Updates the LFO phase and determines if a new random value is needed.
Definition random_lfo.cpp:62
poly_float last_value_
The last output value of the LFO.
Definition random_lfo.h:167
@ kStereo
Definition random_lfo.h:60
@ kReset
Definition random_lfo.h:56
@ kRandomType
Definition random_lfo.h:59
@ kStyle
Definition random_lfo.h:58
@ kFrequency
Definition random_lfo.h:54
@ kSync
Definition random_lfo.h:57
@ kAmplitude
Definition random_lfo.h:55
@ kNumInputs
Definition random_lfo.h:61
void processLorenzAttractor(RandomState *state, int num_samples)
Processes the LFO using a Lorenz attractor model.
Definition random_lfo.cpp:215
void doReset(RandomState *state, bool mono, poly_float frequency)
Resets the LFO phase and random values if a reset trigger occurs.
Definition random_lfo.cpp:29
RandomState state_
The main internal RandomState for this LFO instance.
Definition random_lfo.h:163
A basic random number generator for producing uniform distributions of floats.
Definition utils.h:61
Contains classes and functions used within the Vital synthesizer framework.
Declares the Processor class and related structures for handling audio processing in a polyphonic con...
Holds the internal state of the RandomLfo for a given voice or channel.
Definition random_lfo.h:24
poly_float state1
Definition random_lfo.h:39
RandomState()
Definition random_lfo.h:25
poly_float last_random_value
The previously generated random value.
Definition random_lfo.h:35
poly_float state2
Definition random_lfo.h:39
poly_float next_random_value
The next target random value for interpolation.
Definition random_lfo.h:36
poly_float state3
Definition random_lfo.h:39
poly_float offset
Current offset (phase) in the LFO cycle.
Definition random_lfo.h:34
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
Provides various utility functions, classes, and constants for audio, math, and general-purpose opera...