Reply To: How to make a parameters Randomiser button?

Home Forums General Programming How to make a parameters Randomiser button? Reply To: How to make a parameters Randomiser button?

#72227
human fly
Participant
    • Topics: 124
    • Replies: 1070
    • Total: 1194
    • ★★★★

    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 ?)

    Ctrlr