Thanks all, between everyone’s comments I got it working. It wasn’t obvious to me that I should use element:setParameter instead of this.program:setParameter in the macro script.
-- read the ID of the parent layer's level parameter
local lQC3 = getElement():getParameterDefinition("QuickControl.QC3").id
local lQC4 = getElement():getParameterDefinition("QuickControl.QC4").id
local lQC5 = getElement():getParameterDefinition("QuickControl.QC5").id
local lQC6 = getElement():getParameterDefinition("QuickControl.QC6").id
defineParameter("iMode", nil, 0, 0, 1, 1, function() switchChange() end)
function switchChange()
if iMode==0 then
getElement():setParameter(lQC5, 0)
getElement():setParameter(lQC6, 0)
elseif iMode==1 then
getElement():setParameter(lQC3, 0)
getElement():setParameter(lQC4, 0)
end
end
Question:
Per Working with Parameters - HALion Script - Steinberg Developer Help why would I want to address a parameter by name? Why wouldn’t I always display the parameter id in the ParamsList and use that number in the setParameter statement? The only reason I can think of to use a parameter by name would be if I was dynamically adding elements to the program?