Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Noise Effect and change playing song
bobomrvaPRO SubscriberMember since 2017
"I'm trying to create a script that determines whether deck 1 or deck 2 is playing. Subsequently, a noise effect is triggered on both decks. On the playing deck, the parameters are set to make the noise effect inaudible, while on the non-playing deck, the noise effect is made audible. Next, the non-playing deck starts playing and the noise effect parameters are swapped. The deck that was initially playing is then turned off.

I've created the following script but it's not working correctly. It seems to get stuck in a loop, and I'm not sure why... Can you help?"


deck 1 masterdeck ? (deck 1 effect_slider 'noise' 1 50% && deck 1 effect_slider 'noise' 2 100% && deck 1 effect_active 'noise' 1 && deck 2 effect_slider 'noise' 1 100% && deck 2 effect_slider 'noise' 2 100% && deck 2 effect_active 'noise' 1 && deck 2 play && repeat_start 'wait1' 200ms & deck 1 effect_slider 'noise' 1 +2% & deck 2 effect_slider 'noise' 1 -2% & deck 1 effect_slider 'noise' 1 100% ? deck 1 effect_active 'noise' 0 & deck 2 effect_active 'noise' 0 & deck 1 stop & repeat_stop 'wait1') : deck 2 masterdeck ? (deck 2 effect_slider 'noise' 1 50% && deck 2 effect_slider 'noise' 2 100% && deck 2 effect_active 'noise' 1 && deck 1 effect_slider 'noise' 1 100% && deck 1 effect_slider 'noise' 2 100% && deck 1 effect_active 'noise' 1 && deck 1 play && repeat_start 'wait2' 200ms & deck 2 effect_slider 'noise' 1 +2% & deck 1 effect_slider 'noise' 1 -2% & deck 2 effect_slider 'noise' 1 100% ? deck 2 effect_active 'noise' 0 & deck 1 effect_active 'noise' 0 & deck 2 stop & repeat_stop 'wait2') : false
 

Posted 2 days ago @ 2:40 pm
locoDogPRO InfinityModeratorMember since 2013
Your script, both
effect_slider 'noise' 1 100% ? 

has a true reply but doesn't have a false reply, add a : before you close your brackets
 

Posted 2 days ago @ 3:03 pm
locoDogPRO InfinityModeratorMember since 2013
Since you're learning, look at this, same result tighter script.

set $otherDeck `get_activedeck & param_mod 2 & param_add 1 & param_cast int` & deck active effect_slider noise 1 50% & effect_slider noise 2 100% & effect_active noise 1 & set_deck `get_var $otherDeck` & effect_slider noise 1 100% & effect_slider noise 2 100% & effect_active noise 1 & play & set_deck `get_activedeck` & repeat_start wait1 0.25bt & effect_slider noise 1 +2% & set_deck `get_var $otherDeck` & effect_slider noise 1 -2% & set_deck `get_activedeck` & effect_slider noise 1 100% ? stop & repeat_stop wait1 & effect_active noise 0 & set_deck `get_var $otherDeck` & effect_active noise 0 : 
 

Posted 2 days ago @ 3:45 pm
bobomrvaPRO SubscriberMember since 2017
Thank you very much. Yes, I'm just learning vdj script.
If you have time, could you give me a little explanation of your script? Because I'm a little confused about it.

I'm a PLC programmer, but this programming language is a little confusing and I need to get used to it :D

Thank you again for your willingness.
 

Posted 2 days ago @ 6:24 pm
locoDogPRO InfinityModeratorMember since 2013
Sure here we go.

set $otherDeck `get_activedeck & param_mod 2 & param_add 1 & param_cast int` & deck active effect_slider noise 1 50% & effect_slider noise 2 100% & effect_active noise 1 & set_deck `get_var $otherDeck` & effect_slider noise 1 100% & effect_slider noise 2 100% & effect_active noise 1 & play & set_deck `get_activedeck` & repeat_start wait1 0.25bt & effect_slider noise 1 +2% & set_deck `get_var $otherDeck` & effect_slider noise 1 -2% & set_deck `get_activedeck` & effect_slider noise 1 100% ? stop & repeat_stop wait1 & effect_active noise 0 & set_deck `get_var $otherDeck` & effect_active noise 0 : 



So first thing we're going to be swapping the deck focus from the activedeck [aka the masterdeck] and the not master deck,
you did it by querying masterdeck and basically doubling the amount of script, but we can set the deck focus with the verb set_deck and it accepts script actions as a parameter,

so let's save the number of the other deck as a variable

set $otherDeck `get_activedeck & param_mod 2 & param_add 1 & param_cast int`


Let's say deck 1 is the activedeck, so 1 MOD 2 (will == 1 ) add 1, so var $otherDeck == 2
other case deck 2 is activedeck, 2 MOD 2 ( == 0 ) add 1, $otherDeck == 1

Every thing else you should get, just instead of using deck 1, deck 2, we are using set_deck and using `get_activedeck` or `get_var $otherDeck` as the parameter.
 

Posted 2 days ago @ 7:00 pm