Reply To: 'custom'?

Home Forums General Programming 'custom'? Reply To: 'custom'?

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

    i thought this could work, it doesn’t:
    (same with customNameGroup)
    ie: give each item and index number, and give them a common
    customNameGroup or customIndexGroup. i know this will work
    if all the modulators/components are on a tab, and i call
    componentTabName. would be very convenient to use these other
    groupings, but they do not appear to work in the same way.

    randomize=function()
    
    --randomize group by modulatorCustomIndexGroup
    
    	--This stops issues during panel bootup
    	if panel:getRestoreState() or panel:getProgramState() then return end
    
    --random seeder
    	local t=os.time()
    	local c=os.clock()
    	math.randomseed(t*c)
    
    --custom group items to randomize
    	for k=1,2 do
    
    	mod=panel:getModulatorWithProperty("modulatorCustomIndex",k)
    	grp=mod:getComponent():getProperty("modulatorCustomIndexGroup")
    
    		if grp == 1 then
    
    		rnd=math.random(0,127) --value range to random
    		mod:setModulatorValue(rnd,false,false,false)
    		end
    	end
    end
    Ctrlr