Vital
Loading...
Searching...
No Matches
vital::SoundEngine Class Reference

Core class responsible for handling note events, oversampling, and the main effects chain. More...

#include <sound_engine.h>

Inheritance diagram for vital::SoundEngine:
vital::SynthModule vital::NoteHandler vital::SynthModule vital::NoteHandler vital::ProcessorRouter vital::ProcessorRouter vital::Processor vital::Processor

Public Member Functions

 SoundEngine ()
 Constructs a SoundEngine and initializes internal state and controls.
 
virtual ~SoundEngine ()
 Destroys the SoundEngine, cleaning up submodules and modulation resources.
 
void init () override
 Initializes the engine by creating base controls and submodules (effects chain, etc.).
 
void processWithInput (const poly_float *audio_in, int num_samples) override
 Processes a block of samples using the current state of the SoundEngine.
 
void correctToTime (double seconds) override
 Synchronizes all time-based modules to a given time, e.g. for timeline-based automation.
 
int getNumPressedNotes ()
 Returns the number of currently pressed notes across all channels.
 
void connectModulation (const modulation_change &change)
 Connects a modulation source to a destination via the given modulation_change structure.
 
void disconnectModulation (const modulation_change &change)
 Disconnects a previously established modulation route.
 
int getNumActiveVoices ()
 Returns the number of active voices in the engine.
 
ModulationConnectionBankgetModulationBank ()
 Provides access to the internal ModulationConnectionBank for managing mod routes.
 
mono_float getLastActiveNote () const
 Retrieves the most recently active note number.
 
void setTuning (const Tuning *tuning)
 Sets a custom Tuning object for note-to-frequency mapping.
 
void setOversamplingAmount (int oversampling_amount, int sample_rate)
 Configures the engine’s oversampling factor and sample rate.
 
void allSoundsOff () override
 Stops and resets all currently playing notes and any lingering states in the effect chain.
 
void allNotesOff (int sample) override
 Turns off all notes on all channels at the specified sample index.
 
void allNotesOff (int sample, int channel) override
 Turns off all notes on a specific channel at a given sample.
 
void allNotesOffRange (int sample, int from_channel, int to_channel)
 Turns off all notes within a range of channels.
 
void noteOn (int note, mono_float velocity, int sample, int channel) override
 Handles a note-on event, triggering the engine’s voice handling.
 
void noteOff (int note, mono_float lift, int sample, int channel) override
 Handles a note-off event, releasing the voice allocated to the note.
 
void setModWheel (mono_float value, int channel)
 Sets the mod wheel value for a given MIDI channel.
 
void setModWheelAllChannels (mono_float value)
 Sets the mod wheel value for all MIDI channels.
 
void setPitchWheel (mono_float value, int channel)
 Sets the pitch wheel value for a specified MIDI channel.
 
void setZonedPitchWheel (mono_float value, int from_channel, int to_channel)
 Applies a pitch wheel value to a range of MIDI channels.
 
void disableUnnecessaryModSources ()
 Disables unnecessary modulation sources in the engine to save CPU.
 
void enableModSource (const std::string &source)
 Enables a specific named modulation source by making its owner active.
 
void disableModSource (const std::string &source)
 Disables a specific named modulation source.
 
bool isModSourceEnabled (const std::string &source)
 Checks if a given named modulation source is currently enabled.
 
const StereoMemorygetEqualizerMemory ()
 Retrieves the internal equalizer memory (used for certain effect processing).
 
void setBpm (mono_float bpm)
 Updates the engine’s tempo in BPM, converting to beats per second for internal usage.
 
void setAftertouch (mono_float note, mono_float value, int sample, int channel)
 Sets polyphonic aftertouch for a specific note on a given channel.
 
void setChannelAftertouch (int channel, mono_float value, int sample)
 Sets channel-wide aftertouch on a given channel.
 
void setChannelRangeAftertouch (int from_channel, int to_channel, mono_float value, int sample)
 Applies aftertouch to all channels in a specified range.
 
void setChannelSlide (int channel, mono_float value, int sample)
 Sets channel slide (e.g., an expression or glide parameter) on a specific channel.
 
void setChannelRangeSlide (int from_channel, int to_channel, mono_float value, int sample)
 Applies channel slide to all channels in a specified range.
 
WavetablegetWavetable (int index)
 Retrieves a pointer to a Wavetable by index (not implemented here).
 
SamplegetSample ()
 Retrieves a pointer to a Sample object (not implemented here).
 
LineGeneratorgetLfoSource (int index)
 Retrieves a pointer to the LFO source line generator for the given index.
 
void sustainOn (int channel)
 Engages sustain on a single MIDI channel (holding all pressed notes).
 
void sustainOff (int sample, int channel)
 Disengages sustain on a single MIDI channel, releasing notes if their keys are up.
 
void sostenutoOn (int channel)
 Engages sostenuto on a single MIDI channel (holding only currently pressed notes).
 
void sostenutoOff (int sample, int channel)
 Disengages sostenuto on a single MIDI channel.
 
void sustainOnRange (int from_channel, int to_channel)
 Engages sustain on a range of MIDI channels.
 
void sustainOffRange (int sample, int from_channel, int to_channel)
 Disengages sustain on a range of MIDI channels.
 
void sostenutoOnRange (int from_channel, int to_channel)
 Engages sostenuto on a range of MIDI channels.
 
void sostenutoOffRange (int sample, int from_channel, int to_channel)
 Disengages sostenuto on a range of MIDI channels.
 
force_inline int getOversamplingAmount () const
 Retrieves the current oversampling factor (e.g., 1, 2, 4).
 
void checkOversampling ()
 Checks if the oversampling setting or sample rate has changed, and reconfigures if needed.
 
 SoundEngine ()
 Constructs a new SoundEngine instance.
 
virtual ~SoundEngine ()
 Destroys the SoundEngine instance.
 
void init () override
 Initializes the SoundEngine, setting up controls, voices, and effects.
 
void process (int num_samples) override
 Processes a block of samples through the voice handler and effects chain.
 
void correctToTime (double seconds) override
 Corrects internal timing to a given absolute time in seconds.
 
int getNumPressedNotes ()
 Gets the number of currently pressed notes.
 
void connectModulation (const modulation_change &change)
 Connects a modulation source to its destination.
 
void disconnectModulation (const modulation_change &change)
 Disconnects a previously connected modulation source from its destination.
 
int getNumActiveVoices ()
 Gets the number of currently active voices.
 
ModulationConnectionBankgetModulationBank ()
 Gets the modulation connection bank for this engine.
 
mono_float getLastActiveNote () const
 Gets the last active note played.
 
void setTuning (const Tuning *tuning)
 Sets the tuning to use for pitch calculations.
 
void allSoundsOff () override
 Turns off all sounds immediately.
 
void allNotesOff (int sample) override
 Sends all voices a note-off command at a given sample.
 
void allNotesOff (int sample, int channel) override
 Sends all voices on a given channel a note-off command.
 
void allNotesOffRange (int sample, int from_channel, int to_channel)
 Sends all voices in a range of channels a note-off command.
 
void noteOn (int note, mono_float velocity, int sample, int channel) override
 Triggers a note-on event.
 
void noteOff (int note, mono_float lift, int sample, int channel) override
 Triggers a note-off event.
 
void setModWheel (mono_float value, int channel)
 Sets the modulation wheel value for a given channel.
 
void setModWheelAllChannels (mono_float value)
 Sets the modulation wheel value for all channels.
 
void setPitchWheel (mono_float value, int channel)
 Sets the pitch wheel value for a given channel.
 
void setZonedPitchWheel (mono_float value, int from_channel, int to_channel)
 Sets the pitch wheel value for a range of channels.
 
void disableUnnecessaryModSources ()
 Disables any modulation sources that are not required.
 
void enableModSource (const std::string &source)
 Enables a modulation source by name.
 
void disableModSource (const std::string &source)
 Disables a modulation source by name.
 
bool isModSourceEnabled (const std::string &source)
 Checks if a modulation source is enabled.
 
const StereoMemorygetEqualizerMemory ()
 Gets a pointer to the stereo memory used by the equalizer.
 
void setBpm (mono_float bpm)
 Sets the BPM (beats per minute) value for the engine.
 
void setAftertouch (mono_float note, mono_float value, int sample, int channel)
 Sets note-based aftertouch values.
 
void setChannelAftertouch (int channel, mono_float value, int sample)
 Sets aftertouch values for an entire channel.
 
void setChannelRangeAftertouch (int from_channel, int to_channel, mono_float value, int sample)
 Sets aftertouch values for a range of channels.
 
void setChannelSlide (int channel, mono_float value, int sample)
 Sets channel-based slide (MPE/MIDI CC glides).
 
void setChannelRangeSlide (int from_channel, int to_channel, mono_float value, int sample)
 Sets slide values for a range of channels.
 
WavetablegetWavetable (int index)
 Gets a pointer to a wavetable by index.
 
SamplegetSample ()
 Gets a pointer to the Sample object.
 
LineGeneratorgetLfoSource (int index)
 Gets a pointer to an LFO source by index.
 
void sustainOn (int channel)
 Turns sustain on for a given channel.
 
void sustainOff (int sample, int channel)
 Turns sustain off for a given channel at a specific sample.
 
void sostenutoOn (int channel)
 Turns sostenuto on for a given channel.
 
void sostenutoOff (int sample, int channel)
 Turns sostenuto off for a given channel at a specific sample.
 
void sustainOnRange (int from_channel, int to_channel)
 Turns sustain on for a range of channels.
 
void sustainOffRange (int sample, int from_channel, int to_channel)
 Turns sustain off for a range of channels at a given sample.
 
void sostenutoOnRange (int from_channel, int to_channel)
 Turns sostenuto on for a range of channels.
 
void sostenutoOffRange (int sample, int from_channel, int to_channel)
 Turns sostenuto off for a range of channels at a given sample.
 
force_inline int getOversamplingAmount () const
 Gets the current oversampling amount.
 
void checkOversampling ()
 Checks if the oversampling settings have changed and updates accordingly.
 
- Public Member Functions inherited from vital::SynthModule
 SynthModule (int num_inputs, int num_outputs, bool control_rate=false)
 Constructs a SynthModule with specified I/O and control rate.
 
virtual ~SynthModule ()
 Destructor.
 
control_map getControls ()
 Returns a map of all controls from this module and its submodules.
 
OutputgetModulationSource (std::string name)
 Retrieves a modulation source output by name.
 
const StatusOutputgetStatusOutput (std::string name) const
 Retrieves a StatusOutput by name.
 
ProcessorgetModulationDestination (std::string name, bool poly)
 Retrieves a modulation destination Processor by name and poly mode.
 
ProcessorgetMonoModulationDestination (std::string name)
 Retrieves a mono modulation destination by name.
 
ProcessorgetPolyModulationDestination (std::string name)
 Retrieves a poly modulation destination by name.
 
ValueSwitchgetModulationSwitch (std::string name, bool poly)
 Retrieves a modulation switch by name and poly mode.
 
ValueSwitchgetMonoModulationSwitch (std::string name)
 Retrieves a mono modulation switch by name.
 
ValueSwitchgetPolyModulationSwitch (std::string name)
 Retrieves a poly modulation switch by name.
 
void updateAllModulationSwitches ()
 Updates all modulation switches based on whether their destinations have inputs.
 
output_mapgetModulationSources ()
 Returns a reference to the map of modulation sources.
 
input_mapgetMonoModulationDestinations ()
 Returns a reference to the map of mono modulation destinations.
 
input_mapgetPolyModulationDestinations ()
 Returns a reference to the map of poly modulation destinations.
 
virtual output_mapgetMonoModulations ()
 Returns a reference to the map of mono modulation readouts.
 
virtual output_mapgetPolyModulations ()
 Returns a reference to the map of poly modulation readouts.
 
void enableOwnedProcessors (bool enable)
 Enables or disables all owned processors.
 
virtual void enable (bool enable) override
 Enables or disables this SynthModule and its owned processors.
 
void addMonoProcessor (Processor *processor, bool own=true)
 Adds a mono processor to this module.
 
void addIdleMonoProcessor (Processor *processor)
 Adds a mono processor that is considered idle (not part of main processing chain).
 
virtual Processorclone () const override
 Clones this SynthModule.
 
void addSubmodule (SynthModule *module)
 Adds a submodule to this SynthModule.
 
- Public Member Functions inherited from vital::ProcessorRouter
 ProcessorRouter (int num_inputs=0, int num_outputs=0, bool control_rate=false)
 Constructs a ProcessorRouter with a specified number of inputs and outputs.
 
 ProcessorRouter (const ProcessorRouter &original)
 Copy constructor. Creates a new ProcessorRouter from an existing one.
 
virtual ~ProcessorRouter ()
 Destructor.
 
virtual void setSampleRate (int sample_rate) override
 Sets the sample rate for all Processors in this router.
 
virtual void setOversampleAmount (int oversample) override
 Sets the oversampling amount for all Processors in this router.
 
virtual void addProcessor (Processor *processor)
 Adds a Processor to be managed by this router.
 
virtual void addProcessorRealTime (Processor *processor)
 Adds a Processor to the router in real-time (no memory allocations).
 
virtual void addIdleProcessor (Processor *processor)
 Adds a Processor that should remain idle (not processed) in the router.
 
virtual void removeProcessor (Processor *processor)
 Removes a Processor from this router.
 
void connect (Processor *destination, const Output *source, int index)
 Connects a source Output to a destination Processor input by index.
 
void disconnect (const Processor *destination, const Output *source)
 Disconnects a source Output from a destination Processor.
 
bool isDownstream (const Processor *first, const Processor *second) const
 Checks if one Processor is downstream from another, i.e., if there's a path from the second to the first.
 
bool areOrdered (const Processor *first, const Processor *second) const
 Checks if the order of two Processors is fixed in the router's processing sequence.
 
virtual bool isPolyphonic (const Processor *processor) const
 Determines if a given Processor is polyphonic within this router.
 
virtual ProcessorRoutergetMonoRouter ()
 Gets the mono router that corresponds to this ProcessorRouter.
 
virtual ProcessorRoutergetPolyRouter ()
 Gets the polyphonic router that corresponds to this ProcessorRouter.
 
virtual void resetFeedbacks (poly_mask reset_mask)
 Resets all Feedback nodes within this router using a reset mask.
 
- Public Member Functions inherited from vital::Processor
 Processor (int num_inputs, int num_outputs, bool control_rate=false, int max_oversample=1)
 Constructs a Processor with a given number of inputs/outputs and oversampling.
 
virtual ~Processor ()
 Virtual destructor.
 
virtual bool hasState () const
 Indicates whether this Processor requires per-voice state.
 
virtual void reset (poly_mask reset_mask)
 Called to reset the Processor's per-voice state (e.g., on note-on).
 
virtual void hardReset ()
 Called to perform a "hard" reset for all voices.
 
bool initialized ()
 Returns whether this Processor has been initialized.
 
force_inline bool enabled () const
 Checks if this Processor is enabled.
 
force_inline int getSampleRate () const
 Retrieves the current (effective) sample rate.
 
force_inline int getOversampleAmount () const
 Retrieves the current oversampling factor.
 
force_inline bool isControlRate () const
 Checks if this Processor is running at control rate (buffer_size == 1).
 
virtual void setControlRate (bool control_rate)
 Sets whether this Processor runs at control rate.
 
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_value to kVoiceOn.
 
force_inline void clearOutputBufferForReset (poly_mask reset_mask, int input_index, int output_index) const
 Clears output samples for voices that are about to be reset, based on the trigger offset.
 
bool inputMatchesBufferSize (int input=0)
 Checks whether the buffer size of a particular input matches the size needed by this Processor.
 
bool checkInputAndOutputSize (int num_samples)
 Checks if all inputs and outputs have buffers big enough for num_samples.
 
virtual bool isPolyphonic () const
 Checks if this Processor is polyphonic by querying its ProcessorRouter.
 
void plug (const Output *source)
 Connects an external Output to this Processor's first input.
 
void plug (const Output *source, unsigned int input_index)
 Connects an external Output to a specified input index.
 
void plug (const Processor *source)
 Connects the first output of a Processor to this Processor's first input.
 
void plug (const Processor *source, unsigned int input_index)
 Connects the first output of a Processor to a specified input index.
 
void plugNext (const Output *source)
 Connects an external Output to the first available (unplugged) input.
 
void plugNext (const Processor *source)
 Connects the first output of a Processor to the first available (unplugged) input.
 
void useInput (Input *input)
 Uses an existing Input object as this Processor's first input.
 
void useInput (Input *input, int index)
 Uses an existing Input object at a specified input index.
 
void useOutput (Output *output)
 Uses an existing Output object as this Processor's first output.
 
void useOutput (Output *output, int index)
 Uses an existing Output object at a specified output index.
 
int connectedInputs ()
 Counts how many inputs are connected to a real source (not null_source_).
 
virtual void unplugIndex (unsigned int input_index)
 Removes the connection at a specified input index, if any.
 
virtual void unplug (const Output *source)
 Removes a connection to a given Output from all inputs.
 
virtual void unplug (const Processor *source)
 Removes connections to all outputs from a given Processor.
 
virtual void numInputsChanged ()
 Called when the number of inputs changes (e.g., new connections). Subclasses may override for dynamic behavior.
 
force_inline void router (ProcessorRouter *router)
 Sets the ProcessorRouter that owns or manages this Processor.
 
force_inline ProcessorRouterrouter () const
 Returns the ProcessorRouter that currently owns this Processor.
 
ProcessorRoutergetTopLevelRouter () const
 Gets the topmost (root) ProcessorRouter by traversing parent routers.
 
virtual void registerInput (Input *input, int index)
 Registers a new input, appending it to the input list.
 
virtual OutputregisterOutput (Output *output, int index)
 Registers a new Output in the output list at a specified index.
 
virtual void registerInput (Input *input)
 Registers a new Input by appending it to the end of the input list.
 
virtual OutputregisterOutput (Output *output)
 Registers a new Output by appending it to the end of the output list.
 
force_inline int numInputs () const
 Returns the total number of Input pointers (owned or otherwise).
 
force_inline int numOutputs () const
 Returns the total number of Output pointers (owned or otherwise).
 
force_inline int numOwnedInputs () const
 Returns how many Input objects this Processor owns.
 
force_inline int numOwnedOutputs () const
 Returns how many Output objects this Processor owns.
 
force_inline Inputinput (unsigned int index=0) const
 Retrieves the Input pointer at a given index.
 
force_inline bool isInputSourcePolyphonic (int index=0)
 Checks if the input source at a given index is polyphonic.
 
force_inline InputownedInput (unsigned int index=0) const
 Retrieves an owned Input pointer at a given index.
 
force_inline Outputoutput (unsigned int index=0) const
 Retrieves the Output pointer at a given index.
 
force_inline OutputownedOutput (unsigned int index=0) const
 Retrieves an owned Output pointer at a given index.
 
void setPluggingStart (int start)
 Sets the position at which plugNext starts searching for an open input.
 
- Public Member Functions inherited from vital::NoteHandler
virtual ~NoteHandler ()
 Virtual destructor.
 

Static Public Attributes

static constexpr int kDefaultOversamplingAmount = 2
 Default oversampling factor.
 
static constexpr int kDefaultSampleRate = 44100
 Default sample rate used before explicit configuration.
 

Additional Inherited Members

- Protected Member Functions inherited from vital::SynthModule
ValuecreateBaseControl (std::string name, bool audio_rate=false, bool smooth_value=false)
 Creates a simple control processor for a given parameter name.
 
OutputcreateBaseModControl (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.
 
OutputcreateMonoModControl (std::string name, bool audio_rate=false, bool smooth_value=false, Output *internal_modulation=nullptr)
 Creates a monophonic mod control, including applying parameter scaling.
 
OutputcreatePolyModControl (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.
 
OutputcreateTempoSyncSwitch (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.
 
void createStatusOutput (std::string name, Output *source)
 Creates a status output associated with a given Output.
 
- Protected Member Functions inherited from vital::ProcessorRouter
virtual void addFeedback (Feedback *feedback)
 Adds a Feedback node to handle a feedback loop introduced by a connection.
 
virtual void removeFeedback (Feedback *feedback)
 Removes a previously added Feedback node.
 
void reorder (Processor *processor)
 Reorders the internal processing sequence to account for a Processor's dependencies.
 
virtual void updateAllProcessors ()
 Updates all processors to match the global order. Called when changes occur.
 
force_inline bool shouldUpdate ()
 Checks if local changes need to be synchronized with global changes.
 
virtual void createAddedProcessors ()
 Creates any processors that were added at the global level but not yet replicated locally.
 
virtual void deleteRemovedProcessors ()
 Deletes any processors that were removed at the global level but not yet removed locally.
 
const ProcessorgetContext (const Processor *processor) const
 Gets the processor context within this router for a global Processor reference.
 
void getDependencies (const Processor *processor) const
 Populates the internal dependencies structure for a given Processor.
 
ProcessorgetLocalProcessor (const Processor *global_processor)
 Retrieves the local instance of a globally defined Processor.
 
- Protected Member Functions inherited from vital::Processor
OutputaddOutput (int oversample=1)
 Creates and registers a new Output. Handles control rate vs. audio rate.
 
InputaddInput ()
 Creates and registers a new Input, initially connected to null_source_.
 
- Protected Attributes inherited from vital::SynthModule
std::shared_ptr< ModuleDatadata_
 Shared data storage for this SynthModule.
 
- Protected Attributes inherited from vital::ProcessorRouter
std::shared_ptr< CircularQueue< Processor * > > global_order_
 Global processing order reference.
 
std::shared_ptr< CircularQueue< Processor * > > global_reorder_
 Temporary storage for reorder operations.
 
CircularQueue< Processor * > local_order_
 Local ordering of Processors.
 
std::map< const Processor *, std::pair< int, std::unique_ptr< Processor > > > processors_
 Map of global to local Processors.
 
std::map< const Processor *, std::unique_ptr< Processor > > idle_processors_
 Idle Processors that are not active in the graph.
 
std::shared_ptr< std::vector< const Feedback * > > global_feedback_order_
 Global order of Feedback nodes.
 
std::vector< Feedback * > local_feedback_order_
 Local copies of Feedback nodes.
 
std::map< const Processor *, std::pair< int, std::unique_ptr< Feedback > > > feedback_processors_
 Map of global to local Feedback processors.
 
std::shared_ptr< int > global_changes_
 Global change counter.
 
int local_changes_
 Local change counter to track synchronization with global changes.
 
std::shared_ptr< CircularQueue< const Processor * > > dependencies_
 Queue for dependencies calculations.
 
std::shared_ptr< CircularQueue< const Processor * > > dependencies_visited_
 Queue of visited processors for dependencies calc.
 
std::shared_ptr< CircularQueue< const Processor * > > dependency_inputs_
 Queue of processors to check inputs for dependencies.
 
- Protected Attributes inherited from vital::Processor
std::shared_ptr< ProcessorStatestate_
 Shared state (sample rate, oversample, etc.)
 
int plugging_start_
 The index at which plugNext starts searching for an unplugged input.
 
std::vector< std::shared_ptr< Input > > owned_inputs_
 Inputs owned by this Processor.
 
std::vector< std::shared_ptr< Output > > owned_outputs_
 Outputs owned by this Processor.
 
std::shared_ptr< std::vector< Input * > > inputs_
 All inputs, owned or external.
 
std::shared_ptr< std::vector< Output * > > outputs_
 All outputs, owned or external.
 
ProcessorRouterrouter_
 The ProcessorRouter that manages this Processor.
 
- Static Protected Attributes inherited from vital::Processor
static const Output null_source_
 A null (dummy) source used for unconnected inputs.
 

Detailed Description

Core class responsible for handling note events, oversampling, and the main effects chain.

The main synthesis engine that handles voices, modulation, effects, and other top-level audio processing components for the Vital synthesizer.

The SoundEngine manages the top-level module architecture for Vital's effect and modulation engines, connecting note handling, oversampling, effect chaining, and modulation routing. It derives from SynthModule for the base module framework and NoteHandler for note-level logic.

The SoundEngine is responsible for managing voices, applying modulation, handling note on/off events, applying oversampling, and routing audio through the effects chain. It integrates with a SynthVoiceHandler to manage polyphony, and it uses a ReorderableEffectChain to process the final audio output.

Constructor & Destructor Documentation

◆ SoundEngine() [1/2]

vital::SoundEngine::SoundEngine ( )

Constructs a SoundEngine and initializes internal state and controls.

Default constructor for SoundEngine, initializes vital controls and reserves space for mod processors.

◆ ~SoundEngine() [1/2]

vital::SoundEngine::~SoundEngine ( )
virtual

Destroys the SoundEngine, cleaning up submodules and modulation resources.

Destructor. Prepares the modulation handler for deletion by removing processors.

◆ SoundEngine() [2/2]

vital::SoundEngine::SoundEngine ( )

Constructs a new SoundEngine instance.

◆ ~SoundEngine() [2/2]

virtual vital::SoundEngine::~SoundEngine ( )
virtual

Destroys the SoundEngine instance.

Member Function Documentation

◆ allNotesOff() [1/4]

void vital::SoundEngine::allNotesOff ( int sample)
overridevirtual

Turns off all notes on all channels at the specified sample index.

Disables all notes across all channels at a given sample index.

Parameters
sampleThe sample index at which to stop notes.
sampleThe sample index to stop.

Implements vital::NoteHandler.

◆ allNotesOff() [2/4]

void vital::SoundEngine::allNotesOff ( int sample)
overridevirtual

Sends all voices a note-off command at a given sample.

Parameters
sampleThe sample index to apply the note-off command.

Implements vital::NoteHandler.

◆ allNotesOff() [3/4]

void vital::SoundEngine::allNotesOff ( int sample,
int channel )
overridevirtual

Turns off all notes on a specific channel at a given sample.

Disables all notes on a specific channel at a given sample.

Parameters
sampleThe sample index to stop notes.
channelThe MIDI channel.
sampleThe sample index.
channelThe MIDI channel.

Implements vital::NoteHandler.

◆ allNotesOff() [4/4]

void vital::SoundEngine::allNotesOff ( int sample,
int channel )
overridevirtual

Sends all voices on a given channel a note-off command.

Parameters
sampleThe sample index at which to apply the note-off command.
channelThe channel from which to remove active notes.

Implements vital::NoteHandler.

◆ allNotesOffRange() [1/2]

void vital::SoundEngine::allNotesOffRange ( int sample,
int from_channel,
int to_channel )

Turns off all notes within a range of channels.

Disables all notes across a range of channels.

Parameters
sampleThe sample index at which to stop notes.
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).
sampleThe sample index.
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).

◆ allNotesOffRange() [2/2]

void vital::SoundEngine::allNotesOffRange ( int sample,
int from_channel,
int to_channel )

Sends all voices in a range of channels a note-off command.

Parameters
sampleThe sample index at which to apply the note-offs.
from_channelThe first channel in the range.
to_channelThe last channel in the range.

◆ allSoundsOff() [1/2]

void vital::SoundEngine::allSoundsOff ( )
overridevirtual

Stops and resets all currently playing notes and any lingering states in the effect chain.

Clears the effect chain states, stopping sound or lingering effects.

Implements vital::NoteHandler.

◆ allSoundsOff() [2/2]

void vital::SoundEngine::allSoundsOff ( )
overridevirtual

Turns off all sounds immediately.

Implements vital::NoteHandler.

◆ checkOversampling() [1/2]

void vital::SoundEngine::checkOversampling ( )

Checks if the oversampling setting or sample rate has changed, and reconfigures if needed.

Checks if the oversampling setting or sample rate has changed and re-applies if needed.

◆ checkOversampling() [2/2]

void vital::SoundEngine::checkOversampling ( )

Checks if the oversampling settings have changed and updates accordingly.

◆ connectModulation() [1/2]

void vital::SoundEngine::connectModulation ( const modulation_change & change)

Connects a modulation source to a destination via the given modulation_change structure.

Connects a modulation source to a destination using the provided modulation_change details.

Parameters
changeA struct describing the source, destination, and scaling parameters.

Sets control rate based on whether either the source or destination is audio-rate.

◆ connectModulation() [2/2]

void vital::SoundEngine::connectModulation ( const modulation_change & change)

Connects a modulation source to its destination.

Parameters
changeThe modulation change descriptor.

◆ correctToTime() [1/2]

void vital::SoundEngine::correctToTime ( double seconds)
overridevirtual

Synchronizes all time-based modules to a given time, e.g. for timeline-based automation.

Synchronizes time-based modules (effects chain, mod handler) to an absolute time.

Parameters
secondsThe absolute time in seconds.
secondsAbsolute time in seconds.

Reimplemented from vital::SynthModule.

◆ correctToTime() [2/2]

void vital::SoundEngine::correctToTime ( double seconds)
overridevirtual

Corrects internal timing to a given absolute time in seconds.

Parameters
secondsThe time in seconds to correct to.

Reimplemented from vital::SynthModule.

◆ disableModSource() [1/2]

void vital::SoundEngine::disableModSource ( const std::string & source)

Disables a specific named modulation source.

Disables a named modulation source, e.g. "env_2".

Parameters
sourceThe name of the modulation source to disable.
sourceThe name of the source.

◆ disableModSource() [2/2]

void vital::SoundEngine::disableModSource ( const std::string & source)

Disables a modulation source by name.

Parameters
sourceThe name of the modulation source to disable.

◆ disableUnnecessaryModSources() [1/2]

void vital::SoundEngine::disableUnnecessaryModSources ( )

Disables unnecessary modulation sources in the engine to save CPU.

Disables any unnecessary mod sources in the modulation handler for CPU efficiency.

◆ disableUnnecessaryModSources() [2/2]

void vital::SoundEngine::disableUnnecessaryModSources ( )

Disables any modulation sources that are not required.

◆ disconnectModulation() [1/2]

void vital::SoundEngine::disconnectModulation ( const modulation_change & change)

Disconnects a previously established modulation route.

Removes a previously connected modulation, disabling the processor and resetting rate modes.

Parameters
changeA struct describing the source, destination, and parameters for removal.

◆ disconnectModulation() [2/2]

void vital::SoundEngine::disconnectModulation ( const modulation_change & change)

Disconnects a previously connected modulation source from its destination.

Parameters
changeThe modulation change descriptor.

◆ enableModSource() [1/2]

void vital::SoundEngine::enableModSource ( const std::string & source)

Enables a specific named modulation source by making its owner active.

Enables a named modulation source by enabling its owner module.

Parameters
sourceThe name of the modulation source.
sourceThe name of the modulation source, e.g. "lfo_1".

◆ enableModSource() [2/2]

void vital::SoundEngine::enableModSource ( const std::string & source)

Enables a modulation source by name.

Parameters
sourceThe name of the modulation source to enable.

◆ getEqualizerMemory() [1/2]

const StereoMemory * vital::SoundEngine::getEqualizerMemory ( )

Retrieves the internal equalizer memory (used for certain effect processing).

Retrieves the stereo memory used by an equalizer effect in the chain (if any).

Returns
Pointer to a StereoMemory buffer for the equalizer effect.
A pointer to the StereoMemory or nullptr if not present.

◆ getEqualizerMemory() [2/2]

const StereoMemory * vital::SoundEngine::getEqualizerMemory ( )

Gets a pointer to the stereo memory used by the equalizer.

Returns
A pointer to the StereoMemory object.

◆ getLastActiveNote() [1/2]

mono_float vital::SoundEngine::getLastActiveNote ( ) const

Retrieves the most recently active note number.

Retrieves the last note that was active in the engine.

Returns
The last note number played (as a float).
The most recently pressed note value.

◆ getLastActiveNote() [2/2]

mono_float vital::SoundEngine::getLastActiveNote ( ) const

Gets the last active note played.

Returns
The last active note as a floating-point value.

◆ getLfoSource() [1/2]

LineGenerator * vital::SoundEngine::getLfoSource ( int index)

Retrieves a pointer to the LFO source line generator for the given index.

Retrieves the LFO source line generator by index from the modulation handler.

Parameters
indexThe LFO source index.
Returns
Pointer to the corresponding LineGenerator.
Parameters
indexLFO index.
Returns
Pointer to the corresponding LineGenerator.

◆ getLfoSource() [2/2]

LineGenerator * vital::SoundEngine::getLfoSource ( int index)

Gets a pointer to an LFO source by index.

Parameters
indexThe index of the LFO source.
Returns
A pointer to the LineGenerator (LFO source).

◆ getModulationBank() [1/2]

ModulationConnectionBank & vital::SoundEngine::getModulationBank ( )

Provides access to the internal ModulationConnectionBank for managing mod routes.

Provides access to the internal modulation bank for connecting sources and destinations.

Returns
A reference to the ModulationConnectionBank.
A reference to the ModulationConnectionBank from the modulation handler.

◆ getModulationBank() [2/2]

ModulationConnectionBank & vital::SoundEngine::getModulationBank ( )

Gets the modulation connection bank for this engine.

Returns
A reference to the ModulationConnectionBank.

◆ getNumActiveVoices() [1/2]

int vital::SoundEngine::getNumActiveVoices ( )

Returns the number of active voices in the engine.

Retrieves the number of active voices managed by the modulation handler.

Returns
The count of active voices.
Active voice count.

◆ getNumActiveVoices() [2/2]

int vital::SoundEngine::getNumActiveVoices ( )

Gets the number of currently active voices.

Returns
The number of active voices.

◆ getNumPressedNotes() [1/2]

int vital::SoundEngine::getNumPressedNotes ( )

Returns the number of currently pressed notes across all channels.

Returns the number of pressed notes from the modulation handler.

Returns
The count of pressed notes.

◆ getNumPressedNotes() [2/2]

int vital::SoundEngine::getNumPressedNotes ( )

Gets the number of currently pressed notes.

Returns
The number of pressed notes.

◆ getOversamplingAmount() [1/2]

force_inline int vital::SoundEngine::getOversamplingAmount ( ) const
inline

Retrieves the current oversampling factor (e.g., 1, 2, 4).

Returns
The current oversampling amount.

◆ getOversamplingAmount() [2/2]

force_inline int vital::SoundEngine::getOversamplingAmount ( ) const
inline

Gets the current oversampling amount.

Returns
The current oversampling amount.

◆ getSample() [1/2]

Sample * vital::SoundEngine::getSample ( )

Retrieves a pointer to a Sample object (not implemented here).

Returns nullptr since sample retrieval is unimplemented here.

Returns
Pointer to the Sample or nullptr if not implemented.

◆ getSample() [2/2]

Sample * vital::SoundEngine::getSample ( )

Gets a pointer to the Sample object.

Returns
A pointer to the Sample object used by the voice handler.

◆ getWavetable() [1/2]

Wavetable * vital::SoundEngine::getWavetable ( int index)

Retrieves a pointer to a Wavetable by index (not implemented here).

Returns nullptr since wavetable retrieval is unimplemented here.

Parameters
indexThe wavetable index.
Returns
Pointer to the Wavetable or nullptr if not implemented.

◆ getWavetable() [2/2]

Wavetable * vital::SoundEngine::getWavetable ( int index)

Gets a pointer to a wavetable by index.

Parameters
indexThe index of the wavetable.
Returns
A pointer to the Wavetable object.

◆ init() [1/2]

void vital::SoundEngine::init ( )
overridevirtual

Initializes the engine by creating base controls and submodules (effects chain, etc.).

Initializes base controls, sets up the EffectsModulationHandler, effect chain, decimator, stereo handling, etc.

Reimplemented from vital::ProcessorRouter.

◆ init() [2/2]

void vital::SoundEngine::init ( )
overridevirtual

Initializes the SoundEngine, setting up controls, voices, and effects.

Called internally upon construction to set up default parameters and processing modules.

Reimplemented from vital::ProcessorRouter.

◆ isModSourceEnabled() [1/2]

bool vital::SoundEngine::isModSourceEnabled ( const std::string & source)

Checks if a given named modulation source is currently enabled.

Checks if a named modulation source is currently enabled.

Parameters
sourceThe name of the source to check.
Returns
True if enabled; otherwise false.
Parameters
sourceThe name of the source to check.
Returns
True if enabled, false otherwise.

◆ isModSourceEnabled() [2/2]

bool vital::SoundEngine::isModSourceEnabled ( const std::string & source)

Checks if a modulation source is enabled.

Parameters
sourceThe name of the modulation source.
Returns
True if the source is enabled, false otherwise.

◆ noteOff() [1/2]

void vital::SoundEngine::noteOff ( int note,
mono_float lift,
int sample,
int channel )
overridevirtual

Handles a note-off event, releasing the voice allocated to the note.

Handles note-off events, releasing the voice in the modulation handler.

Parameters
noteMIDI note number.
liftNote-off velocity or lift value.
sampleThe sample index where this note-off occurs.
channelThe MIDI channel.
noteMIDI note number.
liftNote-off velocity.
sampleSample index for the event.
channelMIDI channel.

Implements vital::NoteHandler.

◆ noteOff() [2/2]

void vital::SoundEngine::noteOff ( int note,
mono_float lift,
int sample,
int channel )
overridevirtual

Triggers a note-off event.

Parameters
noteThe MIDI note number.
liftThe note release velocity or lift value.
sampleThe sample index at which the note-off occurs.
channelThe channel on which the note is being released.

Implements vital::NoteHandler.

◆ noteOn() [1/2]

void vital::SoundEngine::noteOn ( int note,
mono_float velocity,
int sample,
int channel )
overridevirtual

Handles a note-on event, triggering the engine’s voice handling.

Handles note-on events, triggering voices in the modulation handler.

Parameters
noteMIDI note number.
velocityNote-on velocity.
sampleThe sample index where this note-on occurs.
channelThe MIDI channel.
noteMIDI note number.
velocityNote-on velocity.
sampleSample index for the event.
channelMIDI channel.

Implements vital::NoteHandler.

◆ noteOn() [2/2]

void vital::SoundEngine::noteOn ( int note,
mono_float velocity,
int sample,
int channel )
overridevirtual

Triggers a note-on event.

Parameters
noteThe MIDI note number.
velocityThe note velocity.
sampleThe sample index at which the note-on occurs.
channelThe channel on which the note is triggered.

Implements vital::NoteHandler.

◆ process()

void vital::SoundEngine::process ( int num_samples)
overridevirtual

Processes a block of samples through the voice handler and effects chain.

Parameters
num_samplesThe number of samples to process.

Reimplemented from vital::ProcessorRouter.

◆ processWithInput()

void vital::SoundEngine::processWithInput ( const poly_float * audio_in,
int num_samples )
overridevirtual

Processes a block of samples using the current state of the SoundEngine.

Processes audio through the entire chain of the SoundEngine.

Renders any oversampling, effect chaining, and modulation updates.

Parameters
audio_inA buffer of poly_float audio data to be processed (unused in many contexts).
num_samplesNumber of samples in the buffer.
audio_inBuffer of samples (poly_float), though many effects do not use direct audio_in.
num_samplesThe block size to process.

Reimplemented from vital::Processor.

◆ setAftertouch() [1/2]

void vital::SoundEngine::setAftertouch ( mono_float note,
mono_float value,
int sample,
int channel )

Sets polyphonic aftertouch for a specific note on a given channel.

Sets polyphonic aftertouch for a specific note.

Parameters
noteMIDI note number.
valueAftertouch value in [0..1].
sampleThe sample index.
channelThe MIDI channel.
noteMIDI note number.
valueAftertouch in [0..1].
sampleSample index.
channelMIDI channel.

◆ setAftertouch() [2/2]

void vital::SoundEngine::setAftertouch ( mono_float note,
mono_float value,
int sample,
int channel )

Sets note-based aftertouch values.

Parameters
noteThe MIDI note number.
valueThe aftertouch value.
sampleThe sample index at which this occurs.
channelThe channel on which the aftertouch is applied.

◆ setBpm() [1/2]

void vital::SoundEngine::setBpm ( mono_float bpm)

Updates the engine’s tempo in BPM, converting to beats per second for internal usage.

Updates the engine’s internal beats-per-minute, stored as beats_per_second.

Parameters
bpmThe new tempo in beats per minute.
bpmThe new BPM value.

◆ setBpm() [2/2]

void vital::SoundEngine::setBpm ( mono_float bpm)

Sets the BPM (beats per minute) value for the engine.

Parameters
bpmThe new BPM value.

◆ setChannelAftertouch() [1/2]

void vital::SoundEngine::setChannelAftertouch ( int channel,
mono_float value,
int sample )

Sets channel-wide aftertouch on a given channel.

Sets channel-wide aftertouch for a single channel.

Parameters
channelThe MIDI channel.
valueAftertouch value in [0..1].
sampleThe sample index.
channelMIDI channel.
valueAftertouch in [0..1].
sampleSample index.

◆ setChannelAftertouch() [2/2]

void vital::SoundEngine::setChannelAftertouch ( int channel,
mono_float value,
int sample )

Sets aftertouch values for an entire channel.

Parameters
channelThe channel to set aftertouch on.
valueThe aftertouch value.
sampleThe sample index at which this occurs.

◆ setChannelRangeAftertouch() [1/2]

void vital::SoundEngine::setChannelRangeAftertouch ( int from_channel,
int to_channel,
mono_float value,
int sample )

Applies aftertouch to all channels in a specified range.

Sets channel-wide aftertouch for all channels in [from_channel..to_channel].

Parameters
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).
valueAftertouch value in [0..1].
sampleThe sample index.
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).
valueAftertouch in [0..1].
sampleSample index.

◆ setChannelRangeAftertouch() [2/2]

void vital::SoundEngine::setChannelRangeAftertouch ( int from_channel,
int to_channel,
mono_float value,
int sample )

Sets aftertouch values for a range of channels.

Parameters
from_channelThe first channel in the range.
to_channelThe last channel in the range.
valueThe aftertouch value.
sampleThe sample index at which this occurs.

◆ setChannelRangeSlide() [1/2]

void vital::SoundEngine::setChannelRangeSlide ( int from_channel,
int to_channel,
mono_float value,
int sample )

Applies channel slide to all channels in a specified range.

Sets channel-wide slide for all channels in the specified range.

Parameters
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).
valueThe slide value in [0..1].
sampleThe sample index.
from_channelThe first channel in the range.
to_channelThe last channel in the range.
valueSlide in [0..1].
sampleSample index.

◆ setChannelRangeSlide() [2/2]

void vital::SoundEngine::setChannelRangeSlide ( int from_channel,
int to_channel,
mono_float value,
int sample )

Sets slide values for a range of channels.

Parameters
from_channelThe first channel in the range.
to_channelThe last channel in the range.
valueThe slide value.
sampleThe sample index at which this occurs.

◆ setChannelSlide() [1/2]

void vital::SoundEngine::setChannelSlide ( int channel,
mono_float value,
int sample )

Sets channel slide (e.g., an expression or glide parameter) on a specific channel.

Sets channel-wide slide on a single channel.

Parameters
channelThe MIDI channel.
valueThe slide value in [0..1].
sampleThe sample index.
channelMIDI channel.
valueSlide in [0..1].
sampleSample index.

◆ setChannelSlide() [2/2]

void vital::SoundEngine::setChannelSlide ( int channel,
mono_float value,
int sample )

Sets channel-based slide (MPE/MIDI CC glides).

Parameters
channelThe channel on which to set the slide value.
valueThe slide value.
sampleThe sample index at which this occurs.

◆ setModWheel() [1/2]

void vital::SoundEngine::setModWheel ( mono_float value,
int channel )

Sets the mod wheel value for a given MIDI channel.

Sets the mod wheel value for a specific channel.

Parameters
valueMod wheel value in range [0..1].
channelThe MIDI channel.
valueThe mod wheel value [0..1].
channelThe MIDI channel.

◆ setModWheel() [2/2]

void vital::SoundEngine::setModWheel ( mono_float value,
int channel )

Sets the modulation wheel value for a given channel.

Parameters
valueThe modulation wheel value.
channelThe channel to set the mod wheel on.

◆ setModWheelAllChannels() [1/2]

void vital::SoundEngine::setModWheelAllChannels ( mono_float value)

Sets the mod wheel value for all MIDI channels.

Sets the mod wheel value for all channels.

Parameters
valueThe mod wheel value in range [0..1].
valueThe mod wheel value [0..1].

◆ setModWheelAllChannels() [2/2]

void vital::SoundEngine::setModWheelAllChannels ( mono_float value)

Sets the modulation wheel value for all channels.

Parameters
valueThe modulation wheel value.

◆ setOversamplingAmount()

void vital::SoundEngine::setOversamplingAmount ( int oversampling_amount,
int sample_rate )

Configures the engine’s oversampling factor and sample rate.

Configures oversampling for the engine, upsampler, modulation handler, and effect chain.

Parameters
oversampling_amountThe new oversampling factor (e.g., 2, 4).
sample_rateThe current audio sample rate in Hz.
oversampling_amountThe integer oversampling factor.
sample_rateThe current audio sample rate in Hz.

◆ setPitchWheel() [1/2]

void vital::SoundEngine::setPitchWheel ( mono_float value,
int channel )

Sets the pitch wheel value for a specified MIDI channel.

Sets the pitch wheel value for a specific channel.

Parameters
valueThe pitch bend value in range [-1..1].
channelThe MIDI channel.
valueThe pitch bend amount in [-1..1].
channelThe MIDI channel.

◆ setPitchWheel() [2/2]

void vital::SoundEngine::setPitchWheel ( mono_float value,
int channel )

Sets the pitch wheel value for a given channel.

Parameters
valueThe pitch wheel value.
channelThe channel to set the pitch wheel on.

◆ setTuning() [1/2]

void vital::SoundEngine::setTuning ( const Tuning * tuning)

Sets a custom Tuning object for note-to-frequency mapping.

Sets a custom tuning table for note pitch mapping.

Parameters
tuningPointer to a Tuning instance defining frequency ratios.
tuningPointer to a Tuning object that maps MIDI notes to frequencies.

◆ setTuning() [2/2]

void vital::SoundEngine::setTuning ( const Tuning * tuning)

Sets the tuning to use for pitch calculations.

Parameters
tuningA pointer to the Tuning object to apply.

◆ setZonedPitchWheel() [1/2]

void vital::SoundEngine::setZonedPitchWheel ( mono_float value,
int from_channel,
int to_channel )

Applies a pitch wheel value to a range of MIDI channels.

Sets a pitch wheel value for a range of channels.

Parameters
valueThe pitch bend value in range [-1..1].
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).
valueThe pitch bend in [-1..1].
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).

◆ setZonedPitchWheel() [2/2]

void vital::SoundEngine::setZonedPitchWheel ( mono_float value,
int from_channel,
int to_channel )

Sets the pitch wheel value for a range of channels.

Parameters
valueThe pitch wheel value.
from_channelThe first channel in the range.
to_channelThe last channel in the range.

◆ sostenutoOff() [1/2]

void vital::SoundEngine::sostenutoOff ( int sample,
int channel )

Disengages sostenuto on a single MIDI channel.

Disengages sostenuto for a single channel.

Parameters
sampleThe sample index at which sostenuto is released.
channelThe MIDI channel.
sampleSample index at which sostenuto is released.
channelMIDI channel.

◆ sostenutoOff() [2/2]

void vital::SoundEngine::sostenutoOff ( int sample,
int channel )

Turns sostenuto off for a given channel at a specific sample.

Parameters
sampleThe sample index at which to turn sostenuto off.
channelThe channel on which to turn sostenuto off.

◆ sostenutoOffRange() [1/2]

void vital::SoundEngine::sostenutoOffRange ( int sample,
int from_channel,
int to_channel )

Disengages sostenuto on a range of MIDI channels.

Disengages sostenuto for all channels in the given range.

Parameters
sampleThe sample index at which sostenuto is released.
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).
sampleSample index at which sostenuto is released.
from_channelFirst channel in the range.
to_channelLast channel in the range (inclusive).

◆ sostenutoOffRange() [2/2]

void vital::SoundEngine::sostenutoOffRange ( int sample,
int from_channel,
int to_channel )

Turns sostenuto off for a range of channels at a given sample.

Parameters
sampleThe sample index at which to turn sostenuto off.
from_channelThe first channel in the range.
to_channelThe last channel in the range.

◆ sostenutoOn() [1/2]

void vital::SoundEngine::sostenutoOn ( int channel)

Engages sostenuto on a single MIDI channel (holding only currently pressed notes).

Engages sostenuto on a single channel, holding only currently active notes.

Parameters
channelThe MIDI channel to engage sostenuto.
channelMIDI channel.

◆ sostenutoOn() [2/2]

void vital::SoundEngine::sostenutoOn ( int channel)

Turns sostenuto on for a given channel.

Parameters
channelThe channel to apply sostenuto.

◆ sostenutoOnRange() [1/2]

void vital::SoundEngine::sostenutoOnRange ( int from_channel,
int to_channel )

Engages sostenuto on a range of MIDI channels.

Engages sostenuto for all channels in a specified range.

Parameters
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).
from_channelFirst channel in the range.
to_channelLast channel in the range (inclusive).

◆ sostenutoOnRange() [2/2]

void vital::SoundEngine::sostenutoOnRange ( int from_channel,
int to_channel )

Turns sostenuto on for a range of channels.

Parameters
from_channelThe first channel in the range.
to_channelThe last channel in the range.

◆ sustainOff() [1/2]

void vital::SoundEngine::sustainOff ( int sample,
int channel )

Disengages sustain on a single MIDI channel, releasing notes if their keys are up.

Turns sustain off for a given channel, releasing notes if keys are up.

Parameters
sampleThe sample index at which sustain is released.
channelThe MIDI channel.
sampleSample index at which sustain is released.
channelMIDI channel.

◆ sustainOff() [2/2]

void vital::SoundEngine::sustainOff ( int sample,
int channel )

Turns sustain off for a given channel at a specific sample.

Parameters
sampleThe sample index at which to turn sustain off.
channelThe channel on which to turn sustain off.

◆ sustainOffRange() [1/2]

void vital::SoundEngine::sustainOffRange ( int sample,
int from_channel,
int to_channel )

Disengages sustain on a range of MIDI channels.

Disengages sustain for all channels in the given range.

Parameters
sampleThe sample index at which sustain is released.
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).
sampleSample index at which sustain is released.
from_channelFirst channel in the range.
to_channelLast channel in the range (inclusive).

◆ sustainOffRange() [2/2]

void vital::SoundEngine::sustainOffRange ( int sample,
int from_channel,
int to_channel )

Turns sustain off for a range of channels at a given sample.

Parameters
sampleThe sample index at which to turn sustain off.
from_channelThe first channel in the range.
to_channelThe last channel in the range.

◆ sustainOn() [1/2]

void vital::SoundEngine::sustainOn ( int channel)

Engages sustain on a single MIDI channel (holding all pressed notes).

Turns sustain on for a given MIDI channel, holding all pressed notes.

Parameters
channelThe MIDI channel to sustain.
channelMIDI channel.

◆ sustainOn() [2/2]

void vital::SoundEngine::sustainOn ( int channel)

Turns sustain on for a given channel.

Parameters
channelThe channel to sustain.

◆ sustainOnRange() [1/2]

void vital::SoundEngine::sustainOnRange ( int from_channel,
int to_channel )

Engages sustain on a range of MIDI channels.

Engages sustain for all channels in a specified range.

Parameters
from_channelThe first channel in the range.
to_channelThe last channel in the range (inclusive).
from_channelFirst channel in the range.
to_channelLast channel in the range (inclusive).

◆ sustainOnRange() [2/2]

void vital::SoundEngine::sustainOnRange ( int from_channel,
int to_channel )

Turns sustain on for a range of channels.

Parameters
from_channelThe first channel in the range.
to_channelThe last channel in the range.

Member Data Documentation

◆ kDefaultOversamplingAmount

static constexpr int vital::SoundEngine::kDefaultOversamplingAmount = 2
staticconstexpr

Default oversampling factor.

The default oversampling amount for the engine.

◆ kDefaultSampleRate

static constexpr int vital::SoundEngine::kDefaultSampleRate = 44100
staticconstexpr

Default sample rate used before explicit configuration.

The default sample rate for the engine.


The documentation for this class was generated from the following files: