快速登录:  

Forum: VirtualDJ Technical Support

话题: Help with script

由于该帖子已年深日久,可能包含陈旧过时或描述错误的信息。

DG2718Home userMember since 2015
I want to put this in a button but not work:

Set 'A''`deck 1 level' & deck 2 level var 'A'

So the levels are the same in both decks
 

发表时间 Mon 17 Sep 18 @ 3:32 pm
First of all you should use a global variable instead of "per deck" ones as you do now.
Also you need to cast the variables to float in order to use properly
Finally, "get_level" works as a VU meter, so you need to use get_volume instead (with a catch: it also takes into account crossfader position)

So, try this:

set "$VolA" '`deck 1 get_volume & param_cast float`' & deck 2 get_var "$VolA" & param_cast float & deck 2 level
 

发表时间 Mon 17 Sep 18 @ 5:16 pm
DG2718Home userMember since 2015
Thanks It helped me write it correctly. Now what does not work for is this in a button:

repeat & param_equal 'deck 1 level' 'deck 2 level' ? repeat_stop: param_smaller 'deck 1 level' 'deck 2 level'? level +0,01 : level -0,01

1. Why if I stop pressing the button keeps repeating infinitely? The REPEAT verb works while you have pressed the button.

2. If the levels are the same the button should not do anything, but it stays repeating infinitely.



 

发表时间 Sun 23 Sep 18 @ 3:05 pm
repeat & param_equal 'deck 1 level' 'deck 2 level' ? repeat_stop: param_smaller 'deck 1 level' 'deck 2 level'? level +0,01 : level -0,01

This will always fail. Because you missed the backticks ( ` )
So:
repeat & param_equal '`deck 1 level`' '`deck 2 level`' ? repeat_stop : param_smaller 'deck 1 level' 'deck 2 level'? level +0,01 : level -0,01

Repeat stop what ? You haven't used any repeat_start or repeat_start_instant actions in order to stop them.
I assume that you actually don't want any action performed in this case, so:
repeat & param_equal '`deck 1 level`' '`deck 2 level`' ? nothing : param_smaller 'deck 1 level' 'deck 2 level' ? level +0,01 : level -0,01

Same error as above. No backticks. This means that VirtualDJ will compare the text strings themselves instead of parsing them into actions:
repeat & param_equal '`deck 1 level`' '`deck 2 level`' ? nothing : param_smaller '`deck 1 level`' '`deck 2 level`' ? level +0,01 : level -0,01


Finally: The repeat action will work properly ONLY when used on keyboard mapping, not on custom buttons. In that case (custom buttons) you'll need to convert your script to use repeat_start or repeat_start_instant actions
 

发表时间 Mon 24 Sep 18 @ 7:30 am
DG2718Home userMember since 2015
I tried this on a key like you said (keyboard mapping):

repeat & param_equal '`deck 1 level`' '`deck 2 level`' ? nothing : param_smaller '`deck 1 level`' '`deck 2 level`' ? level +0,01 : level -0,01

but keep repeating and never increase in level (level +0,01) is always false. Can you help me?
 

发表时间 Mon 24 Sep 18 @ 9:38 pm
megaalfPRO InfinityMember since 2010
PhantomDeejay perfect, that was the info i need: 'param_cast float'.
thanks.
 

发表时间 Thu 24 Oct 19 @ 12:40 am


(陈旧帖子或论坛版块会自动关闭)