Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Script that allows me to hold and change effects parameters but not activate effect with the same button that activates the effect.
I'm trying to add to a script that will allow me to activate my effect upon one single press of the Stem Drums Button (which is mapped Stem_Drums = effect_active 1 "Loop Out") but also will allow me set my effect parameter by pressing and holding my Stem_Drums button and setting my effect knobs to the desired parameter without activating the effect.

I've tried different scripts using a combination of the "up?:, "holding?", "effect_slider", and the "effect_slider_active" operations and although I was able to get the effect slider to work, in every case when I release the button after a long press the effect is activated. I feel like I'm missing a piece of script that tells Virtual DJ to do nothing after releasing from a long press.

Is there a way to tell Virtual DJ that I want the Stem_Drums button to activate effect_active 1 "Loop Out" on a single short press and also tell Virtual DJ that if I press, hold, and release the button I don't want the effect to activate upon release and while I'm holding the button I can set the effect parameters?

Many thanks.
 

Posted Wed 11 Oct 23 @ 7:57 pm
holding ? reset stuff : effect_active 1
 

Posted Wed 11 Oct 23 @ 10:07 pm
PhantomDeejay wrote :
holding ? reset stuff : effect_active 1


Something is still missing but it seems like we're heading in the right direction with this script. The only thing missing is the ability to change the parameters of the effect while the button is being held down.
Also my plan is to apply the correct script to my Stem_Inst button as well which will be my effect_active 3. My effects parameter knob controls effect_active 1 regardless of what script I put it. So I'm testing scripts on effect_active 3 to be sure that I can change the effect parameter independently by pressing and holding the respectively button.
 

Posted Wed 11 Oct 23 @ 10:36 pm
The above script is a "two things" script:
holding ? this : that
1) holding ? this
This part of the scripts tells the software what to do if the button is pressed down for more than one second.

2) : that
This part tells the software what to do if you press the button down for less than one second.

So, it's just a matter of putting the correct actions on the correct place.
Since you want the button to activate the effect on "simple" press, the second part is pretty obvious.
Resetting parameters (1st part) is most likely the place you have issues with. It should be straightforward and working fine, but maybe you have another mistake on your script(s)

So, instead of going around the table, give us here the exact script you're trying to use to see if it has any more mistakes.
 

Posted Thu 12 Oct 23 @ 8:29 am
PhantomDeejay wrote :
...



This is the script that I'm using for my Stem_Inst button
Stem_Inst = holding ? effect_select 3 "loop roll" & effect_slider 3 : effect_active 3 "Loop roll"

If there are no errors in this script then my problem could lie in the default script of the FX_Level knob. The default script for the FX_Level knob is...

shift ? deck master effect_slider 2 & effect_slider 'sampler' 2 & deck all effect_slider 2 : deck master effect_slider 1 & effect_slider 'sampler' 1 & deck all effect_slider 1

The FX_Level knob is only affecting the effect_slider 1 of every deck. I want it to affect the effect slider of the corresponding buttons that I have effect_slider (1), (2), or (3) mapped to as long as I have the button held down. And when released from a long press I don't want the effect to be activated. Only from a short press do I want the effect activated.
 

Posted Thu 12 Oct 23 @ 9:05 pm
holding ? effect_select 3 "loop roll" & effect_slider 3 : effect_active 3 "Loop roll"
This script:
A) Selects "Loop Roll" effect on slot 3 if the button is pressed more than 1 second
B) Activates "Loop Roll" effect on slot 3 otherwise.
C) It does nothing to effect slider 3

The reason for C is simple:
You haven't told the script what to do with effect_slider 3

A typical fix would be to use/fix this would be to say effect_slider 3 1 50%
This script says put slider number 1 on effect slot number 3 to 50%

Remember, this is a button.
The code of your FX_Level knob does not use percentage values because they are implicit parameters of the knob. In other words, the knob itself has a percentage, and passes it to the script. But a button does not. That's why you need to set a value.

I would suggest you to open custom buttons editor, and try to play around with the effect actions, one at the time. Check the description/example text on the right side of the editor. It should become far more clear!
 

Posted Fri 13 Oct 23 @ 8:10 am
Unfortunately, the fix didn't revolve the problem. I'll keep experimenting until something works.
 

Posted Sat 14 Oct 23 @ 4:46 pm
Which fix ?
I haven't gave you a fix or a specific script to use. I just explained to you how it works.

Please let us know exactly what you want (e.g. values for the "reset" sliders) and then maybe we can give you a full "copy/paste friendly" script to use.
 

Posted Mon 16 Oct 23 @ 2:01 pm