Scheduled knob task after initialization
-
After the plugin is initialized, a knob needs to be set to 20 after 1 second, and then set to -50 after waiting half a second.
I tried the method below, and it works for the first 1 second, but I couldn't figure out how to do the second step after waiting half a second.
HiseSnippet 1204.3oc0W0sTaaDEdEXQiTayjjgGfsbkRmLDavPfgIINXfTmT.OQ.o8llYszJ6MrZWORqnwIC20mm9LjWk9Fz2f1ytR1VFnfi6OSydgGume+1yd9YU6DY.MMUlfrbOZPeJx5qr8GHT8Z1ivDnV6frts89jTEMAmSZ6A8IoozPjk07OWSvxoBxr98mtMgSDAzwjPnSjr.52yhYpwTa23kLNeORH8HVbIoq2nUfTzTxkY.dl2tJpOI3TRW5ADsXyYi9NRZOj02Zu1JqFTO7QgqrxZatd.Yc5lQjnnZqFVu95arYsU2jTei0oUWCYsvtgLkLwWQTzTvnaKCG32S9yhbGbBKk0gS0apg7AOmSF0rGiG1dXvIEgrpzdbnZ97P0h16yBYinONjcGCC7XMJGzrl65fTsOAHYUBRUxgzcs8CRX8Ui4nwyWZ2R.2fQD3toLTxkEM2Kl2toDjPnVNlbJcuDXyHM7VsZ0Gfget+VtttvETpBeFIA6yh6yo5TfZ3GiMIMK2kp1MJhFn7VJmM1veoKn5KExNZkF5TPslx39RArwaICWsJLAmIn3nLQfhIEXovvRqUhj6ELTkG.FkmQuu6GbcJgpkSopmoTIrNYJpWYF5eGpzVtmuk60BDscJ7YSBm2AxI8lDJlim6kvKSvTuHSzml3AXyw0Ig1EqhSfS9thtfnKGjPgj.cUPxgcdqNtAlxADQ6SC4QdbnUAS4.mSvZN5PYRlPKGXRsV.92GJsX9THXGl5yfpwlxL8U4qnfIMlWqJKB6MT0mfqUEtcApZ65XNXZ+ehN93sRUiNEjC5QDcog41Qanbvpj8MnEniAhmCbNWKRwYQQRxOMdqoSivXGcPWud3C+F7iKsvsNn0QSPwsbTLWIXUJm3.ohdnNr.n28bW7EYEEck7Jt534WNWhcww4uVQOQVbGZR4bOsfPk3jk2KLck2A4YfkDTJZAm7C6SK1umjGpKa0++xMCPEov51BEHDDUYZJb6hlB9bVHMAw.i7E1l6SjA7PG3EVbXC6iasCQQFZFvhfWfXuhoOLV6POC5mm2qwwdGZ5ovUuQ1hpFX.xM5z2Mpk+GOtwfw8++oFopA5PyBFAQwrvPNssLkoC8kmp.yi56yduY1wGV7We9u89e4owkmE8ieLlL1MnsajlEEwdmYHRDiGmBsE52JFlsfrtm8woTbHMhjwU3zSA6.0wmRCORZjGc41rPCdYXFmnlrqutuRACMfK2pU2NU.GjAkmW9ILJn50NJXZg3csayTA8tZLN2UfQHO3eCLVL.8qsymVLFfUr26Gl0okUm9ok2ZzacFMUn3sNkGacMu0odicnbxDApWyBU8JkA13JdMTKwYPoTaImjbwv77+S8pfJSctf9Hg+6juVY5tLtgNWSIdumsIj+4DfMoDe9.36X2l7+gDhWIyTLQ28IPSZnks8AYw9vmD.OkAd8gfxAGYaMmdlW99p58Z.4SEglM+ArJXVSu2pfYsgL+OwGwjfD4aBxmFqKMukgBbtElOnwA9xJXOd7X3QsCfQer2DDLootjhqLqJt5rpX8YUw0lUEWeVU7QyphabyJp+7tmkojw40IHz9s207rIKqcEDHi2Txf9S.ERqNeCconst var SimpleGain1 = Synth.getEffect("Simple Gain1"); const var Knob1 = Content.getComponent("Knob1"); inline function onKnob1Control(component, value) { SimpleGain1.setAttribute(SimpleGain1.Gain, value); }; Content.getComponent("Knob1").setControlCallback(onKnob1Control); inline function initJunper() { reg tmr = Engine.createTimerObject(); tmr.setTimerCallback(function() { var runTime = tmr.getMilliSecondsSinceCounterReset(); if (runTime > 1000) { Knob1.setValue(20); Knob1.changed(); tmr.stopTimer(); } }); tmr.startTimer(500); }; //! ============ INIT ============ initJunper(); -
@JulesV said in Scheduled knob task after initialization:
reg tmr = Engine.createTimerObject();
The timer object should be created in
onInitas a const, or if you're creating it in an inline function as a factory function then as a local, I didn't even know you could useregin an inline function
But I think there is probably a simpler way in this case

-
An object timer could do as well, switching between two predefined timings and values
HiseSnippet 983.3ocsV0uaaa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VaCXDJV+efwh0Feu8fnHX5VI.209j+Xa2Q7YB+uKVnX7YivJICdJXOdQZ.rdkPgny4zjLc8ul9AaNsulVmABn7PCw+.mBgM0zVEBatRHJESjhKI4Mh5ES20vAvD2r3tN7OH.Z2lHSyY07bJrm7RBYcWcKCassFt+1ZX6s0vC1VC6rsF1caMr2m2P8ei4oKThz71FDZzjAloYVVC3X3En40J5eAbKVeyM -
@d-healey @ustk Both methods work great for me, thank you.
-
@JulesV Interesting! What's the use case for this, if you don't mind me asking?
-
@JulesV said in Scheduled knob task after initialization:
@d-healey @ustk Both methods work great for me, thank you.
Does it work if the plugin UI is minimised?
-
@d-healey I reckon only panel timers are stopped when the interface is not showing
-
@d-healey said in Scheduled knob task after initialization:
Does it work if the plugin UI is minimised?
I tried
callWithDelayand Yes, it does.When I apply it in 4 stages as shown below, it works.
HiseSnippet 1230.3ocyW0ubaTCDWWhuRrA5zxvCfF+WmgPp+JeQFl5ZmDvSIodvoovzozQVmrslbmjGc5Rwgo+GuQ7BzWEdC3M.Vo6r84DGmPFnT+G1i1O+s6pcW4NJIkEEIUHmBmLdDC47ItcGKzCaMjvEn16ibtu6QjHMSgSH0b7HRTDyG43r52ZH3jOGx94OebSR.QPYyHgPmJ4T12yC45YT6z3o7ffCI9rS3gYjtdi1TonkLPFC3YU2xnQD5YjAriIFwVwE8cjngHmuvcyp0n0821uZ0M2cKJYK1t8I86Wole85asytUpsKo9NawJuIx4dG3y0RUWMQyhPN4ZJ8G2cn7MhDGbJOh2KfYNTA0E7bB4CkA9lPzPE0ZHOvuyjDUDBrRmYosUSRaet6Qbe9T5yReOvx.OSirIPmUlGdqNG7pjEdky.uE.ImLPJWBjdnaWphOROiiAOeraaATM6Sf5TVnjHKZkeOmaKIHgPuQH4L1gJ3vTM7pUt75X3qR6UnPAnXEowmST3t7vQALy0gJ3uAau.sw.l9f98YTsWwD1XK+hWR0mJj8LJMwofZsjgijB3fWQKWiJbQ.Wvv8iETMWJvRgkkQKkLviNQk0Ai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ple Gain1"); const var Knob1 = Content.getComponent("Knob1"); inline function onKnob1Control(component, value) { SimpleGain1.setAttribute(SimpleGain1.Gain, value); }; Content.getComponent("Knob1").setControlCallback(onKnob1Control); inline function createDelayBroadcaster(knob) { return Engine.createBroadcaster({ "id": knob.get("id") + " Delayer", "args": [ "unused" ] }); } const var Knb1Brdcstr = createDelayBroadcaster(Knob1); function stageOne() { Knb1Brdcstr.callWithDelay(1000, [Math.random()], stageTwo); } function stageTwo() { Knob1.setValue(27); Knob1.changed(); Knb1Brdcstr.callWithDelay(1200, [Math.random()], stageThree); } function stageThree() { Knob1.setValue(-43); Knob1.changed(); Knb1Brdcstr.callWithDelay(1100, [Math.random()], stageFour); } function stageFour() // Multi instance sorununu cozme amacli { Knob1.setValue(0); Knob1.changed(); Knb1Brdcstr.setBypassed(true, false, false); } stageOne(); -
@dannytaurus said in Scheduled knob task after initialization:
@JulesV Interesting! What's the use case for this, if you don't mind me asking?
It can actually be used for other purposes.
But in my case, I'm actually using it for a bug workaround. When I buld a complex custom node with 23 parameters and use it in HardcodedFX, I noticed that in one parameter, the knob, wasn't getting its value during plugin initialization.
However, after init, when the knob is tweaked, the value is updated. That's why I chose this method. Creating a custom node with fewer parameters isn't a problem, by the way. As the number of parameters increases in custom nodes, the problems increase.