Vital
Loading...
Searching...
No Matches
vital::ModulationConnection Struct Reference

A structure representing a single modulation connection between a modulation source and a destination parameter. More...

#include <synth_types.h>

Public Member Functions

 ModulationConnection (int index)
 Constructs a ModulationConnection with an index and empty source/destination.
 
 ModulationConnection (int index, std::string from, std::string to)
 Constructs a ModulationConnection with given index and names.
 
 ~ModulationConnection ()
 Destroys the ModulationConnection, cleaning up its processor.
 
void resetConnection (const std::string &from, const std::string &to)
 Resets this modulation connection to a new source and destination.
 

Static Public Member Functions

static bool isModulationSourceDefaultBipolar (const std::string &source)
 Checks if a given modulation source is bipolar by default.
 

Public Attributes

std::string source_name
 The name of the modulation source.
 
std::string destination_name
 The name of the destination parameter.
 
std::unique_ptr< ModulationConnectionProcessormodulation_processor
 Processor applying scaling/mapping.
 

Detailed Description

A structure representing a single modulation connection between a modulation source and a destination parameter.

Each ModulationConnection links a source_name (e.g., an LFO or envelope) to a destination_name (a synth parameter). It holds a ModulationConnectionProcessor to apply transformations like scaling or mapping curves.

The isModulationSourceDefaultBipolar method checks if the source typically produces bipolar values (e.g., LFOs). Connections can be reset, and by default start disconnected until resetConnection is called.

Constructor & Destructor Documentation

◆ ModulationConnection() [1/2]

vital::ModulationConnection::ModulationConnection ( int index)
inline

Constructs a ModulationConnection with an index and empty source/destination.

Parameters
indexThe connection index, often used to identify this modulation slot.

◆ ModulationConnection() [2/2]

vital::ModulationConnection::ModulationConnection ( int index,
std::string from,
std::string to )

Constructs a ModulationConnection with given index and names.

Parameters
indexThe connection index.
fromThe modulation source name.
toThe destination parameter name.

◆ ~ModulationConnection()

vital::ModulationConnection::~ModulationConnection ( )

Destroys the ModulationConnection, cleaning up its processor.

Member Function Documentation

◆ isModulationSourceDefaultBipolar()

bool vital::ModulationConnection::isModulationSourceDefaultBipolar ( const std::string & source)
static

Checks if a given modulation source is bipolar by default.

Some modulation sources (e.g., LFOs) naturally produce values in a bipolar range.

Parameters
sourceThe modulation source name.
Returns
True if default is bipolar, false otherwise.

◆ resetConnection()

void vital::ModulationConnection::resetConnection ( const std::string & from,
const std::string & to )
inline

Resets this modulation connection to a new source and destination.

Parameters
fromThe new modulation source name.
toThe new destination parameter name.

Member Data Documentation

◆ destination_name

std::string vital::ModulationConnection::destination_name

The name of the destination parameter.

◆ modulation_processor

std::unique_ptr<ModulationConnectionProcessor> vital::ModulationConnection::modulation_processor

Processor applying scaling/mapping.

◆ source_name

std::string vital::ModulationConnection::source_name

The name of the modulation source.


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