Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: How to transform the value of a variable to milliseconds with param_cast?
Hello, I made a script to perform crossfade while a song is playing. I need to change a variable of type integer with decimals to a type "ms". When I use the param_cast command, this variable returns 0.000 (BPMC in this case), since for the auto_crossfade command to work, the value of the variable must be in type "ms". I will leave the script I made, I hope you help me.
select &
load &
set_gain 0 &
goto_cue 2 &
goto -16 &
play &
sync &
select &
set 'BPM0' '`get_bpm' &
set 'BPM1' '`param_pow -1 "get_var BPM0"' &
set 'BPM2' '`param_multiply 960000 "get_var BPM1"' &
set 'BPMC' '`get_var BPM2 & param_cast ms' &
auto_crossfade 'BPMC' &
select &
 

geposted Wed 16 Mar 22 @ 12:51 pm
AdionPRO InfinityCTOMember since 2006
auto_crossfade accepts beats as well, so you can use "auto_crossfade 1bt" directly
 

geposted Wed 16 Mar 22 @ 1:01 pm
OK, i will try
 

geposted Wed 16 Mar 22 @ 1:06 pm
locoDogPRO InfinityModeratorMember since 2013
set 'avar' 5000 & get_var 'avar' & param_cast 'ms' & auto_crossfade

that works as a reference to figure where you went wrong.
 

geposted Wed 16 Mar 22 @ 1:12 pm
No funcionaba el auto_crossfade bt porque estaba usando la version 2018 pero ya la actualice a la version 2020
 

geposted Tue 22 Mar 22 @ 12:04 pm
locoDogPRO InfinityModeratorMember since 2013
it's always assumed that you are up to date, when giving script advice.
With script updates the WHEN [build number] is soon forgotten, because people up to date with script are very likely to be running the most recent of builds.
 

geposted Tue 22 Mar 22 @ 12:24 pm