Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Variables as parameters to verbs
anbsoftPRO SubscriberMember since 2021
I saw in a VERY old thread that variables could not be used as arguments to verbs, but I am hoping that has since changed. Though I cannot for the life of me figure out how it works if it has.

I'd like to do something very simple: use an encoder knob to step a loop (loop_move) forward or backwards by the length of the loop length setting.
 

Posted Tue 03 May 22 @ 5:31 pm
locodogPRO InfinityModeratorMember since 2013
param_bigger 0 ? loop_move +100% : loop_move -100%

any thread more that a couple of years old that says "can't be done" is suspect, given changes with script. There are less and less places where script can't be worked in.
 

Posted Tue 03 May 22 @ 5:39 pm
anbsoftPRO SubscriberMember since 2021
Yes that's what I thought too. But I so far have not been able to figure out how to do it. Can anyone help?
 

Posted Mon 09 May 22 @ 5:19 pm
locodogPRO InfinityModeratorMember since 2013
what is there to figure out, the script is right there ^^^
 

Posted Mon 09 May 22 @ 5:36 pm
anbsoftPRO SubscriberMember since 2021
I think there's been a misunderstanding. What I want to do is something more like:

param_bigger 0 ? loop_move +get_loop : loop_move -get_loop

You see, I want the value held by get_loop to function as a parameter to loop_move, or goto (if I want to move through the song in jumps based on the selected loop length). I don't want to use a constant like "100%", I want to use a variable/setting.
 

Posted Wed 11 May 22 @ 7:15 pm
locodogPRO InfinityModeratorMember since 2013
did you try it?
 

Posted Wed 11 May 22 @ 7:17 pm
djdadPRO InfinityDevelopment ManagerMember since 2005
If you want to have the same encoder to work as goto -/+ and also move the loop in the amount of selected loop size, you can use ..
param_bigger 0 ? goto 'loopsize+' : goto 'loopsize-'


If this doesnt work. then perhaps it's not an encoder ? Which controller, which knob/encoder are you trying this ?
 

Posted Thu 12 May 22 @ 9:54 am
anbsoftPRO SubscriberMember since 2021
locodog wrote :
did you try it?


Yes, and it didn't work.
 

Posted Thu 12 May 22 @ 10:58 am
anbsoftPRO SubscriberMember since 2021
djdad wrote :
If you want to have the same encoder to work as goto -/+ and also move the loop in the amount of selected loop size, you can use ..
param_bigger 0 ? goto 'loopsize+' : goto 'loopsize-'


If this doesnt work. then perhaps it's not an encoder ? Which controller, which knob/encoder are you trying this ?


Thank you! I had not found "loopsize" in any of the documentation. Only things like "get_loop" and "loop". Where did you find that variable? Also, I never saw documentation indicating to place the sign after the variable, but within the back tick marks. The only thorough documentation I could find was the page with all the verbs. Do you have another source with these other bits of information?

Σας ευχαριστώ again from Saranda, Albania! It so happens I'll be in Thessaloniki next weekend.
 

Posted Thu 12 May 22 @ 11:09 am
anbsoftPRO SubscriberMember since 2021
Oof, I spoke a little too soon. This seems to work:

param_bigger 0 ? goto 'loopsize+' : goto 'loopsize-'


But this doesn't work:
param_bigger 0 ? loop_move 'loopsize+' : loop_move 'loopsize-'


Is there a reason it wouldn't work for loop_move? Is there another way to step the active loop's position by the loopsize?
 

Posted Thu 12 May 22 @ 11:17 am
djdadPRO InfinityDevelopment ManagerMember since 2005
The 'loopsize+' is implemented as parameter only for goto action, so wont work with loop_move.
But if the original request was to move the loop back/forth by its size (and only when loop is enabled), then the one locodog gave you, should also work.
 

Posted Thu 12 May 22 @ 11:23 am
anbsoftPRO SubscriberMember since 2021
I see. That makes sense. Where can I find documentation that explains things like how "loopsize" is a special parameter to goto?
 

Posted Thu 12 May 22 @ 8:00 pm