Page 1 of 1

Endless Encoders

Posted: Wed May 19, 2021 11:29 pm
by robgray
I'm working on a module that would really benefit from having endless encoders for the main functions of it.

Does anyone know if this is possible in the Module Designer? Doesn't appear to be from the docs but I could be missing something.

There are other ways to accomplish it, but call me curious!

Re: Endless Encoders

Posted: Sat May 22, 2021 8:57 am
by ColinP
There aren't any endless encoders in the VMD library but you could knock up something yourself.

I'm interested to know why you want them though as endless encoders are generally just a workaround for combining preset functionality with non-motorized hardware controls. In software you can in effect have "motorized" controls so there's no need.

Re: Endless Encoders

Posted: Sun May 23, 2021 2:34 am
by collidermod
I've investigated this a bit with this as well. As Colin said, there are no rotary encoders in VMD. The desire, to answer Colin's question, is to emulate actual hardware. I've seen motorized faders, but I've never seen a motorized knob. I feel like it helps the illusion to mimic actual hardware, but it's just an aesthetics thing.

In any case, the knob control has a SetValue, but there's a catch: calling SetValue seems to trigger Notify/Knob_Changed, which is often not desirable (or at least I've found it to be). I haven't seen an built-in way to turn this off, but I was thinking of a workaround which I had planned to do something like this in a future module:
  • Have a class `boolean updatingUi = false`
  • Whenever you update the knob, set `updatingUi = true`
  • Wrap the `Knob_Changed` handler in an `if (!updatingUi)`
  • Set `updatingUi = false` after the knob update is done
A bit silly yes, but it allows you to keep the Knob_Changed event clean. What I often do is setup Notify/GUI_Update_Timer to all a separate `UpdateUI()` method, and if you do this, you could easily adjust updatingUi = true/false at the top/bottom of an UpdateUI method, that way you know it's consistent.

Re: Endless Encoders

Posted: Sun May 23, 2021 1:09 pm
by ColinP
I've used the update flag technique several times in LSSP to suppress notifications caused by SetValue() but it's a bit messy.

I noticed just a few days ago that SetValueNoNotification() methods have been added to various GUI control interfaces so it's obviously been realised that there was an issue here. I'm planning to go back through my old code and replace the kludges with calls to the new methods to clean things up and hopefully solve a couple of mysterious minor anomalies that I suspect are related to the kludges.

PS I had a Yamaha 01V for a long while and loved the logical functionality of the motorized faders but the actual mechanical implementation was disappointing low-tech. A really nice mixer in every other aspect though, especially at the time.

Re: Endless Encoders

Posted: Sun May 23, 2021 2:45 pm
by collidermod
Oh indeed, Knob now has a SetValueNoNotification. Well this is useful.
SetValueNoNotification(double newValue, boolean bUpdateGUI)
sets the knob's value in a range from it's min to max values; does not trigger Notify

Re: Endless Encoders

Posted: Sun May 23, 2021 6:15 pm
by ColinP
Yeah, good to see useful additions to the API.

However, I hope the use of Hungarian notation is a one off. It's bad enough that the VM API breaks the Java identifier case guidelines but I have a dead serious dislike of Hungarian notation having suffered several years of brain damage working in the crazy world of DirectX.

Re: Endless Encoders

Posted: Wed May 26, 2021 4:43 am
by robgray
I’ll play with some of the ideas mentioned here.

Endless encoders would help in the same way they help on control surfaces- to have there be no upper and lower limit to an interface control, just a series of fixed +/- values depending on the action the user is taking.