Home › Forums › General › Programming › How to make a parameters Randomiser button? › Reply To: How to make a parameters Randomiser button?
May 31, 2017 at 9:35 am
#72227
ok, so i just tried Possemo’s suggestion, and it
seems to be working much better. like this:
random=function()
-- This stops issues during panel bootup
if panel:getRestoreState() or panel:getProgramState()
then return end
-- basic randomizer
local t=os.time()
local c=os.clock()
math.randomseed(t*c)
modul = panel:getModulatorByName("hexlist")
rnd = math.random(0,15)
modul:setModulatorValue(rnd,false,false,false)
end
thanks Possemo ! (what’s the principle behind t*c ?)