Quick Sign In:  

Forum: General Discussion

Topic: Help with scriptiing a Custom Slider Button - Page: 1

This part of topic is old and might contain outdated or incorrect information

Hi
Attempting to learn VDJ script for creating a primitive Crossfader with the custom slider button.
( this script is a learning exercise, since this action is done much better with the controller's crossfader)

The script below, should crossfade deck 1 to deck 2 with 2 steps is:

 djc_button_slider 0% ? deck 1 level 100% & deck 2 level 0% : djc_button_slider > 50% && djc_button_slider < 100% ? deck 1 level 50% & deck 2 level 50% : djc_button_slider 100% ? deck 1 level 0% & deck 2 level 100% : deck 1 level 50% & deck 2 level 50% 

And does NOT work.



level 0% ? deck 1 level 100% & deck 2 level 0% : level > 50% && level < 100% ? deck 1 level 50% & deck 2 level 50% : level 100% ? deck 1 level 0% & deck 2 level 100% : deck 1 level 50% & deck 2 level 50% 

Works a bit


don't know how to reference the custom slider values for a functioning Slider.

Thanks in advance
 

Posted Tue 17 Nov 20 @ 5:03 am
AdionPRO InfinityCTOMember since 2006
 

Posted Tue 17 Nov 20 @ 5:17 am
NicotuxHome userMember since 2014
standard linear crossfader :
deck right level & param_invert & deck left level

there is no "<" or "=" or ">" in script only "param_smaller" "param_equal" "param_bigger" for "<=" "==" ">="
 

Posted Tue 17 Nov 20 @ 5:17 am
Thank you Nicotux and Adion

Still learning how how to address the custom slider button with script

I assume djc_button_slider is the VDJ Custom Button Slider, right ?


_____________________________

Thank you Nicotux

love the simple script, and so useful
Nicotux wrote :
standard linear crossfader :
deck right level & param_invert & deck left level

How does one correct for mouse movement, it is reversed from expected slider movement? (Ie moving mouse to right, moves slider to left.)
 

Posted Tue 17 Nov 20 @ 11:43 pm
AdionPRO InfinityCTOMember since 2006
No, djc_button_slider is a command specifically for some older Hercules DJ Console controllers.
custom_button is the script for custom buttons and sliders
 

Posted Wed 18 Nov 20 @ 5:08 am
IIDEEJAYII wrote :
Thank you Nicotux

love the simple script, and so useful
Nicotux wrote :
standard linear crossfader :
deck right level & param_invert & deck left level

How does one correct for mouse movement, it is reversed from expected slider movement? (Ie moving mouse to right, moves slider to left.)



I have tried placing the param_invert before and after
have tied interchanging left and right
have tired adding crossfader_hamster (maybe incorrectly)

And none of these correct the inverstion.

How does one correct for mouse movement, it is reversed from expected slider movement? (Ie moving mouse to right, moves slider to left.) Hard to retrain muscle memory.
 

Posted Wed 18 Nov 20 @ 7:10 pm
locoDogPRO InfinityModeratorMember since 2013
deck left level & param_invert & deck right level
 

Posted Thu 19 Nov 20 @ 2:48 am
NicotuxHome userMember since 2014
@locodog
How can this change the display movement ?
the slider itself still have the same value

Doesn't this only invert right and left levels only keeping display the same ?
usually direction of a slider does not have to depend on action but custom slider seems to

related to the "non bug with custom sliders" maybe... in which case the workaround could be
deck right level & param_invert & deck left level & param_invert
 

Posted Thu 19 Nov 20 @ 3:11 am
locoDogPRO InfinityModeratorMember since 2013
Obviously I'm not following what the goal is here.
 

Posted Thu 19 Nov 20 @ 7:25 am
NicotuxHome userMember since 2014
creating a primitive Crossfader with a custom slider button

it's a BEAG DEAL because of multiple issues with custom sliders

deck right level & param_invert & deck left level
will invert direction of slider and does not work with relative values
deck right level & param_invert & deck left level & param_invert
does not help
deck left level & param_invert & deck right level
only swap resulting values


the almost working version needs a FIRST workaround that is is weird :

deck right level & nothing & param_invert & deck left level
(but relative value apply only to right)


if you want a REALY WORKING crossfader working both absolute and relative you need a SECOND workaround to parameter issue as well :
deck right level & nothing & param_add 0.0 `deck right level & param_invert` & deck left level

A shorter version exist but can be confusing :
deck right level & & param_add 0.0 `deck right level & param_invert` & deck left level

because of the use of 2 '&' with a space in between
without this space in '& &' the direction is inverted again
deck right level && param_add 0.0 `deck right level & param_invert` & deck left level

that said, there is "officially" no bug with custom sliders
so that must be the way
 

Posted Thu 19 Nov 20 @ 8:23 am
Nicotux wrote :
the almost working version needs a FIRST workaround that is is weird :

deck right level & nothing & param_invert & deck left level
(but relative value apply only to right)


if you want a REALY WORKING crossfader working both absolute and relative you need a SECOND workaround to parameter issue as well :
deck right level & nothing & param_add 0.0 `deck right level & param_invert` & deck left level


Can you explain so I can learn.

1)
deck right level & nothing & param_invert & deck left level

Works well.
How does adding "& nothing" to a string of actions in VDJ script, correct the issue?



2) I don't understand the difference between

deck right level & nothing & param_invert & deck left level

and
deck right level & nothing & param_add 0.0 `deck right level & param_invert`  & deck left level

for me both seem to work well.


Again many thanks :)
 

Posted Thu 19 Nov 20 @ 5:38 pm
PS:

Thank you both Locodog and Nicotux sharing your VDJ scripting knowledge, I have much to learn.

locodog wrote :
Obviously I'm not following what the goal is here.


This amazingly cool script from Nicotux works perfectly but the displayed Software slider is reversed.
deck right level & param_invert & deck left level

see this video as I lower volume on deck 1 and raise volume on deck 2 as seen by the per decks fader movements. The mouse needs to move as expected from the Right to Left, but the displayed slider is reversed (see video).

https://gyazo.com/6c5bd4eedc0de8ebebd8becc7a9eba85

Again this should look like, moving the Crossfader from Left to Right.
 

Posted Thu 19 Nov 20 @ 5:44 pm
NicotuxHome userMember since 2014
for info:
the difference is when using relative values (moving the slider with mouse roller up or down) vs using absolute values (setting the slider with a simple mouse click or moving the slider with mouse move)

yes, when absolute only is used both scripts "seem to work well"
 

Posted Thu 19 Nov 20 @ 5:57 pm
locoDogPRO InfinityModeratorMember since 2013
deck 2 level & nothing & param_invert & deck 1 level

only loosely related, look at this, 2 sliders, opposite directions, different scales, [bring up both hp & lp filter guis to see what's going on]
param_multiply 0.66 & effect_slider "filter hp" 1 & nothing & param_invert & effect_slider 'filter lp' 1 & param_equal 0.34 ? repeat_start 'rsiBPreset' 50ms 33 & effect_slider "filter hp" 1 -2% & effect_slider "filter lp" 1 -1% : param_equal 1 ? repeat_start 'rsiBPreset' 50ms 33 & effect_slider "filter lp" 1 -3.33% : effect_active 'filter hp' 1 & effect_active 'filter lp' 1
 

Posted Thu 19 Nov 20 @ 6:55 pm
NicotuxHome userMember since 2014
@locodog:
try it again using the mouse roller on a custom slider ^^
 

Posted Thu 19 Nov 20 @ 7:20 pm
locoDogPRO InfinityModeratorMember since 2013
meh the scroll action must be sending some sort of implicit, the custom_button slider is awkward by how it updates its skin reported value. [two way communication, the custom effect other dials, but the other dials effect the slider too, prone to conflicts]
if you want to be doing this type of thing with scroll or click n drag make a virtualFX, no hard implicits to deal with that way [you could even have the custom_button slider control the virtualFX dial.

If you want to just use scroll on the custom you'd do this
deck 2 level & deck 2 level & param_multiply -1 & param_cast & deck 1 level & deck 1 level
why it works that way, I don't know, I just poked at it until it did.
Maybe devs should use a virtualFX like method for custom_button sliders where the dial is just a dial and the script has to reference the dial before it passes on its value. But we are talking about code that is DEEP in the script engine, probably going back decades.
Hell if the hard implicit came after cast values that would be workable, but until then just virtualFX
 

Posted Thu 19 Nov 20 @ 8:16 pm
locoDogPRO InfinityModeratorMember since 2013
After a bit of poking for a deck master virtualFX, here's a bit of the .ini

String DIAL A 1=set '$val' `deck master effect_slider 'virtualFX' 1` & get_var '$val' & param_cast & deck 1 level & get_var '$val' & param_invert & deck 2 level

flows like a dog wearing wellington boots, but it works, and it's clear how it works.
 

Posted Thu 19 Nov 20 @ 9:21 pm
for learning purposes...

How does one have find out if a value is between to points

ie if level is greater then 50% but less then 75% since level > 50% && level < 100% cannot be used because VDJ script does not use > < or =

would it be
 param_bigger 50% level && param_smaller 75% level


this only returns TRUE when level is less then 75%, and does NOT return false again when less then 50%

I am using the && because I want it to be TRUE (only) when BOTH are TRUE

What is correct way to find out if a value is between to points?




PS UPDATE:
If I interchange the order
 param_smaller 75% level && param_bigger 50% level


then it returns TRUE only when level larger then 50% and does NOT return FALSE when greater then 75%

It appears that only the last condition is being used for the logic, NOT when both are TRUE.

Do I need brackets of some sorts ?
 

Posted Sat 26 Dec 20 @ 7:51 am
AdionPRO InfinityCTOMember since 2006
Correct if you want to use it directly on an LED for example.
Usually you want to do something when it is true, in that case you can combine 2 if-then queries.
param_bigger 50% `level` ? param_smaller 75% `level` ? set 'myvar' 1 : set 'myvar' 0 : set 'myvar' 0

The first "set 'myvar' 1" would be executed when level is bigger than 50% and smaller than 75%.
The second "set 'myvar' 0" would be executed when level is bigger than 50% but not smaller than 75% (so practically bigger than 75%)
The third "set 'myvar' 0" would be executed when both are false, so level is smaller than 50%
 

Posted Sat 26 Dec 20 @ 8:04 am
Thank you very much Adion !!

When do I do I need the back ticks on parameter? in this case level is defined by VDJ as value of a volume fader.

Is it advised to use `level` in

param_greater 50% `level` 


since the code below also works without the back ticks
param_greater 50% level 


 

Posted Sat 26 Dec 20 @ 8:14 am
83%