Accesso rapido:  

Forum: VirtualDJ Technical Support

Topic: How to make a Blinking LED take precedence over the OFF state?
seanPRO InfinityMember since 2018
Been trying to get my head around this for a couple hours and thought someone smarter than me will know the answer straight away.

I have a LED button which triggers an effect, and of course this causes the LED to turn on and off when triggered. However when the effect is off I would like the LED to flash if effect 2 is currently turned on.

The code I've come up with works I have a debug 'blink' which fires correctly (see below) but the blinking doesn't occur because I presume the OFF state is taking precedence.

How can I achieve this? I believe this code is close:

toggle 'effect_3_on' &
var_equal 'effect_3_on' 1 ?

effect_select 3 'Low Cut Echo' &
effect_slider 3 1 87% &
effect_slider 3 2 70% &
effect_slider 3 3 0% &
effect_slider 3 4 100% &
effect_button 3 1 on &
effect_button 3 2 on &
effect_active 3 'Low Cut Echo' on :

effect_active 3 'Low Cut Echo' off &
effect_slider 3 1 0% &
effect_button 3 1 off &
effect_button 3 2 off &
effect_active 3 'Low Cut Echo' on &
effect_active 3 'Low Cut Echo' off &
effect_active 2 ?
blink 100ms & debug 'blink'


Note: If you're reading this code and wondering why I turn the effect off, on and off again, this "clears" the echo out effect. Without it the echo out effect continues when you turn the effect back on if you didn't let it echo out to nothing.
 

Inviato Mon 06 May 24 @ 10:46 am
locoDogPRO InfinityModeratorMember since 2013
probably want to map the led instead of controlling it via the default

effect_active 3 ? on : effect_active 2 ? blink : off
 

Inviato Mon 06 May 24 @ 10:55 am
seanPRO InfinityMember since 2018
[Edit: disregard this post, I didn't understand your original response... another response below]

Hey loco, thanks for the help. I actually broke down the problem into something similar to your code example at one point, your example works.

But as soon as I add effect_active 3 'Low Cut Echo' on the blinking stops, for example, this works:

effect_active 3 ?
on &
effect_active 3 'Low Cut Echo' off :
effect_active 2 ?
blink :
off


But this doesn't:
effect_active 3 ?
on &
effect_active 3 'Low Cut Echo' off :
effect_active 3 'Low Cut Echo' on &
effect_active 2 ?
blink :
off


And I'm a bit lost as to why this happens. As I can put a debug in and see the blink logic gets triggered.
 

Inviato Mon 06 May 24 @ 11:44 am
seanPRO InfinityMember since 2018
Sorry I may have misunderstood your response "probably want to map the led" got ya, I'll look into this. I'm new to anything with LEDs so totally missed this was an option.
 

Inviato Mon 06 May 24 @ 11:51 am
locoDogPRO InfinityModeratorMember since 2013
yeah LED script, but as to your question though,

how can low cut echo on slot 3 be active as part of a negative reply to effect_active 3?

 

Inviato Mon 06 May 24 @ 11:53 am
locoDogPRO InfinityModeratorMember since 2013
try this maybe

toggle 'effect_3_on' &
var_equal 'effect_3_on' 1 ?

effect_select 3 'Low Cut Echo' &
effect_slider 3 1 87% &
effect_slider 3 2 70% &
effect_slider 3 3 0% &
effect_slider 3 4 100% &
effect_button 3 1 on &
effect_button 3 2 on &
effect_active 3 'Low Cut Echo' on :
( effect_active 2 ?
blink 100ms : ) &
effect_active 3 'Low Cut Echo' off &
effect_slider 3 1 0% &
effect_button 3 1 off &
effect_button 3 2 off &
effect_active 3 'Low Cut Echo' on &
effect_active 3 'Low Cut Echo' off
 

Inviato Mon 06 May 24 @ 11:57 am
seanPRO InfinityMember since 2018
Thanks a heap!!! Gave the brackets a go but didn't have any luck. But thankfully got it all working with your suggestion of mapping the LED.

Here it is for anyone else looking for an echo out on a button with an echo on the knob beside it. I found while DJing I would often forget to turn the knob down because the LED on the button wasn't lit, so this makes the button flash when the knob is up.

On the button LED thanks to loco's help put:
effect_active 3 ? on : effect_active 2 ? blink 100ms : off


On the button itself:
effect_active 3 ?
effect_active 3 'Low Cut Echo' off &
effect_slider 3 1 0% &
effect_button 3 1 off &
effect_button 3 2 off &
effect_active 3 'Low Cut Echo' on &
effect_active 3 'Low Cut Echo' off :

effect_select 3 'Low Cut Echo' &
effect_slider 3 1 87% &
effect_slider 3 2 70% &
effect_slider 3 3 0% &
effect_slider 3 4 100% &
effect_button 3 1 on &
effect_button 3 2 on &
effect_active 3 'Low Cut Echo' on


On the knob:
param_bigger 0 ?
effect_active 2 'Echo' on &
effect_slider 2 2 70% &
effect_slider 2 3 0% &
effect_slider 2 4 100% &
effect_button 2 1 off &
effect_button 2 2 off &
effect_slider 2 1 & :
effect_active 2 'Echo' off &
 

Inviato Mon 06 May 24 @ 12:09 pm