19 prefix_(std::move(prefix)),
20 create_on_value_(true),
23 filter_model_(nullptr),
26 comb_filter_(nullptr),
27 digital_svf_(nullptr),
28 dirty_filter_(nullptr),
29 formant_filter_(nullptr),
30 ladder_filter_(nullptr),
31 phaser_filter_(nullptr),
32 sallen_key_filter_(nullptr) {
68 current_keytrack->
plug(keytrack_amount, 1);
190 Output* internal_modulation) {
244 poly_float delta_mix = (
mix_ - current_mix) * (1.0f / num_samples);
248 for (
int i = 0; i < num_samples; ++i) {
249 current_mix += delta_mix;
A module that implements a comb filter effect.
Definition comb_module.h:17
void hardReset() override
Performs a hard reset of the comb filter, returning it to its initial state.
Definition comb_module.cpp:43
@ kAudio
Definition comb_module.h:35
@ kFilterCutoffBlend
Definition comb_module.h:39
@ kMidiBlendTranspose
Definition comb_module.h:38
@ kResonance
Definition comb_module.h:41
@ kReset
Definition comb_module.h:36
@ kStyle
Definition comb_module.h:40
@ kMidiCutoff
Definition comb_module.h:37
@ kMidi
Definition comb_module.h:42
A state-variable filter (SVF) implementation, supporting multiple filter types (12/24 dB,...
Definition digital_svf.h:17
void hardReset() override
Performs a complete reset of the filter states for all voices.
Definition digital_svf.cpp:497
A diode ladder filter implementation for the Vital synthesizer.
Definition diode_filter.h:20
void hardReset() override
Performs a complete hard reset of all internal states (for all voices).
Definition diode_filter.cpp:32
A nonlinear filter that produces a "dirty" and saturated sound, ideal for adding character to the sig...
Definition dirty_filter.h:30
void hardReset() override
Hard resets the filter, clearing all internal states.
Definition dirty_filter.cpp:32
SallenKeyFilter * sallen_key_filter_
Sallen-Key filter submodule (analog-inspired).
Definition filter_module.h:147
@ kMidi
Definition filter_module.h:39
@ kReset
Definition filter_module.h:37
@ kKeytrack
Definition filter_module.h:38
@ kAudio
Definition filter_module.h:36
std::string prefix_
A prefix for naming parameters, enabling multiple instances.
Definition filter_module.h:130
Value * filter_model_
A parameter selecting which filter model to use.
Definition filter_module.h:135
void setMono(bool mono)
Configures the FilterModule to be mono or polyphonic.
Definition filter_module.cpp:260
void setModel(int new_model)
Sets the current filter model, enabling the corresponding submodule and disabling others.
Definition filter_module.cpp:199
DirtyFilter * dirty_filter_
"Dirty" filter submodule (non-linear, characterful).
Definition filter_module.h:143
DigitalSvf * digital_svf_
Digital state-variable filter submodule.
Definition filter_module.h:141
Output * filter_mix_
The parameter output controlling the wet/dry mix.
Definition filter_module.h:138
int last_model_
Tracks the last active filter model to detect changes.
Definition filter_module.h:128
bool create_on_value_
Whether an "on" parameter should be created.
Definition filter_module.h:131
FilterModule(std::string prefix="")
Constructs a FilterModule, optionally with a prefix for parameter naming.
Definition filter_module.cpp:15
poly_float mix_
Current wet/dry mix value for blending filtered audio with the original.
Definition filter_module.h:136
bool mono_
True if the filter is in mono mode, false for polyphonic.
Definition filter_module.h:132
void hardReset() override
Performs a hard reset of all filter submodules, clearing their states and buffers.
Definition filter_module.cpp:175
void process(int num_samples) override
Processes a block of samples, applying the selected filter model and mixing the result.
Definition filter_module.cpp:231
Output * createModControl(std::string name, bool audio_rate=false, bool smooth_value=false, Output *internal_modulation=nullptr)
Creates a modulation control parameter for the filter.
Definition filter_module.cpp:189
FormantModule * formant_filter_
Formant filter submodule (for vowel/formant filtering).
Definition filter_module.h:144
CombModule * comb_filter_
Comb filter submodule.
Definition filter_module.h:140
void init() override
Initializes the filter module, creating parameters and linking them to submodules.
Definition filter_module.cpp:58
PhaserFilter * phaser_filter_
Phaser filter submodule (phase-based filtering).
Definition filter_module.h:146
LadderFilter * ladder_filter_
Ladder filter submodule (classic analog-style filter).
Definition filter_module.h:145
DiodeFilter * diode_filter_
Diode filter submodule.
Definition filter_module.h:142
Value * on_
Optional "on" control parameter.
Definition filter_module.h:134
A classic transistor ladder-style filter for the Vital synthesizer.
Definition ladder_filter.h:19
void hardReset() override
Performs a hard reset of all filter states.
Definition ladder_filter.cpp:30
A multi-stage phaser filter for the Vital synthesizer.
Definition phaser_filter.h:19
void hardReset() override
Performs a full reset of the filter states (for all voices).
Definition phaser_filter.cpp:34
Base class for all signal-processing units in Vital.
Definition processor.h:212
void useOutput(Output *output)
Uses an existing Output object as this Processor's first output.
Definition processor.cpp:138
force_inline Input * input(unsigned int index=0) const
Retrieves the Input pointer at a given index.
Definition processor.h:587
void useInput(Input *input)
Uses an existing Input object as this Processor's first input.
Definition processor.cpp:126
force_inline poly_mask getResetMask(int input_index) const
Retrieves a mask indicating which voices triggered a note-on event. Compares the input's trigger_valu...
Definition processor.h:360
virtual void hardReset()
Called to perform a "hard" reset for all voices.
Definition processor.h:272
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 enable(bool enable)
Enables or disables this Processor.
Definition processor.h:318
virtual void init()
Called after constructor, used for any additional initialization. Subclasses can override....
Definition processor.h:258
Processor * getLocalProcessor(const Processor *global_processor)
Retrieves the local instance of a globally defined Processor.
Definition processor_router.cpp:376
virtual void addProcessor(Processor *processor)
Adds a Processor to be managed by this router.
Definition processor_router.cpp:121
A Sallen-Key style filter capable of multiple modes (12dB, 24dB, dual modes) with nonlinear drive and...
Definition sallen_key_filter.h:28
void hardReset() override
Performs a hard reset of all internal states.
Definition sallen_key_filter.cpp:29
@ kPassBlend
Blending parameter for low-pass, high-pass, band-pass.
Definition synth_filter.h:62
@ kResonance
Resonance parameter.
Definition synth_filter.h:58
@ kTranspose
MIDI transpose in semitones.
Definition synth_filter.h:65
@ kMidiCutoff
MIDI-based cutoff parameter.
Definition synth_filter.h:57
@ kReset
Reset signal.
Definition synth_filter.h:56
@ kStyle
Filter style (12 dB, 24 dB, etc.)
Definition synth_filter.h:61
@ kDriveGain
Drive amount in dB.
Definition synth_filter.h:59
@ kAudio
Audio input index.
Definition synth_filter.h:55
A ProcessorRouter that encapsulates a cohesive unit of functionality in the synthesizer.
Definition synth_module.h:129
Output * createPolyModControl(std::string name, bool audio_rate=false, bool smooth_value=false, Output *internal_modulation=nullptr, Input *reset=nullptr)
Creates a polyphonic mod control, including applying parameter scaling.
Definition synth_module.cpp:173
Value * createBaseControl(std::string name, bool audio_rate=false, bool smooth_value=false)
Creates a simple control processor for a given parameter name.
Definition synth_module.cpp:22
void addSubmodule(SynthModule *module)
Adds a submodule to this SynthModule.
Definition synth_module.h:289
virtual void enable(bool enable) override
Enables or disables this SynthModule and its owned processors.
Definition synth_module.cpp:516
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
A Processor that maintains and outputs a constant poly_float value.
Definition value.h:24
force_inline mono_float value() const
Returns the current mono_float value of the first lane.
Definition value.h:60
Control-rate multiplication of two values.
Definition operators.h:719
#define force_inline
Definition common.h:23
@ kDirty
Definition synth_constants.h:196
@ kDigital
Definition synth_constants.h:198
@ kAnalog
Definition synth_constants.h:195
@ kPhase
Definition synth_constants.h:202
@ kFormant
Definition synth_constants.h:200
@ kDiode
Definition synth_constants.h:199
@ kLadder
Definition synth_constants.h:197
@ kComb
Definition synth_constants.h:201
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 void zeroBuffer(mono_float *buffer, int size)
Zeros a mono buffer (standard array).
Definition poly_utils.h:570
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.
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
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600