快速登录:  

Forum: VirtualDJ Plugins

话题: VDJ script tools - Page: 1

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

The first part of this is an online VDJ script formatter.

It handles normal non-formatted script, indented multi-line script, and BB Code formatted script. You can paste in any of these formats and convert between them. This can make script easier to read and deal with. When using the page, the script is automatically copied to the clipboard so you can paste that format script into a local text editor. When you are done editing, you can paste that back into to online formatter and convert it to non-formatted so it will execute in VDJ.

Here is an example:

normal non-formatted script

loop 2 & down ? blink 300ms & repeat_start "rsAHL" 33ms & loop 2 ? loop_position & param_bigger 90% ? set "top" 1 : var "top" 1 ? loop 1 & set "top" 0 : nothing : loop 1 ? loop_position & param_bigger 90% ? set "top" 1 : var "top" 1 ? loop 0.5 & set "top" 0 : nothing : nothing : loop 0 & repeat_stop "rsAHL"

same script formatted as BB Code

loop 2 & down 
..? blink 300ms & repeat_start "rsAHL" 33ms & loop 2
....? loop_position & param_bigger 90%
......? set "top" 1
......: var "top" 1
........? loop 1 & set "top" 0
........: nothing
....: loop 1
......? loop_position & param_bigger 90%
........? set "top" 1
........: var "top" 1
..........? loop 0.5 & set "top" 0
..........: nothing
......: nothing
..: loop 0 & repeat_stop "rsAHL"


same script formatted as BB Code with line breaks after '&'

loop 2 & 
down
..? blink 300ms &
....repeat_start "rsAHL" 33ms &
....loop 2
....? loop_position &
......param_bigger 90%
......? set "top" 1
......: var "top" 1
........? loop 1 &
..........set "top" 0
........: nothing
....: loop 1
......? loop_position &
........param_bigger 90%
........? set "top" 1
........: var "top" 1
..........? loop 0.5 &
............set "top" 0
..........: nothing
......: nothing
..: loop 0 &
....repeat_stop "rsAHL"


Line breaks after '&' are useful when the lines become long in order to see better what is actually used. It can also prevent wrapping of BB Code since there is no real control over that. The formatting website does have control over the wrapping though and you can view it there without wrapping and color coded.

VDJ keywords are colored blue. If a keyword is expected and not recognized it will be colored red and may be an indication that you have misspelled it. Here I misspelled repeat_stop as repet_stop.

var 'double' 
..? set 'double' 0 & repet_stop 'myrep' & device_side 'left'
....? deck left clone_deck right
....: deck right clone_deck left
..: set 'double' 1 & repeat_start 'myrep' 400ms 1 & load & set 'double' 0


I have tested it in Firefox, Chrome, Internet Explorer, and Opera, so far.

The link to the online formatter is here:

http://www.tellyvisuals.com/vdjscript.php

The second part of this may be a script tracer and debugger plugin. I have done a feasibility test for it and so far so good but I expect there to be some problems. Hell there are always problems :) It is pretty fun to watch a computer executing actual lines of code. Sort of like watching it think. More than that though, a tool for debugging script.

The completion of the debug tool depends on time and what problems will arise. This is a sample output of a first pass though. Eventually it should show variables used and the current values of those as well and more.
 

发表时间 Tue 17 Jul 18 @ 7:39 pm
locoDogPRO InfinityModeratorMember since 2013
I'll treat her rough, I know I can think of a few ways to test this [really test]
Just for poops & giggles try run a script found on autoFilters or AutoVXF pad pages.
 

发表时间 Tue 17 Jul 18 @ 8:48 pm
Assume you mean tracer? For that I have only tested initial feasibility. Don't know what the long run will be yet. Would be more convenient to post a sample or a link to a sample. I get tired of hunting things down since I have to do it a lot.
 

发表时间 Tue 17 Jul 18 @ 8:56 pm
locoDogPRO InfinityModeratorMember since 2013
nothing & action_deck 1 ? deck master set '$v3' 1 & effect_button "Builder" 9 & get_text "deck master repeat_start_instant 'deckMaster`deck 1 pad 3`' `get_var '8beat'`ms `get_var '@$vCycles'` & set '$v3Count' 0 & deck master repeat_start_instant 'rsivxf3' `get_var '1/8th'`ms 64 & set '$v3' 1 & cycle '$v3Count' 64 & var '$v3Count' 0 ? video_crossfader 0.5 & set '$v3' 0 : set '$v3' 1 & var_smaller '$v3Count' 5 ? video_crossfader -12.5% : var_smaller '$v3Count' 13 ? video_crossfader +12.5% : var_smaller '$v3Count' 21 ? video_crossfader -12.5% : var_smaller '$v3Count' 29 ? video_crossfader +12.5% : var_smaller '$v3Count' 37 ? video_crossfader -12.5% : var_smaller '$v3Count' 45 ? video_crossfader +12.5% : var_smaller '$v3Count' 53 ? video_crossfader -12.5% : var_smaller '$v3Count' 61 ? video_crossfader +12.5% : video_crossfader -12.5%" & param_cast "text" & effect_string "Builder" 3 & effect_active "Builder" on & deck master set "string3" 1 : action_deck 2 ? deck master set '$v3' 1 & effect_button "Builder" 9 & get_text "deck master repeat_start_instant 'deckMaster`deck 2 pad 3`' `get_var '8beat'`ms `get_var '@$vCycles'` & set '$v3Count' 0 & deck master repeat_start_instant 'rsivxf3' `get_var '1/8th'`ms 64 & set '$v3' 1 & cycle '$v3Count' 64 & var '$v3Count' 0 ? video_crossfader 0.5 & set '$v3' 0 : set '$v3' 1 & var_smaller '$v3Count' 5 ? video_crossfader -12.5% : var_smaller '$v3Count' 13 ? video_crossfader +12.5% : var_smaller '$v3Count' 21 ? video_crossfader -12.5% : var_smaller '$v3Count' 29 ? video_crossfader +12.5% : var_smaller '$v3Count' 37 ? video_crossfader -12.5% : var_smaller '$v3Count' 45 ? video_crossfader +12.5% : var_smaller '$v3Count' 53 ? video_crossfader -12.5% : var_smaller '$v3Count' 61 ? video_crossfader +12.5% : video_crossfader -12.5%" & param_cast "text" & effect_string "Builder" 3 & effect_active "Builder" on & deck master set "string3" 1 : action_deck 3 ? deck master set '$v3' 1 & effect_button "Builder" 9 & get_text "deck master repeat_start_instant 'deckMaster`deck 3 pad 3`' `get_var '8beat'`ms `get_var '@$vCycles'` & set '$v3Count' 0 & deck master repeat_start_instant 'rsivxf3' `get_var '1/8th'`ms 64 & set '$v3' 1 & cycle '$v3Count' 64 & var '$v3Count' 0 ? video_crossfader 0.5 & set '$v3' 0 : set '$v3' 1 & var_smaller '$v3Count' 5 ? video_crossfader -12.5% : var_smaller '$v3Count' 13 ? video_crossfader +12.5% : var_smaller '$v3Count' 21 ? video_crossfader -12.5% : var_smaller '$v3Count' 29 ? video_crossfader +12.5% : var_smaller '$v3Count' 37 ? video_crossfader -12.5% : var_smaller '$v3Count' 45 ? video_crossfader +12.5% : var_smaller '$v3Count' 53 ? video_crossfader -12.5% : var_smaller '$v3Count' 61 ? video_crossfader +12.5% : video_crossfader -12.5%" & param_cast "text" & effect_string "Builder" 3 & effect_active "Builder" on & deck master set "string3" 1 : action_deck 4 ? deck master set '$v3' 1 & effect_button "Builder" 9 & get_text "deck master repeat_start_instant 'deckMaster`deck 4 pad 3`' `get_var '8beat'`ms `get_var '@$vCycles'` & set '$v3Count' 0 & deck master repeat_start_instant 'rsivxf3' `get_var '1/8th'`ms 64 & set '$v3' 1 & cycle '$v3Count' 64 & var '$v3Count' 0 ? video_crossfader 0.5 & set '$v3' 0 : set '$v3' 1 & var_smaller '$v3Count' 5 ? video_crossfader -12.5% : var_smaller '$v3Count' 13 ? video_crossfader +12.5% : var_smaller '$v3Count' 21 ? video_crossfader -12.5% : var_smaller '$v3Count' 29 ? video_crossfader +12.5% : var_smaller '$v3Count' 37 ? video_crossfader -12.5% : var_smaller '$v3Count' 45 ? video_crossfader +12.5% : var_smaller '$v3Count' 53 ? video_crossfader -12.5% : var_smaller '$v3Count' 61 ? video_crossfader +12.5% : video_crossfader -12.5%" & param_cast "text" & effect_string "Builder" 3 & effect_active "Builder" on & deck master set "string3" 1 : nothing
 

发表时间 Tue 17 Jul 18 @ 8:58 pm
locoDogPRO InfinityModeratorMember since 2013
get_text will parse verbs in back ticks, this got_text is then sent as an effect_string and acted on by builder plugin, builder has nothing under the hood, no send command or anything, it just acts on the text it has been sent.
I don't expect support, it'd be nice but... it's my baby I'll look after it.
 

发表时间 Tue 17 Jul 18 @ 9:09 pm
Currently it skips '&' when within quoted strings. A quick change produced this. Still will wrap with BB Code though if the lines get too long.

nothing &
action_deck 1
..? deck master set '$v3' 1 &
....effect_button "Builder" 9 &
....get_text "deck master repeat_start_instant 'deckMaster`deck 1 pad 3`' `get_var '8beat'`ms `get_var '@$vCycles'` &
....set '$v3Count' 0 &
....deck master repeat_start_instant 'rsivxf3' `get_var '1/8th'`ms 64 &
....set '$v3' 1 &
....cycle '$v3Count' 64 &
....var '$v3Count' 0
....? video_crossfader 0.5 &
......set '$v3' 0
....: set '$v3' 1 &
......var_smaller '$v3Count' 5
......? video_crossfader -12.5%
......: var_smaller '$v3Count' 13
........? video_crossfader +12.5%
........: var_smaller '$v3Count' 21
..........? video_crossfader -12.5%
..........: var_smaller '$v3Count' 29
............? video_crossfader +12.5%
............: var_smaller '$v3Count' 37
..............? video_crossfader -12.5%
..............: var_smaller '$v3Count' 45
................? video_crossfader +12.5%
................: var_smaller '$v3Count' 53
..................? video_crossfader -12.5%
..................: var_smaller '$v3Count' 61
....................? video_crossfader +12.5%
....................: video_crossfader -12.5%" &
......................param_cast "text" &
......................effect_string "Builder" 3 &
......................effect_active "Builder" on &
......................deck master set "string3" 1
..: action_deck 2
....? deck master set '$v3' 1 &
......effect_button "Builder" 9 &
......get_text "deck master repeat_start_instant 'deckMaster`deck 2 pad 3`' `get_var '8beat'`ms `get_var '@$vCycles'` &
......set '$v3Count' 0 &
......deck master repeat_start_instant 'rsivxf3' `get_var '1/8th'`ms 64 &
......set '$v3' 1 &
......cycle '$v3Count' 64 &
......var '$v3Count' 0
......? video_crossfader 0.5 &
........set '$v3' 0
......: set '$v3' 1 &
........var_smaller '$v3Count' 5
........? video_crossfader -12.5%
........: var_smaller '$v3Count' 13
..........? video_crossfader +12.5%
..........: var_smaller '$v3Count' 21
............? video_crossfader -12.5%
............: var_smaller '$v3Count' 29
..............? video_crossfader +12.5%
..............: var_smaller '$v3Count' 37
................? video_crossfader -12.5%
................: var_smaller '$v3Count' 45
..................? video_crossfader +12.5%
..................: var_smaller '$v3Count' 53
....................? video_crossfader -12.5%
....................: var_smaller '$v3Count' 61
......................? video_crossfader +12.5%
......................: video_crossfader -12.5%" &
........................param_cast "text" &
........................effect_string "Builder" 3 &
........................effect_active "Builder" on &
........................deck master set "string3" 1
....: action_deck 3
......? deck master set '$v3' 1 &
........effect_button "Builder" 9 &
........get_text "deck master repeat_start_instant 'deckMaster`deck 3 pad 3`' `get_var '8beat'`ms `get_var '@$vCycles'` &
........set '$v3Count' 0 &
........deck master repeat_start_instant 'rsivxf3' `get_var '1/8th'`ms 64 &
........set '$v3' 1 &
........cycle '$v3Count' 64 &
........var '$v3Count' 0
........? video_crossfader 0.5 &
..........set '$v3' 0
........: set '$v3' 1 &
..........var_smaller '$v3Count' 5
..........? video_crossfader -12.5%
..........: var_smaller '$v3Count' 13
............? video_crossfader +12.5%
............: var_smaller '$v3Count' 21
..............? video_crossfader -12.5%
..............: var_smaller '$v3Count' 29
................? video_crossfader +12.5%
................: var_smaller '$v3Count' 37
..................? video_crossfader -12.5%
..................: var_smaller '$v3Count' 45
....................? video_crossfader +12.5%
....................: var_smaller '$v3Count' 53
......................? video_crossfader -12.5%
......................: var_smaller '$v3Count' 61
........................? video_crossfader +12.5%
........................: video_crossfader -12.5%" &
..........................param_cast "text" &
..........................effect_string "Builder" 3 &
..........................effect_active "Builder" on &
..........................deck master set "string3" 1
......: action_deck 4
........? deck master set '$v3' 1 &
..........effect_button "Builder" 9 &
..........get_text "deck master repeat_start_instant 'deckMaster`deck 4 pad 3`' `get_var '8beat'`ms `get_var '@$vCycles'` &
..........set '$v3Count' 0 &
..........deck master repeat_start_instant 'rsivxf3' `get_var '1/8th'`ms 64 &
..........set '$v3' 1 &
..........cycle '$v3Count' 64 &
..........var '$v3Count' 0
..........? video_crossfader 0.5 &
............set '$v3' 0
..........: set '$v3' 1 &
............var_smaller '$v3Count' 5
............? video_crossfader -12.5%
............: var_smaller '$v3Count' 13
..............? video_crossfader +12.5%
..............: var_smaller '$v3Count' 21
................? video_crossfader -12.5%
................: var_smaller '$v3Count' 29
..................? video_crossfader +12.5%
..................: var_smaller '$v3Count' 37
....................? video_crossfader -12.5%
....................: var_smaller '$v3Count' 45
......................? video_crossfader +12.5%
......................: var_smaller '$v3Count' 53
........................? video_crossfader -12.5%
........................: var_smaller '$v3Count' 61
..........................? video_crossfader +12.5%
..........................: video_crossfader -12.5%" &
............................param_cast "text" &
............................effect_string "Builder" 3 &
............................effect_active "Builder" on &
............................deck master set "string3" 1
........: nothing
 

发表时间 Tue 17 Jul 18 @ 9:10 pm
locoDogPRO InfinityModeratorMember since 2013
decent result, deck master, deck default deck active (maybe left and right ) to add to the language.

I'll try some param stuff.
 

发表时间 Tue 17 Jul 18 @ 9:15 pm
locoDogPRO InfinityModeratorMember since 2013
get_var 'var1' & param_1_x & set "var1/x" & param_multiply "get_var 'var1/x'" "get_var 'var2'" & param_cast & set 'var3'


param_1_x to add to the language
 

发表时间 Tue 17 Jul 18 @ 9:18 pm
Yeah the automated keyword generator did not catch them all and have had to add some already. One thing to note is the repetition of code. In many scripts that I have tested, and in your own sample, and in Phatom's script, the second group of script is the same as the first. This is just error prone and busy work stuff which if it was part of VDJ script it would be so much better. That's what you get when you try to keep things too simple. It makes it more difficult for the more complex things. If I end up doing the tracer / debugger I may allow real macros to get rid of this redundancy.

repeat_stop 'rsi_CollapseFolders' &
browser_window 'folders' &
browser_scroll 'bottom' &
param_equal get_browsed_folder_tab 0
..? set '$BRPreviousLevel' 0 &
....repeat_start_instant 'rsi_CollapseFolders' 100ms &
....browser_window 'folders' &
....browser_scroll -1 &
....param_equal get_browsed_folder_tab 0
....? var_equal '$BRPreviousLevel' 0
......? browser_scroll 'top'
........? repeat_stop 'rsi_CollapseFolders'
........: nothing
......: browser_folder &
........set '$BRPreviousLevel' 0 &
........browser_scroll 'top'
........? repeat_stop 'rsi_CollapseFolders'
........: nothing
....: get_browsed_folder_tab &
......set '$BRPreviousLevel' &
......browser_scroll 'top'
......? repeat_stop 'rsi_CollapseFolders'
......: nothing
..: set '$BRPreviousLevel' 1 &
....repeat_start_instant 'rsi_CollapseFolders' 100ms &
....browser_window 'folders' &
....browser_scroll -1 &
....param_equal get_browsed_folder_tab 0
....? var_equal '$BRPreviousLevel' 0
......? browser_scroll 'top'
........? repeat_stop 'rsi_CollapseFolders'
........: nothing
......: browser_folder &
........set '$BRPreviousLevel' 0 &
........browser_scroll 'top'
........? repeat_stop 'rsi_CollapseFolders'
........: nothing
....: get_browsed_folder_tab &
......set '$BRPreviousLevel' &
......browser_scroll 'top'
......? repeat_stop 'rsi_CollapseFolders'
......: nothing
 

发表时间 Tue 17 Jul 18 @ 9:22 pm
I updated the page to relax on quoted strings but I may end up just making it more intelligent in that respect. Added some keywords etc. It is easy for me to update the page so let me know if you find other things. I assume it does not know all the keywords and syntax yet.
 

发表时间 Tue 17 Jul 18 @ 10:02 pm
locoDogPRO InfinityModeratorMember since 2013
for the busy work stuff I put the repeated script on a custom button, (like a function) just call the custom button in your script.
 

发表时间 Tue 17 Jul 18 @ 10:03 pm
Best to have it self contained so it more reasonable to deal with. If you have several redundant pieces of code, what you gonna do, create a button for each and then try to explain that?
 

发表时间 Tue 17 Jul 18 @ 10:06 pm
locoDogPRO InfinityModeratorMember since 2013
can't run out of custom buttons... not something I would recommend nor publish, just something I do when the screen gets cramped.
 

发表时间 Tue 17 Jul 18 @ 11:01 pm
Not about running out of buttons :) and was talking about organization and not necessarily what you do.
 

发表时间 Wed 18 Jul 18 @ 12:50 am
I updated the formatter so that it would handle the get_text type of syntax better. get_text should add it's own level of scope though. I added the keywords: text, integer, float, boolean, and percentage. Tries to recognize numbers versus user variables versus other names. Since I had to relax things a bit some names will be shown as red. Just means it thinks it is not a keyword or a number or a user variable name. I will probably highlight user variable names using some other color.

http://www.tellyvisuals.com/vdjscript.php

Here's a reformatted shortened version of logo's script:
nothing &
action_deck 1
..? deck master set '$v3' 1 &
....effect_button "Builder" 9 &
....get_text "deck master repeat_start_instant 'deckMaster`deck 1 pad 3`' `get_var '8beat'`ms `get_var '@$vCycles'` &
....set '$v3Count' 0 &
....deck master repeat_start_instant 'rsivxf3' `get_var '1/8th'`ms 64 &
....set '$v3' 1 &
....cycle '$v3Count' 64 &
....var '$v3Count' 0
....? video_crossfader 0.5 &
......set '$v3' 0
....: set '$v3' 1 &
......var_smaller '$v3Count' 5
......? video_crossfader -12.5%
......: var_smaller '$v3Count' 13
........? video_crossfader +12.5%
........: var_smaller '$v3Count' 21
..........? video_crossfader -12.5%
..........: var_smaller '$v3Count' 29
............? video_crossfader +12.5%
............: var_smaller '$v3Count' 37
..............? video_crossfader -12.5%
..............: var_smaller '$v3Count' 45
................? video_crossfader +12.5%
................: var_smaller '$v3Count' 53
..................? video_crossfader -12.5%
..................: var_smaller '$v3Count' 61
....................? video_crossfader +12.5%
....................: video_crossfader -12.5%" &
......................param_cast "text" &
......................effect_string "Builder" 3 &
......................effect_active "Builder" on &
......................deck master set "string3" 1


EDIT: I went ahead and had the formatter color the user variables as green and make the BB Code text bold.
 

发表时间 Fri 20 Jul 18 @ 1:08 am
I updated the formatter to do some primarily error checking. Currently, it checks for mismatched logic pairs for ? and : and mismatched quotes. I used standard nesting levels for quotes to determine if there is an error. For this purpose, currently quotes are ', ", and what they call inverted apostrophe `. I don't really know syntactically what the proper use of inverted apostrophe is. From the script samples I looked at, some use of inverted apostrophe had only one and others had 2 inverted apostrophes. I assumed they should be paired and just treating it as a quote for now until I know more. Not sure why they decided to use inverted apostrophe which can look like a quote or a spec of dirt on the monitor.

Errors are shown by coloring the line where the error occurred in a darker red, and the character position of the error is enclosed in a blue box. For BB Code they are enclosed in braces { }. On the webpage, you can browse the line where the error occurred and a tool tip will pop up describing the error. You can also browse the error rectangle which may provide more information about the error.

This sample of script has mismatched quotes and logic statements.

browser_window 'folders'
..? browser_window 'songs'
..: browser_window [color=#0000ff]{'}songs" [/color]
....? browser_window [color=#0000ff]{'}sidelist' [/color]
....: browser_window 'sidelist'
[color=#0000ff]{:} browser_window 'sideview' [/color]
: browser_window 'folders'


On the webpage, it will look like this. It will also tell you how many errors were detected.
 

发表时间 Mon 23 Jul 18 @ 5:22 am
locoDogPRO InfinityModeratorMember since 2013
Backticks, yeah there is a bit of ambiguity to them, always 2 when used in textboxes to evaluate/parse script, for some of the param_ verbs it can be two, one or none.

I know none is for a param_ that expects a verb, as for one or two backticks, I'm not sure, i think 2 was born of the skin engine, and anything wrapped in " " s works with just one but i might be wrong.
 

发表时间 Mon 23 Jul 18 @ 5:47 am
Does a single back tick mean something different than paired back ticks? I mean can you use paired back ticks to mean same thing as a single back tick? Seems a quote may also end a back tick but don't know.

I changed the error box in BB Code to vertical bar and underline instead of using braces.

browser_window 'folders'
..? browser_window 'songs'
..: browser_window [color=#0000ff]|'|songs" [/color]
....? browser_window [color=#0000ff]|'|sidelist' [/color]
....: browser_window 'sidelist'
[color=#0000ff]|:| browser_window 'sideview' [/color]
: browser_window 'folders'
 

发表时间 Mon 23 Jul 18 @ 6:19 am
locoDogPRO InfinityModeratorMember since 2013
The verbs list has some examples with single backtick but if i remember its usually inside " " s
 

发表时间 Mon 23 Jul 18 @ 8:36 am
AdionPRO InfinityCTOMember since 2006
There are some verbs which indeed accept a single back tick, and in that case just assume the end of the string is the end of the part inside.
The meaning is still the same (there is vdjscript inside that needs to be queried)
 

发表时间 Mon 23 Jul 18 @ 9:09 am
83%