Quick Sign In:  

Forum: VirtualDJ Skins

Topic: on/off condition of button - Page: 2

This topic is old and might contain outdated or incorrect information.

AdionPRO InfinityCTOMember since 2006
"a ? b : c" is just notation for "if a then b else c"
So my query is just saying "if language is 3 use the value of Discos.mp4 sample pad, else use the value of Disco.mp4 sample pad"

Using sampler_select +1 in a query does not make much sense.
sampler_bank 'SHADOW' would be on if the shadow sample bank is selected.
sampler_play would be on if the currently selected sample is playing.
Perhaps what you want is sampler_bank 'SHADOW' & sampler_play ?
This would be on if the selected sample is playing in the shadow sample bank, and off otherwise.

Also "... ? on : off" is not necessary in v8. It's not wrong, but it's like saying "if it's on, then it's on, otherwise it's off", so it doesn't really add much that vdj doesn't know already.
 

Posted Sat 29 Oct 16 @ 9:35 am
I understand now. Thank you for explaining.

With query="sampler_bank 'SHADOW' & sampler_play ? on : off", however, the button light stays on once pushed and doesn't go off when pushed again... So there must be something missing from your proposed phrase. Any idea what that could be?

Does "query" in VDJscript then simply mean "button light on"? So how would a correct syntax of a query without the on : off part be? With or without the interrogation mark?
 

Posted Sat 29 Oct 16 @ 11:36 am
This did the trick: query="sampler_bank 'SHADOW' ? sampler_play ? on : off : off"

I still would like to see an example of the query verb without the on : off part...
;)
 

Posted Sat 29 Oct 16 @ 12:09 pm
AdionPRO InfinityCTOMember since 2006
Looks like i missed something. A single "&" is used in actions to execute multiple actions. In queries, you should use "&&" which is a logical "and" (a && b means 'if both a and b')
Without "? on : off" it would thus look like "sampler_bank 'SHADOW' && sampler_play"

A query on a button or controller led is indeed just a simple yes/no question.
It depends on where the query is used what exactly it expects though. A query on a slider would expect a numeric value, and to show text in a skin it would expect text to be returned.
 

Posted Sat 29 Oct 16 @ 12:12 pm
Since my syntax also works, it seems there is sometimes more than one way of getting a button to do what you want... Your syntax is shorter though, and thus preferred.

LOL I meant to ask if the verb "query" (not the action of querying) was synonym to "button light on".

Thank you very much for your time and input, Adion!
 

Posted Sat 29 Oct 16 @ 12:22 pm
locoDogPRO InfinityModeratorMember since 2013
This thread is one example of why I love vdj/atomix, the support is amazing, once you start to script something bespoke and get stuck, staff are always ready to help.
 

Posted Sat 29 Oct 16 @ 11:28 pm
+1
 

Posted Sun 30 Oct 16 @ 10:11 am


(Old topics and forums are automatically closed)