Anmelden:     


Forum: General Discussion

Topic: Script School - Page: 51.8
3 looks like I was mistaken, you'll have to

( has_cue 1 !? set_cue 1 : has_cue 2 !? set_cue 2 : has_cue 3 !? set_cue 3 : .... ) & 
 

Thanks both of you for the help! I’m currently unable to try, but will be in a few days.

I was not aware of the ! Operator used in !? Can it be used in different contexts?

 

Yan Duval wrote :

I was not aware of the ! Operator used in !? Can it be used in different contexts?


Yes did I miss that somewhere, I have not seen that operator usage, what exactly does it do?
It looks like it's 'if the query is negative then do this action'
Is that a correct assumption.

 

Correct, basically it inverts the query and can be applied to almost any query

so say deck is paused, and you query

play !?
the replies to the query are like so
play !? deck is not playing : deck is playing


I used !? in the cue case above because it was neater to write that way.
The normal way would have been like this which isn't as clear
has_cue 1 ? has_cue 2 ? has_cue 3 ? set_cue 4 : set_cue 3 : set_cue 2 : set_cue 1
 

Example of the deepest you can go with ` " '


set result 0 & set a 1 & set b 2 & set c 4 & set d 8 & set e 16 & set f 32 & set g 64 & set h 128 & param_add `param_add "param_add 'get_var a' 'get_var b'" "param_add 'get_var c' 'get_var d'"` `param_add "param_add 'get_var e' 'get_var f'" "param_add 'get_var g' 'get_var h'"` & param_cast & set result & var_list


So the first bit is just setting some variables, no need to explain
then we say param_add and our param is a script action so we open a ` then our script action is param_add again and the param for that is a script action so we open a " then our script action is param_add again and it's params are also a script action so we open a '
this 3rd level of param_add, the ' is open the first param is get_var a, so then we close the ' , we're onto the 2nd param for the 3rd param_add so we open another ' get_var b the close the '
that completes the 1st param for the 2nd param add so we close the "
we're now onto the 2nd param of the 2nd param_add so we open another " and so on.

This is a pretty dumb example but this is as deep into script inception you can go.
And I have gone that deep in some cases.

One thing I dislike is spaces in fx names, the fx name needs to be wrapped in ' or " and that means I can go 3 levels deep with echo but I can't go as deep with "mt delay"
that's why all my fx I've created never contain a space, sometimes I use camelCase, sometimes I use under_score
that said it's a super rare case that I have to go that deep and I can work my way round it usually, but it would be nice if fx names were under_scored instead of containing spaces.
But script is a language, languages are never 100% consistent.
 

Is it possible to script a custom button to add a shortcut to the focused folder from the Folder List for quick access? It should work like the button in sideview: Leftclick = Add shortcut, Rightclick = Delete shortcut, Buttontext = Foldername?
Now i have the edit the custum button script ex. browser_shortcut 1 every time i want to change it.
 

browser_shortcut with no param and it will default to the next available number, deleting - since you're using the mouse already just right click the shortcut.
 

Thanks Locodog, but i want the button to act like a shortcut not only add a shortcut to the side toolbar.
Like this:
 

name buttons
`browser_shortcut NUM`
script buttons
browser_shortcut NUM

use the button with the first empty name for new shortcut
 

Thanks, it works great, but the button name doesnt work. I have tryed to copy your text
`browser_shortcut NUM`
, tryed to change ` to ', ´ and ". No name in the button after shortcut is created
 

you are using an actual number and not using the text NUM, right?
 

How stupid I am :-). Now it works exactly as I want it to be. Thanks!
 

DeejayHawkeye wrote :
...Now it works exactly as I want it to...


That is a testament to vdj, and tuned in users just making stuff for themselves, with a little help.
User: I want a thing, can I do the thing ?
Technician: sure do this.
User: result!

It's only those with a terminal lack of imagination that want it with no effort on their part.
"It just works" mentality also means "completely limited feature set"

I doubt even the devs considered this, but they made it possible, and it's a bloody good idea, I think I'll bake it into my house keeping skin because it will save me time.
 

Is it possible to create a loop statement in VDJScript like the for statement in C? Because OS2L is a UDP protocol, it often fails to be received by QLC+, so I would like to try to increase the success rate by sending OS2L commands multiple times.

I think this will be particularly effective when setting a CUE point for sending OS2L commands on the POI Editor timeline.
 

Well an rsi is no good as it would be One Second 2 Late (OS2L joke)

OS2L no because there is no "try until confirm" script as there is no confirm sent back over OS2l

I have a skin & virtualDevice mapping that sends MIDI out, it's on about 18 machines in the world, some using QLC+ [a couple it's on sc6000 hardware screens] and I've had no complaints.
I'm working with another guy currently to use a midi interface to talk to hardware too.

see my video here in this thread, it has been developed more since the video
https://www.virtualdj.com/forums/256348/General_Discussion/VDJ_together_with_QLC_.html

the skin makes placing apoi a 1 button job [so saves lots of preparation time]
the virtualDevice mapping uses a virtualmidi cable [tiny program with hardly any latency] to get
apoi > sets variable > variable in mapping send LED on > LED on in definition is translated to midi > virtualmidi cable sends midi to light show program.
It sounds complicated but really it's 'set and forget'

It's a few beers for it because it took a lot of time to make and it saves a LOT of time writing apoi.

Here's a look at it
https://www.virtualdj.com/user/locoDog/blogs/6224/midi_page_MIDI%2FOS2L.html

1024 poi per track, 256 unique midi notes [over a few midi channels] you can name
 

This time, instead of using a MIDI controller, we're using the POI editor to embed information about how to move the lights into the song.
If we can do this, there will be no need for a human to operate the lights once the song has started.

https://youtu.be/USL5z8P95dE
Only at 1:08 and 1:46, the DMX command set at the point on the POI editor timeline was successful and the lighting turned blue.

I set it to turn blue when a voice comes in during a song, but this only worked twice in this video. Because OS2L uses UDP, QLC+ seems to often drop the OS2L signal.

So, in the Macro Action description field in the attached capture, I want to rewrite it to a command such as repeating OS2L_Button "Blue" five times.

Does VDJScript have a syntax for repeating a command n times?
 

Like I said repeat_start_instant, but if it only "catches" on the 5th attempt that would be ~130ms too late.

Even if you stick with OS2L, my skin saves all the pain of typing out os2 poi.
 

 

Yes it does.
There's 2 things on show there,
First is sending midi out of vdj which goes to light show software
Second thing is writing action poi with one button press, they can send midi or they can send os2l instead, you can choose at run time.

To get midi out you will need the skin, and a mapping & definition file.
To just write os2l poi quickly, you just need the skin.
 

locoDog wrote :
param_cast is what you use to put a variable on the end of a verb

get_var $toto & param_cast & deck 2 filter


to set a variable to a script action value, the set verb allows script actions as a parameter when the action is wrapped in ` `

set $toto `deck 1 filter`


I thought I was in control but now, what if I want to replace the 3 below by $toto in order to select the slot?

deck right effect_select 3 +1
 

100%