There are multiple ways to do that. First, Lua has tables and you can keep pointers to modulators in a table
modulatorTable["mod1"] = panel:getModulatorByName("mod1")
modulatorTable["mod2"] = panel:getModulatorByName("mod2")
etc. Then all the Lua/Table stuff applies, http://lua-users.org/wiki/TablesTutorial You can use that to store your modulators at panel startup and later just access them through the table
Also there is a special method that returns a table of modulators based on a wildcard applied to theirs name, assuming that your modulator names start with “mod” and you have 2 of them (or more), you could do:
t = panel:getModulatorsWildcard("mod*", true)
console ("mods in table: "..#t)
and the “t” will be a table of modulators found.
I’m sure with Lua you can use loads of other methods to keep modulators. You can index the tables using numbers, string, hell if you have a look at the tutorial you can use other functions as keys. So there is a lot you can do.
-
This reply was modified 11 years ago by atom.