Old 01-30-2008, 07:35 PM   #1
argee
Human being with feelings
 
Join Date: Mar 2007
Location: Surrey, BC
Posts: 745
Default sliderchange() - does it work?

I've been trying to use the sliderchange function for a GUI I'm working on, but it doesn't seem to have any effect.

If I display the sliders for testing, when I interact with the GUI using the mouse, I see the sliders move but there is no parameter change for the sound. I've tried it with this function in or out with no success.

Has anyone else used it successfully?

Here's some sample code where I want to use it :

mouse_cap > 0 ? (
mouse_x >= 104 && mouse_x <= 272 && mouse_y >= 23 && mouse_y <= 40 ? (
count=0;
while (
(mouse_x >= 104+count*30 && mouse_x <= 124+count*30) ? (
value=count+1;
done == 0 ? (
slider1 < value ? slider1=value : slider1=value-1;
done=1;
);
);
count += 1;
count < 6;
);
mouse_cap==2 ? slider1 = 2;
sliderchange(slider1);
);
);

The only way I can get things to work is to repeat the applicable '@slider' code in the mouse handling event.
argee is offline   Reply With Quote
Old 01-31-2008, 05:05 AM   #2
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,887
Default

I noticed that yesterday. It seems that sliderchange() updates the display but doesn't actually execute the @slider code. Not sure if it's always been that way or if it's a bug that's crept in recently.
IXix is offline   Reply With Quote
Old 01-31-2008, 10:46 AM   #3
ph69
Human being with feelings
 
ph69's Avatar
 
Join Date: Jan 2008
Location: Paris (FR)
Posts: 78
Default

That can be problematic.
As I plan to use @gfx and trigger a @slider call when something changed...
Maybe, I have to work my updates in @block and have a trigger-boolean set by the gfx and/or slider section.
ph69 is offline   Reply With Quote
Old 01-31-2008, 11:19 AM   #4
argee
Human being with feelings
 
Join Date: Mar 2007
Location: Surrey, BC
Posts: 745
Default

For now, I've moved all the code in the @slider section to the various mouse-handling code sections within the @gfx section and am using the sliders just to store the values set by the mouse actions - this seems to work OK.

cheers
argee is offline   Reply With Quote
Old 02-01-2008, 04:14 AM   #5
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,887
Default

Quote:
Originally Posted by ph69 View Post
Maybe, I have to work my updates in @block and have a trigger-boolean set by the gfx and/or slider section.
Yeah, that's how I've been getting around it.
IXix is offline   Reply With Quote
Old 10-16-2019, 01:26 PM   #6
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,407
Default

This seems to still be the case!

Calling
Code:
sliderchange(slider1)
doesn't do anything to me. Assigning slider1 new values in my gfx code, updates the GUI but does not effect the sliderchange.

Luckily, now we can define functions, so I defined one function with all the slider changes, and call that from both the gfx code and @slider.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 10-18-2019, 11:17 AM   #7
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,887
Default

Ha, would be nice to know if this is a bug or not!
IXix is offline   Reply With Quote
Old 05-27-2020, 10:28 AM   #8
J Reverb
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,071
Default

Anyone get this to work ?

@fabian
any chance of a demo snippet ?


Ta.
J Reverb is offline   Reply With Quote
Old 05-27-2020, 03:14 PM   #9
Zapatero
Human being with feelings
 
Join Date: Oct 2018
Posts: 26
Default

Quote:
Originally Posted by J Reverb View Post
Anyone get this to work ?

Ta.
Perhaps I misunderstand your problem - have you tried the function slider_automate()?
Zapatero is offline   Reply With Quote
Old 05-28-2020, 10:44 AM   #10
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,407
Default

Quote:
Originally Posted by J Reverb View Post
Anyone get this to work ?

@fabian
any chance of a demo snippet ?


Ta.
Snippet:
Code:
//...
@init
function effect_sliderchange()
(
  solo_mute = slider2;
  ch12 = abs((slider1 == 1) - solo_mute); // Some fancy pseudo-boolean stuff...
  ch34 = abs((slider1 == 2) - solo_mute); // ... going on here
  ch56 = abs((slider1 == 3) - solo_mute);
  //...
);
//..
@slider
  effect_sliderchange();
//...
@gfx 200 50
//...
  effect_sliderchange();
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 05-30-2020, 05:04 AM   #11
J Reverb
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,071
Default

Thanks Fabian,
I am looking to set a slider to a value so it moves the slider cap to that value but doesn't send an actual output value until it is moved.

Is this possible ?
Sort of like a recall position thing.
J Reverb is offline   Reply With Quote
Old 05-30-2020, 10:56 AM   #12
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,407
Default

Quote:
Originally Posted by J Reverb View Post
Thanks Fabian,
I am looking to set a slider to a value so it moves the slider cap to that value but doesn't send an actual output value until it is moved.

Is this possible ?
Sort of like a recall position thing.
I think I understand: "set a slider to a value so it moves the slider cap to that value", and this is doable, just set "slider1 = 42;".

But I don't understand: "doesn't send an actual output value until it is moved". Do you mean that you want @slider not to be called when you set the value?
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 05-30-2020, 11:12 AM   #13
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,716
Default

the only useful usage of sliderchange() in modern JSFX is to pass -1 to trigger a "configuration state changed for undo purposes" notification...
Justin is offline   Reply With Quote
Old 05-30-2020, 11:31 AM   #14
J Reverb
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,071
Default

@Fabian
Quote:
Do you mean that you want @slider not to be called when you set the value?
Thanks,
Yes this is essentially what I am trying to do.

@Justin
Quote:
the only useful usage of sliderchange() in modern JSFX is to pass -1 to trigger a "configuration state changed for undo purposes" notification...
How would this be implemented ?

Thanks all.
J Reverb 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:55 AM.


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