Count and read Modulators in Chain
Lets say I have a SimpleGain, in the first mod chain I have 3 different type of modulators, is there a way to iterate over them and read their intensity?
for (mod in SimpleGain.getModulatorsAtChain(0)) local intensity = mod.getIntensity();
I have a project with up to 6 different modulators on effects, detune and spread osc.
@ulrik Either you added them manually or dynamically, you just have to put their references in an array and get their values in a for loop:
const var SimpleGain1 = Synth.getEffect("Simple Gain1"); const var gainMod = [Synth.getModulator("gainMod1"), Synth.getModulator("gainMod2")]; for (m in gainMod) Console.print(m.getCurrentLevel());
@ustk Yes I added them dynamically, and of course I should have thought about it that I might needed the exact order of mods in each chain, when I added them but...
I thought that maybe there was a clever function that counted them for me but I could not find any.
I found this, but I don't understand what it does, well I could not iterate over the result anyway
@ulrik This gives you the whole modulation level of the chain (delay, width, pan, etc...)
@ustk Ok, thanks, when I Console.print(trace(it)) it showed up empty object
@ulrik There's a
Synth.getAllModulators(regex), that should work but I never used it myself...
@ustk Yes it works, I use it in this project