10 beats_per_second_(beats_per_second),
11 frequency_(nullptr), phase_offset_(nullptr), mod_depth_(nullptr),
12 phase_(0.0f), delay_(nullptr) { }
23 static constexpr int kMaxSamples = 40000;
56 static constexpr float kMaxFrequency = 20000.0f;
@ kClampedUnfiltered
Definition delay.h:88
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
@ kFrequency
Base delay frequency.
Definition delay.h:70
@ kFeedback
Feedback amount.
Definition delay.h:72
@ kWet
Wet mix amount.
Definition delay.h:69
@ kStyle
Delay style selection.
Definition delay.h:74
void processWithInput(const poly_float *audio_in, int num_samples) override
Processes audio through the flanger effect using the input buffer and number of samples.
Definition flanger_module.cpp:49
Output * frequency_
The flanger frequency parameter (possibly tempo-synced).
Definition flanger_module.h:97
FlangerModule(const Output *beats_per_second)
Constructs a FlangerModule linked to a beats-per-second output for tempo syncing.
Definition flanger_module.cpp:8
@ kAudioOutput
Definition flanger_module.h:30
@ kFrequencyOutput
Definition flanger_module.h:31
const Output * beats_per_second_
Reference output for tempo sync.
Definition flanger_module.h:96
StereoDelay * delay_
The stereo delay line used to create the flanging effect.
Definition flanger_module.h:104
cr::Value delay_frequency_
Internal parameter representing the current delay frequency set in StereoDelay.
Definition flanger_module.h:103
Output * phase_offset_
Controls stereo phase offset for left/right channels.
Definition flanger_module.h:98
Output * mod_depth_
Controls the depth (amount) of modulation applied to the delay time.
Definition flanger_module.h:100
virtual ~FlangerModule()
Destroys the FlangerModule and releases associated resources.
Definition flanger_module.cpp:14
void correctToTime(double seconds) override
Adjusts the internal modulation phase to align with a given time, useful for syncing to host time.
Definition flanger_module.cpp:80
void init() override
Initializes the FlangerModule by creating parameters and setting up the internal delay line.
Definition flanger_module.cpp:16
Output * center_
Controls the central delay time around which modulation occurs.
Definition flanger_module.h:99
static constexpr mono_float kModulationDelayBuffer
Definition flanger_module.h:21
poly_float phase_
Current modulation phase.
Definition flanger_module.h:101
void useOutput(Output *output)
Uses an existing Output object as this Processor's first output.
Definition processor.cpp:138
force_inline int getSampleRate() const
Retrieves the current (effective) sample rate.
Definition processor.h:326
void plug(const Output *source)
Connects an external Output to this Processor's first input.
Definition processor.cpp:79
virtual void process(int num_samples)=0
Main processing function. Called by the ProcessorRouter.
force_inline Output * output(unsigned int index=0) const
Retrieves the Output pointer at a given index.
Definition processor.h:616
virtual void init()
Called after constructor, used for any additional initialization. Subclasses can override....
Definition processor.h:258
virtual void addIdleProcessor(Processor *processor)
Adds a Processor that should remain idle (not processed) in the router.
Definition processor_router.cpp:146
A ProcessorRouter that encapsulates a cohesive unit of functionality in the synthesizer.
Definition synth_module.h:129
Output * createTempoSyncSwitch(std::string name, Processor *frequency, const Output *beats_per_second, bool poly, Input *midi=nullptr)
Creates a tempo sync switch that toggles between tempo-based frequency and free-running frequency.
Definition synth_module.cpp:289
Output * createMonoModControl(std::string name, bool audio_rate=false, bool smooth_value=false, Output *internal_modulation=nullptr)
Creates a monophonic mod control, including applying parameter scaling.
Definition synth_module.cpp:104
virtual void set(poly_float value)
Sets the internal value to a new poly_float.
Definition value.cpp:17
A control-rate variant of the Value processor.
Definition value.h:82
Declares classes for time-domain memory storage and retrieval with cubic interpolation.
const poly_mask kRightMask
A mask identifying the right channel when comparing to kRightOne.
Definition synth_constants.h:263
force_inline poly_float mod(poly_float value)
Returns the fractional part of each lane by subtracting the floored value.
Definition poly_utils.h:814
force_inline poly_float triangleWave(poly_float t)
Generates a simple triangle wave [0..1] from a fraction t in [0..1].
Definition poly_utils.h:873
force_inline poly_float getCycleOffsetFromSeconds(double seconds, poly_float frequency)
Computes a cycle offset given a time in seconds and a frequency.
Definition poly_utils.h:885
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
force_inline poly_float midiNoteToFrequency(poly_float value)
Converts a MIDI note to a frequency (vectorized).
Definition poly_utils.h:123
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
Holds and manages a buffer of samples (poly_float) for a Processor's output.
Definition processor.h:35
poly_float * buffer
Pointer to the output buffer.
Definition processor.h:110
Processor * owner
Owning processor.
Definition processor.h:112
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600