Script to Change Dynamically Control Knob Value?

Is there a way to dynamically change the values of a knob after it has been created with the OnStart event? It appears that simply changing the value of the parameter doesn’t reflect back to the screen.

Use Cases:

  • Allow knobs to have relationships with each other (tweak one parameter, it tweaks other related parameters)
  • Be able to create presets. Preset 1 changes knobs a, b, and c, Preset 2 changes knobs b, c, and d…etc.

Here’s a snippet of just trying to get the functionality working, every 1000 frames increment the knob by 1 value.

up_amount = 1
counter = 0

function OnFrame(notes)
	counter = counter + 1

	if counter>1000 then
		counter = 0
		up_amount = up_amount + 1
		
		if up_amount > 6 then
			up_amount = 1
		end

		--??? what do I put here to change the knob to reflect the incrementing value?
	end
end

function OnStart(info)
	-- create widgets in the user interface
	Knob("up_amount", 0, 1, 6, 1)
end

Thank you.