Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Custom button script with blink control

This topic is old and might contain outdated or incorrect information.

alucasCUE userMember since 2008
I have written a script for a custom button that when clicked reduces the master volume to 25% and starts automix. When clicked again, it waits until the current song is finished then stops automix and restores master_volume to its previous level. Works as intended and here it is:

automix ? repeat_start "stopLoop" 1000ms & songpos_remain 1000ms ? repeat_stop "stopLoop" & automix & get_var "mvol" & param_cast & master_volume : nothing : playlist_load_and_keep & automix & master_volume & param_cast & set "mvol" & master_volume 25%

The first time the button is pressed it doesn't light up but does when it's pressed for the second time and then goes out when the song finishes. I thought it would be nice if the button lit up on the first press, started flashing on the second press then went out when the song finished and auto mix turned off. All attempts to get this behaviour putting in blink and off and on verbs in what I thought were the appropriate places have failed! I think I'm missing some fundamental rules about how button illumination is decided because in my experiments I discovered that a custom button with this action:

var_equal "blink" 0 ? set "blink" 1 & off : blink & set "blink" 0

starts blinking on the first click but never stops how ever many times it's clicked whereas just adding & nothing on the end like this:

var_equal "blink" 0 ? set "blink" 1 & off : blink & set "blink" 0 & nothing

works as I expected ie on first click it starts blinking and on the second click it stops.

Can someone explain what's going on and help to get my button blinking as I would like please? I'm using VDJ 8.4 b5403 on an iMac running MacOS 10.15.1


 

Posted Wed 11 Dec 19 @ 4:44 pm
locoDogPRO InfinityModeratorMember since 2013
var_equal "blink" 0 ? off & set "blink" 1 : blink & set "blink" 0

try that instead, lights evaluate constantly, so the way you had it before it got to "set "blink" 1" and the script read it and decided "well that isn't true, so go no further"

This isn't something I've read or been told just my best guess interpenetrating what I've tried.
 

Posted Wed 11 Dec 19 @ 5:04 pm
alucasCUE userMember since 2008
Thank you for your suggestion but that doesn't make any difference.
 

Posted Thu 12 Dec 19 @ 3:55 am
alucasCUE userMember since 2008
Can any VDJ script experts point me in the right direction please?
 

Posted Sat 14 Dec 19 @ 5:46 pm
alucasCUE userMember since 2008
I (finally) found a solution to this. The <button> element has a "query" attribute which can be used to return "on", "off" or "blink" to control the button illumination. For example:

query="play ? on : blink"

You can do similar with pads.

 

Posted Wed 20 May 20 @ 10:16 am


(Old topics and forums are automatically closed)