Old 04-24-2023, 03:42 PM   #1
vesper test
Human being with feelings
 
Join Date: Feb 2023
Posts: 1
Default Two quick questions about sliders

Hi everyone,

New to JSFX, really awesome tool that makes me enjoy building audio programs!

Two quick questions:

1) Is it possible to specify that code in @slider only activate if a certain slider is touched?

- I can do this by setting another variable and checking to seeing if it matches the slider, but maybe there's a simple way I'm missing?


2) Is it possible to get the slider associated with a variable name?
- for example, function(volume) returns 5 because slider 5 is named volume

Thanks!
vesper test is offline   Reply With Quote
Old 04-24-2023, 11:34 PM   #2
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by vesper test View Post
1) Is it possible to specify that code in @slider only activate if a certain slider is touched?
No.

Quote:
Originally Posted by vesper test View Post
- I can do this by setting another variable and checking to seeing if it matches the slider, but maybe there's a simple way I'm missing?
No, this is how you do it.

Quote:
Originally Posted by vesper test View Post
2) Is it possible to get the slider associated with a variable name?
- for example, function(volume) returns 5 because slider 5 is named volume
Yes, you can use this (since REAPER v5.0):

Code:
slider1:variable_name=5<0,10,1>slider description
Source: https://www.reaper.fm/sdk/js/js.php#js_file
Tale is offline   Reply With Quote
Old 04-25-2023, 12:07 AM   #3
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

If you really want, you can use the visual slider name in multiple places in the program by means of preprocessor macros defining that name in a preprocessor variable in the beginning and using same in multiple printf macro statements.
mschnell is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.