Author Topic: Delay jumping of motorized faders  (Read 1445 times)

Offline cupax

  • Newbie
  • *
  • Posts: 21
Delay jumping of motorized faders
« on: November 25, 2020, 10:16:55 AM »

I mapped the jog wheel to quickly switch up-down between tracks. Each track I select the motorized fader quickly jums to it's volume value.
Now, switching between track 10 and 1, the fader will jump 9 times which is annoying.

How would I insert a short delay before the fader catches up vith the volume value? Let's say half a second, before it jumps to the volume of the selected track.

Offline azslow3

  • Administrator
  • Hero Member
  • *****
  • Posts: 1594
Re: Delay jumping of motorized faders
« Reply #1 on: November 25, 2020, 10:44:18 PM »
I attach an example preset (DO NOT FORGET TO SAVE YOUR CURRENT PRESET!).

To test, press Display->Show/Hide in the Options tab. Start clicking at different tracks with different volumes, notice 3 sec delay before value updates in AZ Display. Note that after it updates, moving current fader in Cakewalk update display instantly.

The explanation.
* Basic structure you know: parameter selection, Value (executed when you operate the fader, note that example is not using touch sensitivity), Monitors.
* State set "StripChanged" is added ("No"/"Yes", default "No") in the Options tab.
* The first monitor is Timer "once" priority 0. It will not be triggered till you trigger it explicitly (while "once"), also it should be executed before Value Monitor in the same cycle, to avoid glitches (so priority 0). In the feedback section for the Timer there is just "StripChanged = No", note "Set engine state" flag (without it setting the state is reverted after timer is executed).
* The second is Parameter Name monitor, Ultra, priority 0. It will be triggered when parameter is changed, but not when just value is changed. We want it for sure before Value monitor in the same cycle, so Ultra priority 0. In the feedback we set "StripChanged = Yes", since the only way Paramenter will change is when we change focused strip. It also ask to trigger the timer after 3 seconds. Note that in case we change the strip again within this 3 seconds, it will "reprogram" the timer. So the Timer will trigger 3 seconds after the last change, not after the first. And that is exactly what you want. The delay you can configure there (sub-second delays are in cycles, ~13 cycles per second is standard Cakewalk control surface setting, 75ms).
* Value monitor is what you already use, just with "StripChanged:No" condition. Note Priority:1, so after other monitors. Speed is up to you there, but probably you use Ultra. In the example I update AZ Display instead of sending MIDI.

So, feedback to fader will work as usual as long as StripChanged is No. If we change strip this change "parameter", so Parameter Name monitor is triggered (in all cases before the Value Monitor, since the last has lower priority). So we set StripChanged to Yes, till Timer reset it again to No.

Note that while Value Monitor is still checked ~13 times per second, till condition is met it is not "remembering" current value. That is important and the reason why we can't put the condition inside Monitor itself, to MIDI send Action. If we do, the Monitor will think (initial) value is already processed. So there will be no updated after 3 seconds, only when you change volume in Cakewalk afterwards. We could solve that problem by resetting Value monitor from the Timer so...

In AZ Controller, as in all general programming environments, there is no "single right solution" to do something. There is usually several possibilities to achieve the same result. So please do not be surprised to see different approaches to similar problem in other presets. The example is just one possible way.

Offline cupax

  • Newbie
  • *
  • Posts: 21
Re: Delay jumping of motorized faders
« Reply #2 on: November 28, 2020, 10:22:36 PM »
Thank you, works like magic!