Accesso rapido:  

Forum: General Discussion

Topic: VDJ script construction of mulitple queries
I am sure this must have been discussed previously.. yet cannot find:

How to construct a series of queries with "&"s

For learning purposes only, want a script to do up to 4 possible different things, independently.. depending on if each hot_cue exists.

One cannot write:
 hot_cue 1 ?  Action1 : nothing & hot_cue 2 ? Action2 : nothing  & hot_cue 3 ? Action3 : nothing & hot_cue 4 ? Action 4 : nothing


since VDJ scripting, includes everything after the first ":" as NOT hot_cue 1

I would like the logic of:

[hot_cue 1 ? Action1: nothing ] & [hot_cue 2 ? Action2 : nothing ] & [hot_cue 3 ? Action3 : nothing] & [hot_cue 4 ? Action 4 : nothing]

how can this type of script be written?
 

Inviato Tue 08 Feb 22 @ 10:10 am
locoDogPRO InfinityModeratorMember since 2013
hot_cue 1 ? 
Action1 & hot_cue 2 ?
Action2 & hot_cue 3 ?
Action3 :
:
hot_cue 3 ?
Action3 :
:
hot_cue 2 ?
Action2 & hot_cue 3 ?
Action3 :
:
hot_cue 3 ?
Action3
:
 

Inviato Tue 08 Feb 22 @ 11:15 am
thank you Locodog..

Could you add to your post the 4th hotcue..

--------------------------
does this require the (N!+1) decisions to be addressed when there are N hotcues? (when N > 1)

1 hotcue...... requires 1 ?
2 hotcues.....requires 3 ?
3 hotcues.....requires 7 ?
4 hotcues.....requires 25 ?
5 hotcues.... requires 121 ?
.
.
8 hotcues.... requires 40,321 ?
.
.
32 hotcues...requires approx 263,130,836,000,000,000,000,000,000,000,000,001 ?



if so .. is there any way to do that without a huge headache .. I think I have one already .. haha

(an automated way to create the logic tree)

Note: stringing 32 decisions together with &s would be long but feasible.. but if it is 2.6 x 10^35 decisions it is NOT feasible I believe. (don't even know what the limit is for script length, is there one?)




---------------------
PS
No need to post for 4 hotcues if it requires, the possibly expected 25 decisions "?" ... unless there is some easy way to create this logic tree for many hotcues.
 

Inviato Tue 08 Feb 22 @ 12:55 pm
locoDogPRO InfinityModeratorMember since 2013
correct, you've got a logic tree and it grows by n!

if it needn't be instant you could use a rsi like a for loop, but that's 25ish ms per loop.

I know another hacky way that in some cases is unsafe, but if it's your 60 hotcues thing we talked about it might be ok, it depends on what that actions you'll be using are.

I have requested a zero time rsi, for these kind of working a list jobs, but maybe it's too niche or maybe too easy to misunderstand the purpose and be misused.

perhaps a virtualfx could do it, give me a 2 cue example of what you're doing.
 

Inviato Tue 08 Feb 22 @ 1:45 pm
locoDogPRO InfinityModeratorMember since 2013
tested something small scale, seems virtualfx can do for loops without issue.
It all depends on what your desired actions are, if it will be suitable.

my test was something like this on virtualfx button 1, cycles var if hotcue #myvar exists ? cycle count var & button presses itself again : press itself again

cycle myvar 60 & var myvar 0 ? : get_var myvar & param_cast 'integer' & has_cue & param_equal 1 ? cycle count 60 & effect_button virtualfx 1 : effect_button virtualfx 1
 

Inviato Tue 08 Feb 22 @ 2:19 pm
locoDogPRO InfinityModeratorMember since 2013
Virtualfx, I hope you're familiar with the process, I named it
cueQueryLoop

so name the .dll that
this is the .ini [of course name the .ini too]

[autoparams]
Slider DIAL A 0=0
String DIAL A 1=
String LABEL A 3=
Slider DIAL B 2=2048
String DIAL B 5=
String LABEL B 6=
Slider DIAL C 4=2048
String DIAL C 7=
String LABEL C 12=
Switch BUTTON 1 8=1
String BUTTON 1 13=cycle cueNum 65 & var cueNum 0 ? : get_var cueNum & param_cast 'integer' & has_cue & param_equal 1 ? set cueQueryString `param_add "get_text 'H'" "get_loaded_song 'comment'"` & get_var cueQueryString & param_cast & loaded_song 'comment' & set cueQueryString `param_add "get_var cueNum & param_cast 'integer'" "get_loaded_song 'comment'"` & get_var cueQueryString & param_cast & loaded_song 'comment' & set cueQueryString `param_add "get_text ' '" "get_loaded_song 'comment'"` & get_var cueQueryString & param_cast & loaded_song 'comment' & effect_button cueQueryLoop 1 on : effect_button cueQueryLoop 1 on
Switch BUTTON 2 9=1
String BUTTON 2 14=set cueNum 0 & loaded_song 'comment' "" & effect_button cueQueryLoop 1
Switch BUTTON 3 10=0
String BUTTON 3 15=
String OnStart 16=
String OnStop 17=


call it with this script
effect_button cueQueryLoop 2
upto 64 cues, uses space as delimiter, pretty technical problem.
 

Inviato Tue 08 Feb 22 @ 3:48 pm
OMG Locodog.. I am speechless ... that works so incredibly fast and well.. and is the answer to my many days of pondering..

I have it working .. and hope to understand how it does, what it does.. soon,
and amazed by the power and flexibility of your VirtualFX addon..


Cannot thank you enough. Simply Amazing !





---------------------------
PS
Warning ! ! Don't attempt to even think about doing this with the method initially discussed, it would take a minimum of 1.3 X 10^89 decisions with VDJ scripting ! !Warning ! !
 

Inviato Tue 08 Feb 22 @ 5:14 pm
locoDogPRO InfinityModeratorMember since 2013
1.3 X 10^89 wow, not bad to say this way takes <700 bytes
 

Inviato Tue 08 Feb 22 @ 9:20 pm
locoDogPRO InfinityModeratorMember since 2013
minor tweak for BUILD 6839 [should make no difference to end user]

[autoparams]
Slider DIAL A 0=0
String DIAL A 1=
String LABEL A 3=
Slider DIAL B 2=2048
String DIAL B 5=
String LABEL B 6=
Slider DIAL C 4=2048
String DIAL C 7=
String LABEL C 12=
Switch BUTTON 1 8=1
String BUTTON 1 13=cycle cueNum 65 & var cueNum 0 ? : get_var cueNum & param_cast 'integer' & has_cue & param_equal 1 ? set cueQueryString `param_add "get_text 'H'" "get_loaded_song 'comment'"` & set cueQueryString `param_add "get_var cueNum & param_cast 'integer'" "get_var cueQueryString"` & set cueQueryString `param_add "get_text ' '" "get_var cueQueryString"` & loaded_song 'comment' `get_var cueQueryString` & effect_button cueQueryLoop 1 on : effect_button cueQueryLoop 1 on
Switch BUTTON 2 9=1
String BUTTON 2 14=set cueNum 0 & loaded_song 'comment' "" & effect_button cueQueryLoop 1
Switch BUTTON 3 10=0
String BUTTON 3 15=
String OnStart 16=
String OnStop 17=
 

Inviato Sun 13 Feb 22 @ 1:10 pm
Thank you Locodog..

again this works so amazingly well ..

I updated the ini file as you suggested. (and as you say, it was also working with the 6839 build, before your tweak)

Again big thanks :)



-----------------------------
What is the way to add a comment within the "ini" file ?
I wanted to add a comment with date and VDJ build #.
 

Inviato Sun 13 Feb 22 @ 3:29 pm
locoDogPRO InfinityModeratorMember since 2013
never tried working outside how ini's default, but you could always use a unused string to hold your own meta data.
 

Inviato Sun 13 Feb 22 @ 4:00 pm