Old 01-20-2015, 02:34 PM   #1
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default JSFX Sliders Issues

I am a great fan of JSFX because it allows fast dev and experimentation and most of the time the built in sliders are just what we need.
I also tried to build some @gfx stuff (see some of my synths) but it is time consuming and i prefer to spend time on audio processing.

So here is some issues and enhancement for them...

JS slider order PITA
JSFX sliders on two columns
JSFX sliders in technicolor

would you use this enhancements ?
Do you have other ideas ?
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 01-21-2015, 09:39 AM   #2
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
Default

Quote:
Originally Posted by Smashed Transistors View Post
Yes. This should be helped somewhat by improvements in the upcoming version though, so it will be less of a PITA.
Quote:
Originally Posted by Smashed Transistors View Post
Not sure about that one. In an ideal world it would let us define positions for sliders and offer vertical sliders and buttons in addition to the current horizontal sliders and dropdowns. That'll probably never happen though.
Quote:
Originally Posted by Smashed Transistors View Post
I like that idea. Simple and effective. Stands a reasonable chance of being implemented too as it probably wouldn't take long for Justin to code it.
IXix is offline   Reply With Quote
Old 01-27-2015, 04:43 AM   #3
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

That's true that Two Column Sliders are not ideal, but i think that it is possible.
BTW when you shrink the window of a JSFX the sliders already transform into knobs...
So maybe it is not so far away.
Attached Images
File Type: jpg knobs.JPG (20.8 KB, 328 views)
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 01-27-2015, 05:50 AM   #4
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
Default

Quote:
Originally Posted by Smashed Transistors View Post
That's true that Two Column Sliders are not ideal, but i think that it is possible.
BTW when you shrink the window of a JSFX the sliders already transform into knobs...
So maybe it is not so far away.
Hey! When did that happen? Not super useful though since by the time the sliders become knobs most of the param labels are obscured.
IXix is offline   Reply With Quote
Old 02-08-2015, 03:15 AM   #5
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

The latest reaper adds slider naming variables. I think it s a nice way to cover the ordering issue as the code do not have to rely on the slider numbers.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 02-08-2015, 04:18 AM   #6
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 24,790
Default

I believe if you're going to use more than 30 sliders, it's probably nigh time to utilize some @gfx and actually do a custom skin for your plugin...
EvilDragon is offline   Reply With Quote
Old 02-08-2015, 05:01 AM   #7
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by Smashed Transistors View Post
The latest reaper adds slider naming variables. I think it s a nice way to cover the ordering issue as the code do not have to rely on the slider numbers.
Actually I think you still do because of automation, not?
Tale is offline   Reply With Quote
Old 02-08-2015, 05:05 AM   #8
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

@EvilDragon
I've done gfx GUIs more than once with some of my synths, for example with the Sheppard synth. But it can get really tricky (for example if you want selectors/lists).

I can spend about 1 hour a day for jsfx programming... and i prefer to spend this time on samples rather than pixels.

Sliders have many advantages:
- It takes one line of code to add a slider/selector
- They are automatically saved with the presets
- They are automated

From my point of view the @gfx is the ideal place for oscilloscopes and other additional information.

@Tale
Arrg, I didn't think about automation.
For example if you switch slider1 and slider2, you can manage the variable renaming so that the plugin works correctly... but the automation lanes won't be aware of the switch.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 02-08-2015 at 05:12 AM.
Smashed Transistors is offline   Reply With Quote
Old 02-10-2015, 03:01 PM   #9
Anomaly
Human being with feelings
 
Anomaly's Avatar
 
Join Date: Sep 2007
Posts: 642
Default

in my opinion it would be optimal you could render reapers built in sliders or knobs into JS graphics area using simple command (eg. gfx_slider(params...,..,..) ).
__________________
___________________________
Sonic Anomaly | free JSFX & VST Plugins
Anomaly is offline   Reply With Quote
Old 02-18-2015, 12:54 PM   #10
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

That would be so easy to use and very versatile
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 04-19-2017, 08:50 AM   #11
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,014
Default

Quote:
Originally Posted by Smashed Transistors View Post
is it possible in the meantime to easily rearrange the order of sliders?
SonicAxiom is offline   Reply With Quote
Old 04-19-2017, 09:24 AM   #12
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default

Nope, you have to renumber them throughout the code then put them in ascending order.
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 04-19-2017, 12:22 PM   #13
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,014
Default

so sad, this is an annoying flaw.
SonicAxiom is offline   Reply With Quote
Old 04-19-2017, 12:37 PM   #14
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
Default

Quote:
Originally Posted by SonicAxiom View Post
is it possible in the meantime to easily rearrange the order of sliders?
Quote:
Originally Posted by DarkStar View Post
Nope, you have to renumber them throughout the code then put them in ascending order.
Quote:
Originally Posted by SonicAxiom View Post
so sad, this is an annoying flaw.
It's only an issue if you refer to the sliders directly.

Previously the best method was to copy slider values into variables in @slider and then refer to the variables rather than sliders. That way, if you decided to reorder sliders then you only needed to change a minimal amount of code.

These days JSFX will associate variables with sliders for you so you never* need to worry about it...
Code:
slider1:myVar=1<1,512,1>Some Param
*well almost never
IXix is offline   Reply With Quote
Old 04-19-2017, 04:42 PM   #15
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,014
Default

Quote:
Originally Posted by IXix View Post
It's only an issue if you refer to the sliders directly.
That's exactly what I've always done so far
I don't know much about coding and have just begun to look into JSFX.
I'd really appreciate it if you could give me a little hint how to add a new slider at position 2 in a following list of 4 sliders so that former slider no. 2 becomes no. 3 etc. and all the following code (@slider, @sample) continues functioning as before.

Code:
slider1:4<0,100,1>parameter1
slider2:50<0,100,1>parameter2
slider3:50<0,100,1>parameter3
slider4:100<0,100,1>parameter4
slider5:10<0,100,1>parameter5

Last edited by SonicAxiom; 04-19-2017 at 04:50 PM.
SonicAxiom is offline   Reply With Quote
Old 04-20-2017, 12:57 PM   #16
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
Default

Quote:
Originally Posted by SonicAxiom View Post
add a new slider at position 2 in a following list of 4 sliders so that former slider no. 2 becomes no. 3 etc. and all the following code (@slider, @sample) continues functioning as before...
If you're modifying an existing effect, I would proceed as follows:

1. Decide variable names for your sliders.
2. Use find/replace in your preferred text editor to replace the slider references with the appropriate variable names eg.
Code:
something = slider1;  // this
something = myVarA;   // becomes this
3. Change your slider definitions to use the new format which attaches the sliders to the variable names you chose...
Code:
slider1:myVarA=4<0,100,1>parameter1
slider2:myVarB=50<0,100,1>parameter2
slider3:myVarC=50<0,100,1>parameter3
slider4:myVarD=100<0,100,1>parameter4
slider5:myVarE=10<0,100,1>parameter5
4. Reorder your sliders as you see fit. All you have to do is change the number.
5. Insert your new slider where you want it using the same syntax.

Hope that helps
IXix is offline   Reply With Quote
Old 04-20-2017, 06:37 PM   #17
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,014
Default

Quote:
Originally Posted by IXix View Post
If you're modifying an existing effect, I would proceed as follows:

1. Decide variable names for your sliders.
2. Use find/replace in your preferred text editor to replace the slider references with the appropriate variable names eg.
Code:
something = slider1;  // this
something = myVarA;   // becomes this
3. Change your slider definitions to use the new format which attaches the sliders to the variable names you chose...
Code:
slider1:myVarA=4<0,100,1>parameter1
slider2:myVarB=50<0,100,1>parameter2
slider3:myVarC=50<0,100,1>parameter3
slider4:myVarD=100<0,100,1>parameter4
slider5:myVarE=10<0,100,1>parameter5
4. Reorder your sliders as you see fit. All you have to do is change the number.
5. Insert your new slider where you want it using the same syntax.

Hope that helps
yeah, finally got it

thanks a lot, IXix, nice "workaround", great help, much appreciated!
SonicAxiom is offline   Reply With Quote
Old 04-20-2017, 09:33 PM   #18
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

It's probably worth mentioning that you can always skip numbers. If I don't know what I'm going to put in for features at that exact moment I'll skip a few and leave them open for later in development. E.g.

slider1:blah
slider2:blah
slider5:blah
slider10:blah
slider11:blah

etc

It does put a little extra graphic space, so you can use missing sliders artistically to group/separate them as desired (e.g. a break before and after the hi- and lo-pass filter controls).
SaulT is offline   Reply With Quote
Old 06-21-2018, 03:36 PM   #19
tksense
Human being with feelings
 
Join Date: Apr 2010
Posts: 34
Default

As a beginner, I wasn't able to implement the myVarA trick correctly so far.

Right now, I just wish to be able to see and grab the parameters beyond those who fit within my screen size.

For example, my plugin window would cutoff at slider #34 which is the last slider shown at the bottom of my screen. Am I missing something obvious?

Which would you say will be an easier solution, esp for beginners?

-A vertical scroll bar
-a simple GUI script that can rearrange orders or build columns, or
-possibly re-ordering often-used sliders to the top, with the variable names method (can this work)?

I am hoping to apply this to CCenv.

Appreciate it as always!

Last edited by tksense; 06-21-2018 at 04:48 PM.
tksense is offline   Reply With Quote
Old 06-21-2018, 09:15 PM   #20
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,687
Default

JSFX is a great tool for Audio and Midi handling, but it's not focused on GUI. If you have dedicated GUI requirements, you need to do the GUI yourself in code, and this is not a task beginners are supposed to do.

-Michael
mschnell is online now   Reply With Quote
Old 06-22-2018, 02:02 PM   #21
geraintluff
Human being with feelings
 
geraintluff's Avatar
 
Join Date: Nov 2009
Location: mostly inside my own head
Posts: 346
Default Experimental UI Generator

So, this might be useful or it might be pointless, but I have an experimental UI generator based on my UI library.

The idea is that you put a few simple annotations next to the sliders, to tell it how to organise the controls into rows and groups. Here's some annotations added to the built-in "Auto Wideness" effect:

Code:
// ui:row
// ui:group name=Envelope
slider1:-18<-60,0,1>-0% Wideness @ (dB)
slider2:-6<-30,24,1>-100% Wideness @ (dB)
slider3:1<0,50,1>-Attack (ms)
slider4:250<20,2000,10>-Release (ms)

// ui:row
// ui:group name=Width
slider5:0<0,50,1>-Min Width (%)
slider6:100<50,500,10>-Max Width (%)
slider7:0<0,2,1{Left+Right,Left,Right}>-0% Signal
slider8:0<0,1,1{No,Yes}>-Reverse Mode
// ui:group name=Output
slider14:0<0,100,1>-Current Wideness (%)

// ui:row
// ui:group name=Director
slider9:0<0,5,1{Left+Right,Left,Right,Sidechain Left+Right,Sidechain Left,Sidechain Right}>-Director
slider10:20<20,20000,10>-Director HP (Hz)
slider11:20000<20,20000,10>-Director LP (Hz)
slider12:0<0,1,1{No,Yes}>-Preview Director
It then generates a big mess of code to put in @gfx, using various controls depending on the slider parameters:



If you have lots of controls, there's a "compact" mode which tries to squish things up a bit:



You need to change your effect so it imports the UI library, and sets it up in @init (it needs some memory buffer). If there are already some things being drawn in @gfx, you can incorporate that with some pretty simple refactoring. You may also need to tweak the @slider code as well, depending what you're using it for.

That stuff is hopefully explained in the documentation included in the tool. If anyone gives it a try I'd be interested in any bumps you hit or bugs you find.

Geraint
__________________
JSFX set | Bandcamp/SoundCloud/Spotify

Last edited by geraintluff; 06-22-2018 at 02:24 PM.
geraintluff is offline   Reply With Quote
Old 06-22-2018, 02:51 PM   #22
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,687
Default

Nice !!!!

-Michael
mschnell is online now   Reply With Quote
Old 06-26-2018, 01:39 PM   #23
tksense
Human being with feelings
 
Join Date: Apr 2010
Posts: 34
Default

Hi Geraint,

So far, I am able to import ui-lib, copy freemem @init, generate and paste @gfx code in the end, and hide JS sliders.

The GUI shows up, but the knob in the GUI would not respond to any click. Instead, moving the original JS slider will turn the GUI into a blank white screen with a message "Unknown screen: (65.000000)".

I suspect this can be solved by a "needs_slider_update" definition. However, I haven't figured out how to implement the function (in @init) yet.

Can you show us a before & after example in how to do this?

I am hoping it will work with sysex editors like below and with CCenv by Panu Aaltio and P.M. Crockett.

A generator like this for us less technical users is a godsend.

Thank you so much for sharing!

Pat

Geraint's main JSFX UI thread with more details:
https://forum.cockos.com/showthread.php?t=181055


Code:
desc:V-Synth COSM1 DTVF

slider1:64<0,127,1>cutoff DTVF
slider2:64<0,127,1>Reso DTVF

////////////////////////////////////////////////////////////////////////////

in_pin:none
out_pin:none


import ui-lib.jsfx-inc

@init

freemem = 0;
freemem = ui_setup(freemem);


////////////////////////////////////////////////////////////////////////////

@slider
slider1 = floor(slider1);
Slider2 = floor(slider2);

////////////////////////////////////////////////////////////////////////////
@block

//COSM1 DTVF Cutoff

(slider1 != oldslider1) ?

(
msgbuf[0] = $x41;
msgbuf[1] = $x10;
msgbuf[2] = $x00;
msgbuf[3] = $x53;
msgbuf[4] = $x12;
msgbuf[5] = $x10;
msgbuf[6] = $x00;
msgbuf[7] = $x50;
msgbuf[8] = $x16;
msgbuf[9] = $x08;
msgbuf[10] = $x00;
msgbuf[11] = floor(slider1/16);
msgbuf[12] = floor(slider1 % $x10);
msgbuf[13] = floor(slider1);

 midisyx(0,msgbuf,14);
  oldslider1 = slider1;
);


//COSM1 DTVF Reso
(slider2 != oldslider2) ?
(
msgbuf[0] = $x41;
msgbuf[1] = $x10;
msgbuf[2] = $x00;
msgbuf[3] = $x53;
msgbuf[4] = $x12;
msgbuf[5] = $x10;
msgbuf[6] = $x00;
msgbuf[7] = $x50;
msgbuf[8] = $x06;
msgbuf[9] = $x08; 
msgbuf[10] = $x00;
msgbuf[11] = floor(slider2/16);
msgbuf[12] = floor(slider2 % $x10);
msgbuf[13] = floor(slider2);

 midisyx(0,msgbuf,14);
  oldslider2 = slider2;
);

Last edited by tksense; 06-27-2018 at 12:58 PM.
tksense 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:06 PM.


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