jalovatt / scythe

Lua GUI library and utility framework for Reaper scripts (formerly Lokasenna_GUI)
https://jalovatt.github.io/scythe
MIT License
26 stars 5 forks source link

Q: val() get/set units #169

Open X-Raym opened 3 years ago

X-Raym commented 3 years ago

Hi !

Trying to get/set value of a slider,

slider:val() returns value in expected format, andslider:val( new_val ) requires new_val to be set in incrementation steps ?

Do I miss something there ?

Thanks !

X-Raym commented 3 years ago

Here is the formula to set from an arbitrary val value:

slider:val( (val- slider.min) / slider.inc )

jalovatt commented 3 years ago

Hi X-Raym, sorry I missed this when you posted it. That's correct, and I regret leaving it that way. I actually thought I had gone through all of them at some point and standardized the :val methods to use the same inputs and outputs. I guess not. :(

Unfortunately, this is probably not fixable since it would break any existing scripts that use Slider:val and Reaper/Reapack don't have any dependency management to support multiple versions of Scythe.

If and when I make it back to this project, though, I'll add the correct syntax to the docs.

X-Raym commented 3 years ago

@jalovatt Thanks for your feedback, and no problem once we figure out the workaround, but sure having it written on the doc would prevent trials and errors 📦 I a fix could involve having a new val method, or add some kind of parameter to tell "incrementation" or "value" mode.

(Long time no see, so I take advantage of this post to show you the focus system I made for scythe (tab navigation between elements, offset with arrow key...) Also succeeded flexible slider width :P https://forum.cockos.com/showpost.php?p=2358702&postcount=762... Hope you fine ! Cheers !)