68 value_ = source_->
buffer[0];
137 SynthModule(
int num_inputs,
int num_outputs,
bool control_rate =
false) :
139 data_ = std::make_shared<ModuleData>();
310 bool smooth_value =
false,
Output* internal_modulation =
nullptr);
321 bool smooth_value =
false,
Output* internal_modulation =
nullptr);
333 bool smooth_value =
false,
Output* internal_modulation =
nullptr,
Input*
reset =
nullptr);
345 const Output* beats_per_second,
bool poly,
Input* midi =
nullptr);
Base class for all signal-processing units in Vital.
Definition processor.h:212
virtual void reset(poly_mask reset_mask)
Called to reset the Processor's per-voice state (e.g., on note-on).
Definition processor.h:267
A specialized Processor that manages a directed graph of Processors and ensures correct processing or...
Definition processor_router.h:34
A helper class to track the "status" of a particular Output as a poly_float value.
Definition synth_module.h:35
force_inline void clear()
Clears the stored status value.
Definition synth_module.h:74
static constexpr float kClearValue
Special "clear" value indicating no status.
Definition synth_module.h:37
force_inline void update()
Updates the status value without masking.
Definition synth_module.h:67
force_inline bool isClearValue(float value) const
Checks if a given float is the special "clear" value.
Definition synth_module.h:88
force_inline bool isClearValue(poly_float value) const
Checks if a given poly_float is the special "clear" value.
Definition synth_module.h:81
force_inline poly_float value() const
Returns the current status value.
Definition synth_module.h:49
StatusOutput(Output *source)
Constructor.
Definition synth_module.h:43
force_inline void update(poly_mask voice_mask)
Updates the status value using the provided mask.
Definition synth_module.h:57
A ProcessorRouter that encapsulates a cohesive unit of functionality in the synthesizer.
Definition synth_module.h:129
Processor * getPolyModulationDestination(std::string name)
Retrieves a poly modulation destination by name.
Definition synth_module.cpp:394
output_map & getModulationSources()
Returns a reference to the map of modulation sources.
Definition synth_module.cpp:454
virtual Processor * clone() const override
Clones this SynthModule.
Definition synth_module.h:283
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
virtual output_map & getMonoModulations()
Returns a reference to the map of mono modulation readouts.
Definition synth_module.cpp:481
void addMonoProcessor(Processor *processor, bool own=true)
Adds a mono processor to this module.
Definition synth_module.cpp:529
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 addIdleMonoProcessor(Processor *processor)
Adds a mono processor that is considered idle (not part of main processing chain).
Definition synth_module.cpp:540
std::shared_ptr< ModuleData > data_
Shared data storage for this SynthModule.
Definition synth_module.h:354
ValueSwitch * getMonoModulationSwitch(std::string name)
Retrieves a mono modulation switch by name.
Definition synth_module.cpp:412
input_map & getPolyModulationDestinations()
Returns a reference to the map of poly modulation destinations.
Definition synth_module.cpp:472
control_map getControls()
Returns a map of all controls from this module and its submodules.
Definition synth_module.cpp:341
ValueSwitch * getPolyModulationSwitch(std::string name)
Retrieves a poly modulation switch by name.
Definition synth_module.cpp:424
Processor * getMonoModulationDestination(std::string name)
Retrieves a mono modulation destination by name.
Definition synth_module.cpp:382
virtual ~SynthModule()
Destructor.
Definition synth_module.h:145
SynthModule(int num_inputs, int num_outputs, bool control_rate=false)
Constructs a SynthModule with specified I/O and control rate.
Definition synth_module.h:137
Processor * getModulationDestination(std::string name, bool poly)
Retrieves a modulation destination Processor by name and poly mode.
Definition synth_module.cpp:374
virtual output_map & getPolyModulations()
Returns a reference to the map of poly modulation readouts.
Definition synth_module.cpp:490
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 * getModulationSource(std::string name)
Retrieves a modulation source output by name.
Definition synth_module.cpp:350
input_map & getMonoModulationDestinations()
Returns a reference to the map of mono modulation destinations.
Definition synth_module.cpp:463
ValueSwitch * getModulationSwitch(std::string name, bool poly)
Retrieves a modulation switch by name and poly mode.
Definition synth_module.cpp:406
Output * createBaseModControl(std::string name, bool audio_rate=false, bool smooth_value=false, Output *internal_modulation=nullptr)
Creates a base mod control, which is a control combined with a modulation input.
Definition synth_module.cpp:59
void updateAllModulationSwitches()
Updates all modulation switches based on whether their destinations have inputs.
Definition synth_module.cpp:436
virtual void correctToTime(double seconds)
Allows correction of module state to a given time (if needed).
Definition synth_module.h:252
void addSubmodule(SynthModule *module)
Adds a submodule to this SynthModule.
Definition synth_module.h:289
void createStatusOutput(std::string name, Output *source)
Creates a status output associated with a given Output.
Definition synth_module.cpp:337
void enableOwnedProcessors(bool enable)
Enables or disables all owned processors.
Definition synth_module.cpp:503
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
const StatusOutput * getStatusOutput(std::string name) const
Retrieves a StatusOutput by name.
Definition synth_module.cpp:362
A Processor that maintains and outputs a constant poly_float value.
Definition value.h:24
A specialized Value processor that selects one of multiple input sources to pass through,...
Definition value_switch.h:28
#define force_inline
Definition common.h:23
force_inline poly_float swapVoices(poly_float value)
Swaps the first half of the lanes with the second half.
Definition poly_utils.h:437
Contains classes and functions used within the Vital synthesizer framework.
std::map< std::string, Output * > output_map
Maps parameter names to Output pointers, representing output signals from various modules.
Definition synth_types.h:229
std::map< std::string, Value * > control_map
Maps parameter names to Value pointers representing synth control parameters.
Definition synth_types.h:214
std::map< std::string, Processor * > input_map
Maps parameter names to Processor pointers, representing input processors for signals.
Definition synth_types.h:224
Declares the ProcessorRouter class, which manages a graph of Processors and their dependencies.
Holds various data structures that define the internal state of a SynthModule.
Definition synth_module.h:104
input_map poly_mod_destinations
Map of poly modulation destinations.
Definition synth_module.h:112
std::map< std::string, std::unique_ptr< StatusOutput > > status_outputs
Map of status outputs.
Definition synth_module.h:110
output_map poly_modulation_readout
Outputs used to read poly modulation totals.
Definition synth_module.h:114
input_map mono_mod_destinations
Map of mono modulation destinations.
Definition synth_module.h:111
std::vector< Processor * > owned_mono_processors
Processors owned by this module (mono).
Definition synth_module.h:105
std::vector< SynthModule * > sub_modules
Nested submodules.
Definition synth_module.h:106
std::map< std::string, ValueSwitch * > poly_modulation_switches
Poly modulation switches.
Definition synth_module.h:116
output_map mono_modulation_readout
Outputs used to read mono modulation totals.
Definition synth_module.h:113
output_map mod_sources
Map of modulation source names to Outputs.
Definition synth_module.h:109
control_map controls
Map of control parameter names to Value Processors.
Definition synth_module.h:108
std::map< std::string, ValueSwitch * > mono_modulation_switches
Mono modulation switches.
Definition synth_module.h:115
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
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