@David-Healey so I got it to work, allowing to swap ScriptFX and HardcodedFX at compile time using a preprocessor
// Use a preprocessor to allow swapping dynamically between Script FX and Hardcoded FX versions of the modules at compile time #define USE_HARDCODED_MODULES 1 const var SUFFIXES = ["HCFX", "SCFX"]; const var HCFX = 0; const var SCFX = 1; reg suffix; #if USE_HARDCODED_MODULES suffix = HCFX; #else suffix = SCFX; #endif const var moduleBaseNames = ["Input Level ", "Tube Input ", "Noise "]; // Reference modules const var InputLevelSCFX = Synth.getEffect(moduleBaseNames[0] + SUFFIXES[suffix]); const var TubeInputFX = Synth.getEffect(moduleBaseNames[1] + SUFFIXES[suffix]); const var NoiseFX = Synth.getEffect(moduleBaseNames[2] + SUFFIXES[suffix]); // Reference MM modules from parent module references instead of direct ID const var INHeat = TubeInputFX.getModulatorChain(0).getModulatorChain(0); const var INBias = TubeInputFX.getModulatorChain(1).getModulatorChain(0); // Link UI component to processorId of the current modules noiseListenBtn.set("processorId", moduleBaseNames[2] + SUFFIXES[suffix]); // pre-populate the module list for later bypass (because we can't use Synth.getEffect after init) const var hardcodedFxBypassList = []; const var scriptFxBypassList = []; populateBypassLists(); inline function populateBypassLists() { for (name in moduleBaseNames) { hardcodedFxBypassList.push(Synth.getEffect(name + SUFFIXES[HCFX])); scriptFxBypassList .push(Synth.getEffect(name + SUFFIXES[SCFX])); } } // Do the bypass after init Content.callAfterDelay(100, bypassModules, ""); inline function bypassModules() { for (i=0; i< hardcodedFxBypassList.length; i++) { hardcodedFxBypassList[i].setBypassed(suffix != HCFX); scriptFxBypassList[i] .setBypassed(suffix != SCFX); } }The only (minor?) glitch I get is sliders currently modulating on the interface are not refreshing when using the second module (in my case the HCFX version)
That's probably because of a race condition in the MM naming that needs to be the same.
This appart, the good news is that the modulators are linked internally, so they are still working no matter the swapping.
this shouldn't be an issue at all with other kind of sub-modules/modulators