快速登录:  

Forum: VirtualDJ Technical Support

话题: vdjscript how to combine holding ? and up ?

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

SveninoPRO InfinityMember since 2009
Want to program a Button that sets a (normal) loop when pressed briefly.
Same button shall set a (back) loop when pressed longer to save buttons on my Launchpad .
BUT: this back-loop should be set exactly when the button is released.
So I tried:
[ holding ? loop_back on & up ? loop 8 : nothing : loop_back off & loop 8]

what may be the mistake in the script?
Thanks again in advance
 

发表时间 Fri 16 Apr 21 @ 8:40 pm
holding 300ms ? loop_back on & loop 8 : loop_back off & loop 8

If I understod you correctly .. .can adjust the ms value to fit your need (or remove the ms value for default 500ms)
 

发表时间 Fri 16 Apr 21 @ 9:04 pm
SveninoPRO InfinityMember since 2009
sorry Rune, but that would be too easy.
With Your line the back-loop starts after 300 (or whatever) ms during I press the key.
I need that it starts exactly when I release the button.
So that I can set the point of loop exactly...
 

发表时间 Sat 17 Apr 21 @ 12:14 pm
True, but thats how your original example was, so thought you didnt mind that.. .

If you want something instant, "holding" probably is not the way to go... since you mean to have a long press to decide if the loop is forward and backwards, and that imply time to decide what to happen, and will not be instant (the loop direction cant change after loop has started)

Using "up" can not be combined with holding. Holding queries up on its own .. if up is after X ms.

Sometimes less is more, make it easy
A key combo will work fine for example

Button 1 : shift
Button 2 : shift ? loop_back on & loop 8 : loop_back off & loop 8
 

发表时间 Sat 17 Apr 21 @ 12:24 pm
NicotuxHome userMember since 2014
you can't combine key lookups (up down holding repeat) so have to emulate
loop_back off & up ? repeat_stop hld & loop 8 : repeat_start hld 500ms 1 & loop_back on
 

发表时间 Sat 17 Apr 21 @ 12:40 pm
SveninoPRO InfinityMember since 2009
Thank You both so much! You made my day!
And cause of this kinda "action on release" it was hard to set the loop during playback in time.
So I had to put a "loop_move -50ms" inside:

[ loop_back off & up ? repeat_stop hld & loop 4 & loop_move -50ms : repeat_start hld 400ms 1 & loop_back on]

And that leads me to the next question:
(sorry, hope not to bore you)

Is it possible to let vdj automaticly adjust the start of a loop on the nearest beatgrid point?
( I think I remember some such thread, but unfortunately I can't find it.)
 

发表时间 Sat 17 Apr 21 @ 6:36 pm
Svenino wrote :
Is it possible to let vdj automaticly adjust the start of a loop on the nearest beatgrid point?


Turn on quantize loop in the loop settings

 

发表时间 Sat 17 Apr 21 @ 6:44 pm
locoDogPRO InfinityModeratorMember since 2013
and also have quantize value at 1 beat
 

发表时间 Sat 17 Apr 21 @ 7:31 pm
SveninoPRO InfinityMember since 2009
Great! Thanks for the quick help.
And just for completeness: With the QUANTIZE option the "loop_move -...ms" isn´t needed any more.
 

发表时间 Sat 17 Apr 21 @ 8:47 pm


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