HELP: A "Reset" switch to setting different parameters to desired values

Hello,
I am creating some short scripts to use with a switch (push) that allow to reset (or set to the desired value) various parameters.
It works fine with many controls, but doesn’t works with the mod Matrix parameters, it seems that the reference (address) is wrong. I tried every combination without a result. The wrong part is probably “Mod 3.Destination.Depth”. I hope anyone can help me.

-- RESET ENV3

function onResetEnv3()

newEnv3A = -100
newEnv3R = -100
newEnv3L1 = 0
newEnv3L2 = 0
newIntE3 = 0

	this.parent:getZone():setParameter("UserAttOffset", newEnv3A)
	this.parent:getZone():setParameter("UserRelOffset", newEnv3R)
	this.parent:getZone():setParameter("UserL0Offset", newEnv3L1)
        this.parent:getZone():setParameter("UserLROffset", newEnv3L2)
        this.parent:getZone():setParameter("Mod 3.Destination.Depth", newIntE3)

  
end

defineParameter("ResetEnv3", onResetEnv3)

For modulation matrix parameters you need to use getModulationMatrixRow()

So in your case it probably should be

this.parent:getZone():getModulationMatrixRow(3):setParameter("Destination.Depth", newIntE3)

Great, thanks you so much! Everything work as I want now.
:cry: But now, I am trying now to create a single switch that clear (and delete) all the steps of a sequence of a flexphrases module…
Any idea of how I can obtain it? I think I need to create a script that connect and create a single group of all 32 integer variables?.. so pushing my switch i disable its.

Thanks again!

If you mean Step Modulator then yes, you can set all steps to zero.

stepModulator = this.parent:getMidiModule("Mono Step Modulator")
assert(stepModulator)

defineParameter("reset", nil, false, function() onReset() end)

function onReset()
  if reset then
    for i = 1, 32 do
      stepModulator:setParameter("step"..i, 0)
    end
    reset = false
  end
end

Step Modulator.zip (7.74 KB)
But I don’t think it’s possible to do this with FlexPhraser.

Thanks for your fast feedback and for your script misohoza, but yes I mean to do it on Flexphraser. I think it need an internal script inside the element FlexPhraserStepSeq (in the basic control templates).
Probably today, I went close, but I think is needed a part of script that include the interval of the step to reset (for examples 1 to 32) and use it to create a unique defineParameter. I explored the FlexPhraserStepSeq inside script and probably the interval have to includes all values of integer @VarEnable:question:

I finished to create my amazing own interface synth, it would be the cherry on the cake :wink: