Hi,
I’m attempting to modify the list in the Filter Shape Menu in the Morph filter. I feel like my code is pretty close but after I connect the parameter to a menu on the macro page I get the error “attempt to index a nil value”…Comparing it to other lists that work especially the Filter Type menu, I’m not sure what I’m doing wrong…any idea?
-- define the filter types
defineSlotLocal("mffilterTypes")
mffilterTypes = {
{ name = "HP6", index = 1 },
{ name = "HP12", index = 2 },
{ name = "HP18", index = 3 },
{ name = "HP24", index = 4 },
}
-- create table with the names of the filter types
function getmfFilterTypeNames()
mffilterTypeNames = {}
for i=1, #mffilterTypes do
mffilterTypeNames[i] = mffilterTypes[i].name
end
end
getmfFilterTypeNames()
-- parameter change callbacks for the filter parameters
function onmfFilterTypeChanged()
local morphFilter = this.parent:getBus(15):getEffect("Morph Filter")
morphFilter:setParameter("typeFilterB", mffilterTypes[mfFilterType].index)
end
-- define parameters for the filter section
defineParameter("mfFilterType", "mfFilter Type", 1, mffilterTypeNames, onmfFilterTypeChanged)
As always, Thanks!