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

Maintains a lookup table for all parameters defined in Vital. More...

#include <synth_parameters.h>

Public Member Functions

 ValueDetailsLookup ()
 Constructs a ValueDetailsLookup and initializes its parameter tables.
 
const bool isParameter (const std::string &name) const
 Checks if a given name corresponds to a known parameter.
 
const ValueDetailsgetDetails (const std::string &name) const
 Retrieves ValueDetails for a given parameter name.
 
const ValueDetailsgetDetails (int index) const
 Retrieves ValueDetails by parameter index.
 
std::string getDisplayName (const std::string &name) const
 Gets a human-readable display name for a parameter.
 
int getNumParameters () const
 Gets the number of parameters defined.
 
mono_float getParameterRange (const std::string &name) const
 Gets the full parameter range (max - min).
 
std::map< std::string, ValueDetailsgetAllDetails () const
 Returns a copy of all parameter details in a map.
 
void addParameterGroup (const ValueDetails *list, int num_parameters, int index, std::string id_prefix, std::string name_prefix, int version=-1)
 Adds a group of parameters, each with prefixed names and display names.
 
void addParameterGroup (const ValueDetails *list, int num_parameters, std::string id, std::string id_prefix, std::string name_prefix, int version=-1)
 Adds a group of parameters using a string-based ID rather than numeric index.
 

Static Public Attributes

static const ValueDetails parameter_list []
 
static const ValueDetails env_parameter_list []
 
static const ValueDetails lfo_parameter_list []
 
static const ValueDetails random_lfo_parameter_list []
 
static const ValueDetails filter_parameter_list []
 
static const ValueDetails osc_parameter_list []
 
static const ValueDetails mod_parameter_list []
 

Detailed Description

Maintains a lookup table for all parameters defined in Vital.

ValueDetailsLookup stores and indexes all parameter metadata (ValueDetails) used by the synthesizer. It supports:

  • Retrieving parameter details by name or index.
  • Checking if a given name is a parameter.
  • Adding parameter groups (like envelopes, LFOs, etc.) with prefixed names and IDs.
  • Accessing parameter ranges and display names.

Constructor & Destructor Documentation

◆ ValueDetailsLookup()

vital::ValueDetailsLookup::ValueDetailsLookup ( )

Constructs a ValueDetailsLookup and initializes its parameter tables.

Loads predefined parameters and organizes them into lookup tables.

Member Function Documentation

◆ addParameterGroup() [1/2]

void vital::ValueDetailsLookup::addParameterGroup ( const ValueDetails * list,
int num_parameters,
int index,
std::string id_prefix,
std::string name_prefix,
int version = -1 )

Adds a group of parameters, each with prefixed names and display names.

Used to create sets of parameters for envelopes, LFOs, oscillators, etc.

Parameters
listArray of ValueDetails to add.
num_parametersNumber of parameters in the list.
indexIndex to append to parameter names and display names.
id_prefixPrefix for ID (e.g., "env", "lfo").
name_prefixPrefix for display name (e.g., "Envelope", "LFO").
versionOptional version override if these parameters were added/modified later.

◆ addParameterGroup() [2/2]

void vital::ValueDetailsLookup::addParameterGroup ( const ValueDetails * list,
int num_parameters,
std::string id,
std::string id_prefix,
std::string name_prefix,
int version = -1 )

Adds a group of parameters using a string-based ID rather than numeric index.

Parameters
listArray of ValueDetails to add.
num_parametersNumber of parameters in the list.
idA string ID to append.
id_prefixPrefix for ID.
name_prefixPrefix for display name.
versionOptional version override.

◆ getAllDetails()

std::map< std::string, ValueDetails > vital::ValueDetailsLookup::getAllDetails ( ) const
inline

Returns a copy of all parameter details in a map.

Returns
A map of parameter names to their ValueDetails.

◆ getDetails() [1/2]

const ValueDetails & vital::ValueDetailsLookup::getDetails ( const std::string & name) const
inline

Retrieves ValueDetails for a given parameter name.

Parameters
nameThe parameter name.
Returns
A const reference to the associated ValueDetails.

◆ getDetails() [2/2]

const ValueDetails * vital::ValueDetailsLookup::getDetails ( int index) const
inline

Retrieves ValueDetails by parameter index.

Parameters
indexThe parameter index (based on loading order).
Returns
A pointer to the ValueDetails, or nullptr if out of range.

◆ getDisplayName()

std::string vital::ValueDetailsLookup::getDisplayName ( const std::string & name) const
inline

Gets a human-readable display name for a parameter.

Parameters
nameThe parameter name.
Returns
A string with the display name.

◆ getNumParameters()

int vital::ValueDetailsLookup::getNumParameters ( ) const
inline

Gets the number of parameters defined.

Returns
The total number of parameters.

◆ getParameterRange()

mono_float vital::ValueDetailsLookup::getParameterRange ( const std::string & name) const
inline

Gets the full parameter range (max - min).

Parameters
nameThe parameter name.
Returns
The range of the parameter as a mono_float.

◆ isParameter()

const bool vital::ValueDetailsLookup::isParameter ( const std::string & name) const
inline

Checks if a given name corresponds to a known parameter.

Parameters
nameThe parameter name to check.
Returns
True if the parameter exists, false otherwise.

Member Data Documentation

◆ env_parameter_list

const ValueDetails vital::ValueDetailsLookup::env_parameter_list
static
Initial value:
= {
{ "delay", 0x000503, 0.0, 1.4142135624, 0.0, 0.0, 1.0,
ValueDetails::kQuartic, false, " secs", "Delay", nullptr },
{ "attack", 0x000000, 0.0, 2.37842, 0.1495, 0.0, 1.0,
ValueDetails::kQuartic, false, " secs", "Attack", nullptr },
{ "hold", 0x000504, 0.0, 1.4142135624, 0.0, 0.0, 1.0,
ValueDetails::kQuartic, false, " secs", "Hold", nullptr },
{ "decay", 0x000000, 0.0, 2.37842, 1.0, 0.0, 1.0,
ValueDetails::kQuartic, false, " secs", "Decay", nullptr },
{ "release", 0x000000, 0.0, 2.37842, 0.5476, 0.0, 1.0,
ValueDetails::kQuartic, false, " secs", "Release", nullptr },
{ "attack_power", 0x000000, -20.0, 20.0, 0.0f, 0.0, 1.0,
ValueDetails::kLinear, false, "", "Attack Power", nullptr },
{ "decay_power", 0x000000, -20.0, 20.0, -2.0f, 0.0, 1.0,
ValueDetails::kLinear, false, "", "Decay Power", nullptr },
{ "release_power", 0x000000, -20.0, 20.0, -2.0f, 0.0, 1.0,
ValueDetails::kLinear, false, "", "Release Power", nullptr },
{ "sustain", 0x000000, 0.0, 1.0, 1.0, 0.0, 1.0,
ValueDetails::kLinear, false, "", "Sustain", nullptr },
}
@ kQuartic
Parameter value transformed by a quartic curve.
Definition synth_parameters.h:33
@ kLinear
Parameter scales linearly between min and max.
Definition synth_parameters.h:30

◆ filter_parameter_list

const ValueDetails vital::ValueDetailsLookup::filter_parameter_list
static

◆ lfo_parameter_list

const ValueDetails vital::ValueDetailsLookup::lfo_parameter_list
static
Initial value:
= {
{ "phase", 0x000000, 0.0, 1.0, 0.0, 0.0, 1.0,
ValueDetails::kLinear, false, "", "Phase", nullptr },
{ "sync_type", 0x000000, 0.0, SynthLfo::kNumSyncTypes - 1, 0.0, 0.0, 1.0,
ValueDetails::kIndexed, false, "", "Sync Type", strings::kSyncNames },
{ "frequency", 0x000000, -7.0, 9.0, 1.0, 0.0, 1.0,
ValueDetails::kExponential, true, " secs", "Frequency", nullptr },
{ "sync", 0x000000, 0.0, SynthLfo::kNumSyncOptions - 1, 1.0, 0.0, 1.0,
{ "tempo", 0x000000, 0.0, 12.0, 7.0, 0.0, 1.0,
{ "fade_time", 0x000000, 0.0, 8.0, 0.0, 0.0, 1.0,
ValueDetails::kLinear, false, " secs", "Fade In", nullptr },
{ "smooth_mode", 0x000801, 0.0, 1.0, 1.0, 0.0, 1.0,
ValueDetails::kIndexed, false, "", "Smooth Mode", strings::kOffOnNames },
{ "smooth_time", 0x000801, -10.0, 4.0, -7.5, 0.0, 1.0,
ValueDetails::kExponential, false, " secs", "Smooth Time", nullptr },
{ "delay_time", 0x000000, 0.0, 4.0, 0.0, 0.0, 1.0,
ValueDetails::kLinear, false, " secs", "Delay", nullptr },
{ "stereo", 0x000406, -0.5, 0.5, 0.0, 0.0, 1.0,
ValueDetails::kLinear, false, "", "Stereo", nullptr },
{ "keytrack_transpose", 0x000704, -60.0, 36.0, -12.0, 0.0, 1.0,
ValueDetails::kIndexed, false, "", "Transpose", nullptr },
{ "keytrack_tune", 0x000704, -1.0, 1.0, 0.0, 0.0, 100.0,
ValueDetails::kLinear, false, "", "Tune", nullptr },
}
@ kNumSyncTypes
Definition synth_lfo.h:79
@ kNumSyncOptions
Definition synth_lfo.h:98
const std::string kSyncedFrequencyNames[]
Names for synced LFO frequencies (Freeze, 32/1, 16/1, etc.).
Definition synth_strings.h:241
const std::string kFrequencySyncNames[]
Names for frequency synchronization modes (time, tempo, keytrack, etc.).
Definition synth_strings.h:149
const std::string kOffOnNames[]
Off/On state names.
Definition synth_strings.h:18
const std::string kSyncNames[]
Full names for different sync/re-triggering modes of modulators.
Definition synth_strings.h:292
@ kExponential
Parameter value transformed by an exponential function.
Definition synth_parameters.h:35
@ kIndexed
Parameter steps through discrete indexed values.
Definition synth_parameters.h:29

◆ mod_parameter_list

const ValueDetails vital::ValueDetailsLookup::mod_parameter_list
static
Initial value:
= {
{ "amount", 0x000000, -1.0, 1.0, 0.0, 0.0, 1.0,
ValueDetails::kLinear, false, "", "Amount", nullptr },
{ "power", 0x000000, -10.0, 10.0, 0.0, 0.0, 1.0,
ValueDetails::kLinear, false, "", "Power", nullptr },
{ "bipolar", 0x000000, 0.0, 1.0f, 0.0, 0.0, 1.0,
ValueDetails::kIndexed, false, "", "Bipolar", strings::kOffOnNames },
{ "stereo", 0x000000, 0.0, 1.0f, 0.0, 0.0, 1.0,
{ "bypass", 0x000000, 0.0, 1.0f, 0.0, 0.0, 1.0,
}

◆ osc_parameter_list

const ValueDetails vital::ValueDetailsLookup::osc_parameter_list
static

◆ parameter_list

const ValueDetails vital::ValueDetailsLookup::parameter_list
static

◆ random_lfo_parameter_list

const ValueDetails vital::ValueDetailsLookup::random_lfo_parameter_list
static
Initial value:
= {
{ "style", 0x000401, 0.0, RandomLfo::kNumStyles - 1, 0.0, 0.0, 1.0,
{ "frequency", 0x000401, -7.0, 9.0, 1.0, 0.0, 1.0,
ValueDetails::kExponential, true, " secs", "Frequency", nullptr },
{ "sync", 0x000401, 0.0, SynthLfo::kNumSyncOptions - 1, 1.0, 0.0, 1.0,
{ "tempo", 0x000401, 0.0, 12.0, 8.0, 0.0, 1.0,
{ "stereo", 0x000401, 0.0, 1.0, 0.0, 0.0, 1.0,
{ "sync_type", 0x000600, 0.0, 1.0, 0.0, 0.0, 1.0,
ValueDetails::kIndexed, false, "", "Sync Type", strings::kOffOnNames },
{ "keytrack_transpose", 0x000704, -60.0, 36.0, -12.0, 0.0, 1.0,
ValueDetails::kIndexed, false, "", "Transpose", nullptr },
{ "keytrack_tune", 0x000704, -1.0, 1.0, 0.0, 0.0, 100.0,
ValueDetails::kLinear, false, "", "Tune", nullptr },
}
@ kNumStyles
Definition random_lfo.h:77
const std::string kRandomNames[]
Full names for different random generator modes.
Definition synth_strings.h:316

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