SynthLab SDK
SynthEngineParameters

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
// --- engine parameters
struct SynthEngineParameters
{
SynthEngineParameters() {}
// --- enable/disable keyboard (MIDI note event) input; when disabled, synth goes into manual mode (Will's VCS3)
bool enableMIDINoteEvents = true;
// --- global synth mode
uint32_t synthModeIndex = enumToInt(SynthMode::kMono);
// --- global volume control, controls each output DCA's master volume
double globalVolume_dB = 0.0;
// --- master pitch bend, in semitones and cents
unsigned int globalPitchBendSensCoarse = 7; // --- this number is always positive (parse as +/- value) 7 semitones = perfect 5th
unsigned int globalPitchBendSensFine = 0; // --- this number is always positive (parse as +/- value) see MIDI RPN 00 00 (sensitivity) and 00 01 (fine tuning)
// --- these are actually really important, especially for non-western music styles and
// eccentric electronic music composers too...
int globalTuningCoarse = 0; // --- (+/-) semitones, see MIDI spec
int globalTuningFine = 0; // --- (+/-) cents see MIDI spec
// --- unison Detune - this is the max detuning value NOTE a standard (or RPN or NRPN) parameter :/
double globalUnisonDetune_Cents = 0.0;
// --- VOICE layer parameters
std::shared_ptr<SynthVoiceParameters> voiceParameters = std::make_shared<SynthVoiceParameters>();
// --- FX is unique to engine, not part of voice
// std::shared_ptr<AudioDelayParameters> audioDelayParameters = std::make_shared<AudioDelayParameters>();
// bool enableDelayFX = false;
};
// ---


synthlab_4.png