The SynthVoiceParameters structure is declared in the synthvoice.h file to keep it close to the object that owns it. When you add or remove SynthModules from the voice object, you will likely also be adding or removing shared pointers to parameter structures from this voice-level structure as well, and that is part of the SynthLab architecture for sharing data and parameters from a centralized location. The template SynthVoiceParameter structure only include a few parameters that are voice-level.
Some things to note:
- the synthModeIndex encodes the overal mode of the engine: mono, unison, poly and legato variations
- the filterModeIndex encodes the signal flow in the two filter objecs as (0) series or (1) parallel
- portamento/glide time variables are per-voice
- unison mode tweaks are per-voice
struct SynthVoiceParameters
{
SynthVoiceParameters() {}
uint32_t synthModeIndex =
enumToInt(SynthMode::kMono);
uint32_t filterModeIndex =
enumToInt(FilterMode::kSeries);
bool enablePortamento = false;
double glideTime_mSec = 0.0;
bool legatoMode = false;
double unisonDetuneCents = 0.0;
double unisonStartPhase = 0.0;
double unisonPan = 0.0;
};