快速登录:  

Forum: General Discussion

话题: Script School - Page: 8.35

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

skyzo76PRO InfinityMember since 2016
skyzo76 wrote :
locodog wrote :
if I understand, you want
Pad 1 name: `cue_name 1`

exactly

ok so..i understand that I don't know what is this character not a " not a '..and when i copy paste your code it works...(but i already tried it with ") OK so it was so simply thanks again locodog
 

发表时间 Thu 10 Dec 20 @ 6:52 pm
locoDogPRO InfinityModeratorMember since 2013
It's a backtick [has a few names, you should see it above your tab key]
https://www.computerhope.com/jargon/b/backquot.htm

in vdj script backticks [`] are used in a few places, mostly when dealing with text, it tells vdj to use what is inside two back ticks as a script, and then parse it as text
for example, you set a variable to 6.
set 'myVar' 6
you could give a pad name something like this
myVar is `get_var 'myVar'`

what would be displayed is
myVar is 6

backticks have uses in more advanced script than just text, but the purpose is the same. parsing script,
set 'myVarSquare' `param_multiply "get_var 'myVar'" "get_var 'myVar'"`
it can be a little confusing when you need to use backticks as some param_ modifiers are expecting a script so they don't need backticks, other param_ modifiers might expect a script or a string so backticks are need to indicated we have passed it a script.

It's just one of those that you learn with practice.
 

发表时间 Thu 10 Dec 20 @ 8:08 pm
MDJ2513Home userMember since 2019
Hello Friends, excellent forum.
Please can you help me to create a script or command to execute the progressive "Filter" effect, or a curve for increase or decrease Filter sound fx, by clicking a single button or key. Thanks in advance.

As it the trail or route made by the potentiometer or filter knob, but by pressing a single key. May be trailing Filter fx from 30% to 80%.
 

发表时间 Fri 11 Dec 20 @ 2:59 pm
locoDogPRO InfinityModeratorMember since 2013
repeat_start 'filterTwist' ? repeat_stop 'filterTwist' : repeat_start 'filterTwist' 33ms -1 & filter 0% ? repeat_stop 'filterTwist' : filter +0.5%

something like that is the most basic way, I have virtualFX that can do it a bit more advanced, from a position, to a position, over a beat duration.
if you want that post in the virtualFX thread and I'll tweak the one I have here.
 

发表时间 Fri 11 Dec 20 @ 4:36 pm
MDJ2513Home userMember since 2019
Thank u very much Locodog, this one is very useful. Ok, yes please go ahead, tweak this script like virtualFX thread.

Something to set a range of Filter FX trail, from - to and reverse to -from if possible.
From center 50% to 80% and return 80% to normal 50% automatically by pressing one key. And functional for another sound FX.

Thanx in advanced.

 

发表时间 Sat 12 Dec 20 @ 2:34 am
skyzo76PRO InfinityMember since 2016
locodog wrote :
It's a backtick [has a few names, you should see it above your tab key]
https://www.computerhope.com/jargon/b/backquot.htm

in vdj script backticks [`] are used in a few places, mostly when dealing with text, it tells vdj to use what is inside two back ticks as a script, and then parse it as text
for example, you set a variable to 6.
set 'myVar' 6
you could give a pad name something like this
myVar is `get_var 'myVar'`

what would be displayed is
myVar is 6

backticks have uses in more advanced script than just text, but the purpose is the same. parsing script,
set 'myVarSquare' `param_multiply "get_var 'myVar'" "get_var 'myVar'"`
it can be a little confusing when you need to use backticks as some param_ modifiers are expecting a script so they don't need backticks, other param_ modifiers might expect a script or a string so backticks are need to indicated we have passed it a script.

It's just one of those that you learn with practice.

ok I undestand finally ...super clrear thanks again locodog ;)
 

发表时间 Sat 12 Dec 20 @ 2:32 pm
skyzo76PRO InfinityMember since 2016
I have an other question : i made a variable called "scale" for the key..scale 0 is major, scale 1 is minor scale 3 Dorian etc...I asked my custom button display the value of the variable (1.2.3 etc) but is this possible to say "name of var scale 0 = "major"...name of var scale 1 = "minor" and display the name in the custom button ? ;)
 

发表时间 Sat 12 Dec 20 @ 5:38 pm
locoDogPRO InfinityModeratorMember since 2013
sure, example [I won't give you the exact code, because figuring it out is part of the fun :) ]

script action
toggle test

button name
`var test 1 ? get_text "true" : get_text "false"`
 

发表时间 Sat 12 Dec 20 @ 5:45 pm
locoDogPRO InfinityModeratorMember since 2013
 

发表时间 Sat 12 Dec 20 @ 9:10 pm
skyzo76PRO InfinityMember since 2016
locodog wrote :
sure, example [I won't give you the exact code, because figuring it out is part of the fun :) ]

script action
toggle test

button name
`var test 1 ? get_text "true" : get_text "false"`

cool i get it :;) ty (again)

 

发表时间 Sat 12 Dec 20 @ 10:22 pm
skyzo76PRO InfinityMember since 2016
here is my goal : manage key (different scale) with 16 custom pad (like in jpg) and simultanely can manage key with a slider or pots... I can not just use the action "key" on my slider because of the different scale that i want to use, there is some changement in the "next or previous note"...so I did a script to say when param of slider is between this and that go to Key x(separatly it works well)...the issue is when i want to use slider and pads on the same deck : the slider is master and when i hit my button ,it just make the good key a mili second (like a pitch bend...interesting by the way) and returning to the param of my slider (because of the action "repeat_start_instant 'bars' 30ms " I suppose)..so my question is..is there a method to say "when hit the pad stop repeat "and when i use my slider again the "repeat instant" start again ? i don't if it is clear but by trying to explain i probably advance for a solution ;)))
 

发表时间 Sun 13 Dec 20 @ 2:59 pm
locoDogPRO InfinityModeratorMember since 2013
the button is easy, just stop the rsi as part of the script.
repeat_stop 'RSIname'
the slider, nearly as easy - query if the rsi is running at the start, if it is do what you were going to do, if it's not start the rsi and do your thing

repeat_start 'RSIname' ? is running, carry on : not running, start the rsi, carry on
 

发表时间 Sun 13 Dec 20 @ 3:43 pm
skyzo76PRO InfinityMember since 2016
locodog wrote :
the button is easy, just stop the rsi as part of the script.
repeat_stop 'RSIname'
the slider, nearly as easy - query if the rsi is running at the start, if it is do what you were going to do, if it's not start the rsi and do your thing

repeat_start 'RSIname' ? is running, carry on : not running, start the rsi, carry on

ok i get it with this code
"var "$Scale" 0 ? repeat_start_instant 'KeyFader' 30ms & deck 1 param_smaller 1% ? repeat_stop 'KeyFader' & deck 1 key -12 : repeat_start_instant 'KeyFader' 30ms & deck 1 param_bigger 1% & param_smaller 5% ? repeat_stop 'KeyFader' & deck 1 key -11 : ....."
it works well ;) no need to change on the button :) ty
 

发表时间 Sun 13 Dec 20 @ 8:22 pm
skyzo76PRO InfinityMember since 2016
Hey Locodog ! I just have a question. Do you code all inside VDJ or do you use a soft for coding ? if yes, wich one? thanks
 

发表时间 Wed 16 Dec 20 @ 12:17 pm
locoDogPRO InfinityModeratorMember since 2013
if I was doing a big remapping I'd use np++, most of the time I'm in vdj.
 

发表时间 Wed 16 Dec 20 @ 12:24 pm
Hi all
re-posting from another thread http://www.virtualdj.com/forums/238420/General_Discussion/Help__with_scriptiing_a_Custom_Slider_Button.html

so can be easily found by anyone attending Script School.


USE of BACK TICKs

IIDEEJAYII wrote :
When do I do I need the back ticks on parameter? in this case level is defined by VDJ as value of a volume fader.

Is it advised to use `level` in

param_greater 50% `level` 


since the code below also works without the back ticks
param_greater 50% level 



with 2 amazing replies

locodog wrote :
param_greater is expecting 2 things, that could be an actions or values, or a mix
since it is expecting an action it can work with no spaced actions without ` ` so, level, get_level etc will be fine.
however, if there's a space in the action, lets say
effect_slider 'echo' 1
the space will mess things up so you would need to encapsulate ` ` , I believe encapsulate works with " " & ' ' too

param_equal, is slightly different, it is expecting either action, value or a string so, wrapping with " " or ' ' is reserved for strings.
Most of the time if doing a comparison on an action, wrapping the action in ` ` can't hurt there is one exception I'll try remember what it was.
*edit, I was remembering the wrong thing


Nicotux wrote :
i try again as post does not appear

`level & param_bigger 0.75 ? get_constant 0 : param_cast int`

backquote only not needed with "param_*' when action is one word only
most other verbs are needing backquotes or ignore them
as locodog said there are "exception" . trial & error only can help


All the above tests and comparisons are only working with scripts and physical sliders but not with custom_sliders
(custom sliders are not real sliders anymore for a while)

so that user slider have to be scripted in a way to make it work correctly
they need a specific variable (each) to handle value, specially using relative scroll, slide & move
(encoders, touchscreen, mouse roll)

set v[INDEX] & param_cast absolute & set v[INDEX] `get_var v[INDEX] & param_bigger 0.0 ? param_bigger 1.0 ? constant 1.0 : get_var v[INDEX] : constant 0.0` & param_add 0 `get_var v[INDEX]` & ...

set v : save the wrong absolute value (not in slider range)
param_cast absolute : convert param for future use
set v `..` : fix correct value for the slider
param_add 0.0 ... : hack to be able to overwrite parameter with correct absolute value and update slider display accordingly
& ... : now parameter is in range [0.0..1.0] and correct absolute value is passed to the script
 

发表时间 Sat 26 Dec 20 @ 5:42 pm
skyzo76PRO InfinityMember since 2016
HI! I need help for a script for my led...I want that it light, when an effect (what ever effect) is ON...but if I just use "effect_active" it doesn't work...I can use effect_active 1 or 2 etc..but the problem is that I use many other effect who's are not in the x slot specially...I try to don't write each effect...:) I odn't know if it is clear...:)
 

发表时间 Wed 13 Jan 21 @ 6:58 pm
NicotuxHome userMember since 2014
effects_used
 

发表时间 Wed 13 Jan 21 @ 7:39 pm
skyzo76PRO InfinityMember since 2016
thanks !
 

发表时间 Wed 13 Jan 21 @ 8:09 pm
twagaPRO InfinityMember since 2009
Can we write VDJscript to wait 1 second?

Also, can we write VDJscript to play(hold off, release) 1 beat and beat_juggle -1 beat?
 

发表时间 Mon 18 Jan 21 @ 3:12 pm
18%