Sign In:     


Forum: VirtualDJ Skins

Topic: Setting miliseconds using variable
I have a fadeout button as implemented below. I would like to be able to allow users to select a range of fadeout durations but cannot seem to figure out how to replace the 15ms in the code with a variable. Any help would be greatly appreciated. And any advice in general in how to use variables in actions (struggling a bit to understand the docuementation)
Thanks so much!

<button class="button_main" text="FADE" width="80" height="40" x="+33+30" y="+0" textsize = "20"
action="repeat_start levelSweep 15ms 101 & level -1% & level 0 ? repeat_stop levelSweep & stop & repeat_start WaitTimer 100ms 1 & level 100%">
<tooltip>FADE out song</tooltip>
</button>
 

Posted 24 hours ago
 

Hello Locodog,
Thank you for taking the time to reply, and for all of the other posts you have replied to, (I have found several of them very helpful for my project).

I will admit that I got a bit confused with the lines

set 'oneBeatMS' `param_multiply "get_bpm & param_1_x" 60000` & param_cast 'ms' & repeat_start 'stupidPlayPause' & play_pause & cycle 'SPP' 33 & var_equal 'SSP' 32 ? repeat_stop 'stupidPlayPause' & set 'SPP' 0 : nothing

It seems like the param_cast 'ms' is the key to success here?

Is the following close to correct?

1. set variable 'msWaitVar'
set 'msWaitVar' <SOME LOGIC TO SET VAIRABLE BASED ON USER INPUT>

2. implement action in button
action = "'msWaitVar' param_cast 'ms' & repeat_start levelSweep & level -1% & cycle 'SPP' 101 ? repeat_stop levelSweep & set 'SPP' 0: nothing
& repeat_start WaitTimer 100ms 1 & level 100%"
 

No the extra note [linked later post with verb improvements] was the important bit
the original casting time was an early days workaround, before time and count params could be script.

repeat_start name `get_var myTime` `get_var myRepeatCount` & ...