SynthLab SDK
Dynamic Module/Core & GUI

If you want to allow the user to select any core for any module, then you have another pair of options:

  1. come up with a GUI scheme in which all of the module and mod knob strings are pre-coded, but are hidden/shown with the GUI control methodolgy
  2. use the dynamic string functions that the SynthModule and ModuleCore objects expose, and that are interfaced via the engine, to change the string contents dynamically as the user selects different cores

Approach (1) above has the advantage that you will still pre-code the strings using the a priori information about the strings that you glean from the same sources as the previous section shows. However, the GUI may require some tricky kinds of controls that show and hide list boxes or drop-down combo boxes. In this case, your GUI will still trigger a call to the selectCore( ) function, but your GUI will adjust itself to reveal the module strings and mod knob labels for that core. You will still need to hard-code these strings using the same resources as the previous section.

Approach (2) is what the SynthLab projects use and assumes that you know how to manipulate your plugin GUI to dynamically adjust the string content at run-time. Note that this is going to be highly dependent on your plugin framework. It will also require that you come up with a plan for knowing which controls need updating and when to make these updates happen. There are several things to understand and ponder as well:

  1. there are four cores per module; you will need a GUI control for the list of cores, set for a maximum of four string entries/selections
  2. the module knob strings have up to 16 sub-strings (16 oscillator waveforms, 16 filter types, etc...) and not every sub-string will be populated (some are empty/blank); you will need a GUI control for the list of strings, preset for a maximum of 16 strings
  3. there are four mod knob labels per core that may be changed each time a new core is loaded; your static text labels will need to be changed on the fly
  4. for automation accuracy, your dynamic GUI string controls should be preset with [16] and [4] total list items for the module strings and mod knob labels respectively; this will keep saved sessions as well as automation synchronized properly with your lists
  5. you need to know how and when to trigger a change of the string lists (again, highly dependent on your framework's GUI capabilities)

Example Helper Object

Although SynthLab is not tied to any framework, I have included a tiny chunk of code from the ASPiK implementation that will help get you started. The majority of how this object works is based on my own scheme of "update codes" which contain boolean flags encoded in individual bits of uint32_t datatypes. The only ASPiK dependent parts involve the ICustomView pointers which are used to dynamically update the string lists. I designed a helper object named DynamicStringManager that deals with the issue of dynamically updating the strings at run-time. You can find this object in the files: