Old 03-27-2014, 03:13 PM   #1
Mister1234
Human being with feelings
 
Mister1234's Avatar
 
Join Date: Jan 2011
Location: Colorado
Posts: 82
Default Getting more sliders

The control plugin I am trying to create for my DSI Mopho synth requires about 200 parameters but JS only allows 64 sliders. Is there any way to get more sliders besides creating separate plugins?
__________________
www.mr1234.com
Mister1234 is offline   Reply With Quote
Old 03-28-2014, 03:56 AM   #2
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
Default

Without drawing a custom GUI the only way is to have 'pages' of sliders, so one slider sets which values are displayed by the other sliders. So for 200 params you could have four pages of fifty sliders or ten pages of twenty etc. I've used that for a couple of my things in the past. The easiest way to manage the parameter values is to store them in memory and use loops to get/set the slider values, something like this...
Code:
@slider
valsPerPage = 20;
s = 2; // start on slider2 (slider() index is 1 based IIRC)

slider1 != page ? // page changed, set new values for sliders
(
  page = slider1;
  v = page * valsPerPage;
  loop
  (
    valsPerPage,
    slider(s) = v[];
    v += 1;
    s += 1;
  );
)
: // page hasn't changed so get new values from sliders
(
  v = page * valsPerPage;
  loop
  (
    valsPerPage,
    v[] = slider(s);
    v += 1;
    s += 1;
  );
);
IXix is offline   Reply With Quote
Old 04-10-2014, 07:22 AM   #3
Mister1234
Human being with feelings
 
Mister1234's Avatar
 
Join Date: Jan 2011
Location: Colorado
Posts: 82
Default

Thank you for the advice, I've been pondering how to implement a multi-page setup. Is it possible to redefine a slider's value range on each page? For example, Slider12 on page 1 would have a range of -50 to 50 while on page 2 it would have a range of 0 to 127. I experimented with using variables for the min and max values in the slider definition and while loops to define those values on each page, but this just broke the slider.

You also mention in passing drawing a custom GUI to get more faders. Can you give me a little more detail on what that involves?

Thanks!
__________________
www.mr1234.com
Mister1234 is offline   Reply With Quote
Old 04-10-2014, 07:58 AM   #4
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default

No you cannot change the slider range.

Set the slider itself to, say 0 to 999, then scale it depending on the page.

Code:
// can be done prettier with arrays
p1_s1_min = -50;
p1_s1_max =  50;

p2_s1_min = 0;
p2_s1_max = 127;

pagenum == 1 ? ( s1_min = p1_s1_min; s1_max = p1_s1_max; );
pagenum == 2 ? ( s1_min = p2_s1_min; s1_max = p2_s1_max; );
// then use s1_min and s1_max in your calculations
// I think the calculation is:
s1_value = floor (slider1 / 1000 * (s1_max - s1_min) + s1_min );
Custom GUI? - quite a lot of graphics work but you can have lots of sliders or knobs or buttons or draggable values or ...
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 04-10-2014, 11:02 AM   #5
Mister1234
Human being with feelings
 
Mister1234's Avatar
 
Join Date: Jan 2011
Location: Colorado
Posts: 82
Default

Thank you, Darkstar! Any suggestions for JS plugins that make use of a custom GUI that I could look at and learn from?
__________________
www.mr1234.com
Mister1234 is offline   Reply With Quote
Old 04-15-2014, 05:26 AM   #7
Mister1234
Human being with feelings
 
Mister1234's Avatar
 
Join Date: Jan 2011
Location: Colorado
Posts: 82
Default

Is my understanding correct that envelopes and modulation functions can only be applied to sliders? Is there any way to apply them to GUI elements?
__________________
www.mr1234.com
Mister1234 is offline   Reply With Quote
Old 04-15-2014, 05:57 AM   #8
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default

Not directly.

I reckon that you could have a hidden slider (put a - at the start of the slider label), and assign the slider value to the GUI element:

The glitches are down to Licecap :

__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar 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 12:23 PM.


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