Quick Sign In:  

Forum: Wishes and new features

Topic: Wish for [query 1 ? Action1: nothing ] & [query 2 ? Action2 : nothing Script Construction
In http://www.virtualdj.com/forums/245265/General_Discussion/VDJ_script_construction_of_mulitple_queries.html

IIDEEJAYII wrote :
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?


Just a gentle Bump:

Once again this issue is hindering my VDJ scripting FUN, as I realized that my ONSONGLOAD script was not working because of this same issue, of wanting 6 different independent things to occur, (each, tested with queries), and wanting them NOT to be dependent on the one another.

Currently my ONSONGLOAD script has 3724 characters.. doable, and NOT working correctly.

To get all the 6 independent queries done would lengthen my script to a headache of approximately 2,681,000 characters, which I don't feel can be practically done. (don't know if there is script length limit, also)

So would love to BUMP the concept of allowing for the below type of script construction:

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

Posted Sun 20 Feb 22 @ 11:15 pm
This is a hack but it may inspire you

Create a new pad page, named something like "scripts", go to pad 1 and put in:
deck 1 play ? deck 1 stop : deck 1 play

Then go to pad 2 and put in:
deck 2 play ? deck 2 stop : deck 2 play

Select it as the current pad page

Then add this to a custom button:
pad 1 & pad 2

You now have independent queries that validates separately and trigger separately

This is of course just a test.
IRL you probably want to hide the pad page once it's done, so it don't interfere with your DJ'ing, and then call the pads/independent query scripts from ONINIT
Something like
pad_page "scripts" & pad 1 & pad 2 & pad_page "hotcues"
... if you want hotcues to be your regular starting padpage

... anyway... I'm sure you get the idea (which originally came from locodog -who else...)
 

Posted Sun 20 Feb 22 @ 11:59 pm
locoDogPRO InfinityModeratorMember since 2013
I've had 2MB scripts, actually performing isn't much of a problem, there's a slight delay on start loading in 2MB of text.

why not use a virtualfx or 6, or multibuttons? same principle as pad subroutines above.
I'll not deny your wish, I'd like it myself but I don't think it likely, it's not adding a verb or changing one, it would be a DEEP rewrite of the entire script engine.
 

Posted Mon 21 Feb 22 @ 12:12 am
Thank you Klaus and Locodog, for showing me that there are possible ways to accomplish this.

Let's explore them:

klausmogensen wrote :
pad_page "scripts" & pad 1 & pad 2 & pad_page "hotcues"

This one is straight forward, and can understand. Thanks Klaus and Locodog!
(and Klaus I would be adding the above line the the ONSONGLOAD, correct ?)



locodog wrote :
why not use a virtualfx or 6, or multibuttons? same principle as pad subroutines above.


------ Exploring the virtualfx -------
I do not fully understand how to implement this with your amazingly flexible and powerful virtualfx addon.
Would I just create the 6 differently named virtualfx effects and add script to the String OnStart of each virtualfx?

And the ONSONGLOAD would have:
virtualfx1 & virtualfx2 & virtualfx3 & virtualfx4 & virtualfx5 & virtualfx6.....

do the knobs and/or buttons need to be defined and called also?




------------ exploring the multibutton -------------
and don't know how to use multibutton. (which seems to be a skin button)

Does one create a skin, multibutton like:
<multibutton  "myButton1">
</multibutton>
<multibutton "myButton2">
</multibutton>

(don't see anything in the skin SDK)

And then in the ONSONGLOAD have the script :
multibutton_select "myButton1" "action1" & multibutton "myButton1"  & multibutton_select "myButton2" "action2" & multibutton "myButton2"  ....

where is the action for the multibutton defined? in the skin or in the ONSONGLOAD?

so much to explore !
 

Posted Mon 21 Feb 22 @ 4:13 am
locoDogPRO InfinityModeratorMember since 2013
virtualfx, probably easier to use the effect buttons, there's 3, up to 2kB of script per button. make as many as you need, just keep the names unique.

onsongload
effect_button myVirtualfx 1 & effect_button myVirtualfx 2 & effect_button myVirtualfx 3 & ...

multibuttons are a skin thing, really the skin just holds a script and it can be called with a easy short name, I'll get back to you on the implementation.
 

Posted Mon 21 Feb 22 @ 4:27 am
locoDogPRO InfinityModeratorMember since 2013
<multibutton id="1" >
<choice name="A_NAME" action="A SCRIPT"/>
</multibutton>
<multibutton id="2" >
<choice name="ANOTHER_NAME" action="ANOTHER SCRIPT"/>
</multibutton>
 

Posted Mon 21 Feb 22 @ 4:46 am
You the "Master" Locodog ! !

I got the virtualfx working .. and once again WOW ! .. think it will be my new favorite addon.. so much it can do OMG!

Once again thank you for everything!.. and for adding so much functionality to the already amazing VDJ.


--------
will continue to check out the multibuttons, looks interesting.

UPDATE: multibuttons not working yet,

I added the multibuttons to the skin in the topbar section (didn't want them to be left or right deck)
Where should one add the multibuttons in the skin?

And tried to use the activate the newly created multibuttons with a custom button script:
 multibutton "myButton1" &  multibutton "myButton2" &  multibutton "myButton3" 

Nothing happens.
what do I need to tweak?
 

Posted Mon 21 Feb 22 @ 5:05 am
locoDogPRO InfinityModeratorMember since 2013
I actually knocked it up in a couple of hours, taking a break from a different project. One of my most productive bits of procrastinating.
I might add a ONBUFFERCALL to have something that updates at latency rate.

I'd love to hand it over to atomix, [1 for the sake of mac users, 2 see what atomix do with it]
 

Posted Mon 21 Feb 22 @ 5:37 am
locoDogPRO InfinityModeratorMember since 2013
show me what you added to the skin
 

Posted Mon 21 Feb 22 @ 5:39 am
I added these multibuttons to the skin about line 1434 between the PC minimize and maximize buttons on the topbar

			<multibutton id="1" >
<choice name="myButton1" action="deck 2 pitch +0.5 bpm"/>
</multibutton>
<multibutton id="2" >
<choice name="myButton2" action="deck 1 pitch -5 bpm"/>
</multibutton>
<multibutton id="3" >
<choice name="myButton3" action="master_volume 30%"/>
</multibutton>

the actions just something to see the result of the scripts working. (not useful scripts)

with the corresponding custom button script:
 multibutton "myButton1" &  multibutton "myButton2" &  multibutton "myButton3" 

Nothing happens
 

Posted Mon 21 Feb 22 @ 5:46 am
locoDogPRO InfinityModeratorMember since 2013
multibutton "1" & multibutton "2" & multibutton "3"

try that instead, it's been a while since I used this method [was thinking about hardcoding routine into a skin so other pads could be used]
 

Posted Mon 21 Feb 22 @ 5:51 am
That was the tweak needed .. yay ... again thank you so much ..

You ROCK! !

-------------------
UPDATE: FYI

if I mod to <multibutton id="myButton1" > ... etc.

then the custom button:
multibutton "myButton1" & multibutton "myButton2" & multibutton "myButton3"
Works
 

Posted Mon 21 Feb 22 @ 5:57 am
locodog wrote :
I might add a ONBUFFERCALL to have something that updates at latency rate.


Was rereading, and to clarify, is that something I need to do when using virtualfx, or future plans for it's development?
 

Posted Mon 21 Feb 22 @ 6:31 am
locoDogPRO InfinityModeratorMember since 2013
future plans, I'll be adding it as one more effect_string so that new version remains backwards compatible
 

Posted Mon 21 Feb 22 @ 6:40 am
I also just realized that one could accomplish something similar, using custom buttons, since one is able to have any number of variations for a single button, and one can call variation 4 on button 1 with custom_button 1 4 containing your query script.

Though not as clean, and behind the scenes.
 

Posted Mon 21 Feb 22 @ 9:33 am