Accesso rapido:  

Forum: General Discussion

Topic: Script School - Page: 6.85

Questa parte dell'argomento è obsoleta e potrebbe contenere informazioni obsolete o errate

Thank you. Sounds good to me. Its actually useless, but I really like seeing it. :)
 

Inviato Fri 20 Mar 20 @ 1:54 pm
All.

THanks to Locodog for pointing me here. I've done a bunch of reading but I'm not understanding the syntax

I'm trying to do something simple- One button to do an Echo at a certain % strength and length
I thought effect_active "echo 60%" would do it as I've tried to copy something I saw but that didn't work. Again not understanding the logic here

Help Please
RT
 

Inviato Wed 20 May 20 @ 11:05 pm
NicotuxHome userMember since 2014
effect and prameters can't be set the same time
echo : have 4 sliders : strench, length, lowpass, highpass
and 2 buttons : Mute source, trailing stop

set them individually :
strench:
effect_slider "echo" 1 60%
length : 3/4 beat
effect_slider "echo" 2 0.60
(its not user friendly, its effect internal) but it's a beat slider so
effect_beats "echo" 0.75
effect_beats "echo" 75%
will set 3/4 beat as well

hear source:
effect_button "echo" 1 off

... and activate effect
effect_active "echo" on

final command:
effect_slider "echo" 1 60% & effect_beats "echo" 0.75 & effect_button "echo" 1 off & effect_active "echo" on
 

Inviato Wed 20 May 20 @ 11:35 pm
Nicotux,

Thanks- will need to process this- quick quest which I still don't get- whats the "1" for- or the 2 as I've seen in other posts?

RT
 

Inviato Wed 20 May 20 @ 11:40 pm
NicotuxHome userMember since 2014
these are the index of the "button" or the slider "slider" as they appear in the gui
 

Inviato Wed 20 May 20 @ 11:42 pm
LIMOLPRO InfinityMember since 2003
without effect
effect_slider 1 0.60


with active effect and slider 1 0.60
effect_active 1 echo & effect_slider 1 0.60


full script
effect_active 1 echo & effect_slider 1 60% & effect_slider 2 0.75 & effect_slider 3 0.75 & effect_slider 4 0.75

effect_active 1 echo & effect_slider 1 60% & effect_slider 2 75% & effect_slider 3 75% & effect_slider 4 75%
 

Inviato Wed 20 May 20 @ 11:53 pm
NicotuxHome userMember since 2014
this one loads the effect in slot 1 and activates it after what it sets slider #1 of the default effect in the default slot to 60%
 

Inviato Thu 21 May 20 @ 12:02 am
Hi

I've never done any scripting before and tried something which I think should be quite simple.
Background: there is a bug in the FreeStyler8 plugin where it will send POI macros to FreeStyler whether the POI macro is triggered in the active deck playing out on the speakers or the other deck(s) not playing out to the speakers at that point in time. So for example if you are playing a song on the left deck with the crossfader moved to the left, any macro commands configured on the POIs of another song playing on any of the other decks will trigger and will be sent to FreeStyler - that does not happen on VDJ7 with the FreeStyler 7 plugin.

Now I want to change the current POI macro commands to only trigger the FreeStyler commands when the track is playing on the speakers (master output).

I'm trying to get the "active playing deck"...
I've tried all of the following, but the POI macro commands are always triggered, no matter if the deck is playing on the speakers or not:
masterdeck ? set $fsvalue 1 & set $fscommand 275 : nothing
deck master play ? set $fsvalue 1 & set $fscommand 275 : nothing
deck active ? set $fsvalue 1 & set $fscommand 275 : nothing


So I've created the following POI macro command script to ONLY trigger the FreeStyler commands if the crossfader is < 25% and the left deck(s) are playing and if the crossfader is > 75% and the right deck(s) are playing.

leftdeck ? param_bigger crossfader 25% ? set $fsvalue 1 & set $fscommand 275 : nothing : param_smaller crossfader 75% ? set $fsvalue 1 & set $fscommand 275 : nothing

Is there a simpler script to achieve the same? "deck playing on speakers" ? "send command to FreeStyler" : "do nothing"
 

Inviato Fri 22 May 20 @ 10:14 pm
locoDogPRO InfinityModeratorMember since 2013
this works here, so long as you keep masterdeck setting to the default auto
masterdeck ? set $fsvalue 1 & set $fscommand 275 : nothing
 

Inviato Fri 22 May 20 @ 10:45 pm
NicotuxHome userMember since 2014
to workaround the same issue (not freestyler plugin but unreleased artnet one) we used to use "is_audible ?"
 

Inviato Fri 22 May 20 @ 10:52 pm
locodog wrote :
this works here, so long as you keep masterdeck setting to the default auto
masterdeck ? set $fsvalue 1 & set $fscommand 275 : nothing


Hi locodog, I'm not sure what you mean by "keep masterdeck setting to the default auto". I've filtered for "master" on the settings page as well and cannot find "masterdeck" or anything similar.

I've just tried the script now again (not sure if my masterdeck setting is set to auto), but the FreeStyler command is fired regardless if the POI action of the "active" deck (crossfader moved to active deck) or "inactive" deck (crossfader moved away from deck) is triggered.

 

Inviato Sat 23 May 20 @ 8:19 am
Nicotux wrote :
to workaround the same issue (not freestyler plugin but unreleased artnet one) we used to use "is_audible ?"


Hi Nicotux. That was what I was looking for! Thank you.
 

Inviato Sat 23 May 20 @ 9:52 am
HermeiControlleristMember since 2013
Hi,

Absolute newbie to vdj and perhaps coding in general. But I hope it's not wasteful to ask how one would nest a few operations to reset a variable. was trying to write a macro in poi editor to change the video effect depending on how many times a cue was relooped (I've wrote it so that once it reaches the next cue it loops back to the previous cue 4 times). I can't seem to find the variable "looptest" in var_list. I'm guessing something is wrong in the use of param_cast 'frac'. I was using it with two parameters as used in param_add which worked for me. Any help is appreciated. thanks!

first cue (sequence-wise ; actually cue 16 toward the end of the song which I activate first):

set 'counter' 0 & var_list & goto_cue 1

second cue (I've made it cue 1):

set 'counter' `param_add "get_var 'counter'" 1`
& set 'looptest' `param_cast 'frac' `param_multiply `param_add "get_var 'counter'" 3` .25`` & var_equal 'looptest' 0 ? video_fx_select "shader" :
set 'looptest' `param_cast 'frac' `param_multiply `param_add "get_var 'counter'" 2` .25`` & var_equal 'looptest' 0 ? video_fx_select "cover" :
set 'looptest' `param_cast 'frac' `param_multiply `param_add "get_var 'counter'" 1` .25`` & var_equal 'looptest' 0 ? video_fx_select "camera" :
set 'looptest' `param_cast 'frac' `param_multiply `param_add "get_var 'counter'" 0` .25`` & var_equal 'looptest' 0 ? video_fx_select "slideshow"


third cue (actually cue 2):

var_equal 'counter' 4 ? set 'counter' `param_add "get_var 'counter'" 1` : goto_cue 1 & set 'counter' `param_add "get_var 'counter'" 1`
& set 'looptest' `param_cast 'frac' `param_multiply `param_add "get_var 'counter'" 3` .25`` & var_equal 'looptest' 0 ? video_fx_select "shader" :
set 'looptest' `param_cast 'frac' `param_multiply `param_add "get_var 'counter'" 2` .25`` & var_equal 'looptest' 0 ? video_fx_select "cover" :
set 'looptest' `param_cast 'frac' `param_multiply `param_add "get_var 'counter'" 1` .25`` & var_equal 'looptest' 0 ? video_fx_select "camera" :
set 'looptest' 'param_cast 'frac' `param_multiply `param_add "get_var 'counter'" 0` .25`` & var_equal 'looptest' 0 ? video_fx_select "slideshow" :
video_fx_select "slideshow"

 

Inviato Mon 15 Jun 20 @ 10:06 pm
NicotuxHome userMember since 2014
1) in one word: you can't
- you can't nest backquote operations
- you can't nest quoted strings
- you can't nest apostrophe strings
- quotes and apos are optional with ascii variable names
- float needs leading digit
- param_* operations don't need backquotting operations parameters

set 'looptest' `param_cast 'frac' `param_multiply `param_add "get_var 'counter'" 3` .25``
is wrong in multiple ways

in the opposite you can sequence operations:
param_add "get_var 'counter'" 3 & param_multiply 0.25 & param_cast 'frac' & set 'looptest'

or if you want to use operations in operations with no need of backquotes
param_multiply "param_add 'get_var counter' 3" 0.25 & param_cast 'frac' & set looptest

or if you really want to use backquotes
set looptest `param_multiply "param_add 'get_var counter' 3" 0.25 & param_cast 'frac'`

2) about test
var_equal 'looptest' 0 ? video_fx_select "slideshow" : video_fx_select "slideshow"
does nothing but video_fx_select "slideshow" in any case so that it can remove

var_equal 'looptest' 0 ? ...
shorten in
var looptest 0 ? ...

3) try to be more accurate
var_equal 'counter' 4 ? set 'counter' `param_add "get_var 'counter'" 1` : ...
if counter is equal to 4 add 1 to counter .... don't you know what the wil be ?
instead of interpreting backquote string to calculate a well known result
set counter 5
is faster

4) remember no intermediate variable can be more usable
instead of
set looptest `param_multiply "param_add 'get_var counter' 3" 0.25 & param_cast 'frac'` & var_equal 'looptest' 0 ?
use of
param_equal `param_multiply "param_add 'get_var counter' 3" 0.25 & param_cast 'frac'` 0 ? ....
is working as well without the need of a variable

https://www.virtualdj.com/wiki/VDJscript.html
 

Inviato Tue 16 Jun 20 @ 1:46 am
twagaPRO InfinityMember since 2009
I'm using numark mixtrack pro II.
I want to assign different VDJscripts to both sides of FX buttons.
Can I do it?
 

Inviato Fri 17 Jul 20 @ 3:15 pm
twagaPRO InfinityMember since 2009
 

Inviato Fri 17 Jul 20 @ 3:16 pm
twaga wrote :
I'm using numark mixtrack pro II.
I want to assign different VDJscripts to both sides of FX buttons.
Can I do it?


Yes! Just use
action_deck num
as a query. For example:
action_deck 1 ? play : pause

This will be a play button on deck one, and a pause button on all other decks.
 

Inviato Fri 17 Jul 20 @ 7:12 pm
twagaPRO InfinityMember since 2009
For example, I want to assign VDJscripts indicated in this attached file.
 

Inviato Sat 18 Jul 20 @ 2:52 pm
twagaPRO InfinityMember since 2009
 

Inviato Sat 18 Jul 20 @ 2:53 pm
twagaPRO InfinityMember since 2009
Whichever I push left or right FX1 button of mixtrack pro II(indicated in the above picture), FX1 is detected as Key.
How does VirtualDJ distinguish right from left of FX1 buttons?
 

Inviato Mon 20 Jul 20 @ 3:21 pm
15%