Changing parameter increments

Hi abject39.

There are couple of issues with your script.

Within your function you want to set parameter “Mod 1.Depth”, such parameter doesn’t exist unless you create it. The “AmountChange” is nil because you never assigned any value to it. To access the modulation matrix parameters you need to use getModulationMatrixRow()
Your parameter “01ModAmount”, it’s probably not a good idea to have a parameter name start with a number. I would do it other way around. (“ModAmount01”)

Do you want to do this for a specific modulation row or for all of them? What if the destination is pitch. Do you still want to use the range of -100/+100 ?


You can try this. It should work for first modulation row.

--Modulation whole number values
zone1=this.parent:getZone("Synth")

function onModAmountChange()
  zone1:getModulationMatrixRow(1):setParameter("Destination.Depth", ModAmount1)
end

defineParameter("ModAmount1", "ModAmount1", 0, -100, 100, 1, onModAmountChange)

Or if you want you can create several parameters at once using loop.

--Modulation whole number values
zone1=this.parent:getZone("Synth")

for i=1,8 do
  defineParameter("ModAmount"..i, nil, 0,-100,100,1, function() onModAmountChange(i) end)
end

function onModAmountChange(i)
  zone1:getModulationMatrixRow(i):setParameter("Destination.Depth",_G["ModAmount"..i])
end