The SynthEngineParameters structure is declared in the synthengine.h file to keep it close to the object that owns it. This parameter structure is fairly well set and established, and you may not need to make any additions to it. This structure defines, instantiates, and hold a shared pointer to the SynthVoiceParameter structure that is delivered to the voice objects during construction. This pointer is the original source of the SynthVoiceParameter structure that all voices share, and whose SynthModule members share it's subcomponent paraemter structures. So the engine parameter structure is the central location that owns the shared voice parameter structures.
Some things to note:
- the enableMIDINoteEvents flag is not used in SynthLab projects; I use it for VCS3-type synths that can generate render audio without any input
- the synthModeIndex encodes the synth mode as per the synth book; unison, mono, poly, legato
- I have included global pitch bend and global tuning variables that accept MIDI data and will be converted into decimal form by the engine; see the MIDI spedifications under the names "master pitch bend" and "master tuning"
- there is one and only one shared voice parameter structure
- the Delay FX parameters will go here if you use the built-in delay object
- your framework will interact directly with this structure, see Updating GUI Parameters for more information and examples
struct SynthEngineParameters
{
SynthEngineParameters() {}
bool enableMIDINoteEvents = true;
uint32_t synthModeIndex =
enumToInt(SynthMode::kMono);
double globalVolume_dB = 0.0;
unsigned int globalPitchBendSensCoarse = 7;
unsigned int globalPitchBendSensFine = 0;
int globalTuningCoarse = 0;
int globalTuningFine = 0;
double globalUnisonDetune_Cents = 0.0;
std::shared_ptr<SynthVoiceParameters> voiceParameters = std::make_shared<SynthVoiceParameters>();
};