Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Set LED to blink based on crossfader position
What I want to do:
Left side LED to blink when crossfader value is smaller than 0.50.
Both side LED to blink when crossfader value is equal to 0.50.
Right side LED to blink when crossfader value is greater than 0.50.

Been trying to do this for the past hour and no matter what I do I can't figure it out, please help.

Note: LED is named LED_LOOP_HALF (Controller is: Numark Mixtrack Pro FX)
 

Posted Sun 30 Jul 23 @ 11:57 am
locoDogPRO InfinityModeratorMember since 2013
you mean LED_LOOP_HALF & LED_LOOP_DOUBLE ?

LED_LOOP_HALF
param_bigger 0.5 crossfader ? off : on

LED_LOOP_DOUBLE
param_smaller 0.5 crossfader ? off : on

or if you really mean left and right side of the device

device_side left ? param_bigger 0.5 crossfader ? off : on : param_smaller 0.5 crossfader ? off : on
 

Posted Sun 30 Jul 23 @ 12:27 pm
Oh, I actually am just using LED_LOOP_HALF, LED_LOOP_DOUBLE is being used for something else at the moment.

The third one works but only for the left side. Mind you, the way you coded it is reverse of what I'm looking for, I want the left side when it's smaller than 0.50 and the right side when it's greater than 0.50. Also I want both sides to be active when it's equal to 0.50.

I appreciate your support tremendously by the way! ^~^
 

Posted Sun 30 Jul 23 @ 12:32 pm
locoDogPRO InfinityModeratorMember since 2013
action_deck 1 ? param_bigger 0.5 crossfader ? off : blink : param_smaller 0.5 crossfader ? off : blink

try that instead
 

Posted Sun 30 Jul 23 @ 12:39 pm
Sorry, I work with 4 decks so I'll need the action_deck 1 to work for deck 1 and deck 3 and action_deck 2 to work for deck 2 and 4.
 

Posted Sun 30 Jul 23 @ 1:23 pm
locoDogPRO InfinityModeratorMember since 2013
then
device_side 'left' ? param_bigger 0.5 crossfader ? off : blink : param_smaller 0.5 crossfader ? off : blink

or
param_equal `param_add 'action_deck 1' 'action_deck 3'` 0 !? param_bigger 0.5 crossfader ? off : on : param_smaller 0.5 crossfader ? off : on
 

Posted Sun 30 Jul 23 @ 1:46 pm
That code works, but could you also add a parameter for the led to blink both sides when the crossfader is at 0.50 exactly? I would really appreciate that! ^~^
 

Posted Sun 30 Jul 23 @ 3:39 pm
locoDogPRO InfinityModeratorMember since 2013
It should already, follow the logic

is left ? yes, is crossfader bigger than 0.5 ? : no so blink [this includes crossfader is 0.5] : no so right, same thing but smaller comparison.
 

Posted Sun 30 Jul 23 @ 3:51 pm
Oh, well I inputted it and sadly, if the crossfader is equal to 0.5 (centered) only the right side will blink. : /

(This would be so much easier if I could just put "ifCrossfader_value < 0.5 blink 1bar left_side, ifCrossfader_value = 0.5 blink 1bar left_side & blink 1bar right_side, ifCrossfader_value > 0.5 blink 1bar right_side")

Once again, I really appreciate you helping me with this issue, VDJScript is so confusing to me.
 

Posted Sun 30 Jul 23 @ 3:55 pm
locoDogPRO InfinityModeratorMember since 2013
so change the 0.5s
0.5 + a bit & 0.5 - a bit
 

Posted Sun 30 Jul 23 @ 4:03 pm
Okay, I tried to use:

device_side 'left' ? param_bigger 0.5 crossfader ? off : blink : all_decks ? param_equal 0.5 crossfader ? off : blink : param_smaller 0.5 crossfader ? off : blink

But it will only blink the right side when the crossfader is in the center (at 0.5). I'm so confused. : /

Is there a different command I should use instead of "all_decks"?
 

Posted Sun 30 Jul 23 @ 4:16 pm
Never mind, I got it. I was confused as to what you meant by add a bit, and subtract a bit.

device_side 'left' ? param_bigger 0.51 crossfader ? off : blink : param_smaller 0.49 crossfader ? off : blink

This works perfectly! Thank you so much for helping me! ^~^
 

Posted Sun 30 Jul 23 @ 4:18 pm