Quick Sign In:  

Forum: General Discussion

Topic: Script School - Page: 3.85

Dieser Teil des Themas ist veraltet und kann veraltete oder falsche Informationen enthalten

NicotuxHome userMember since 2014
set 'oneBeatMS' `param_multiply "get_bpm & param_1_x" 60000` & param_cast 'ms' & repeat_start 'stupidPlayPause' & play_pause & cycle 'SPP' 33 & var_equal 'SSP' 32 ? repeat_stop 'stupidPlayPause' & set 'SPP' 0 : nothing
we cycle 33 so we actually make it to 32 and when we stop the repeat_start we also reset the var [SPP] to 0, or we could do this to be a bit neater
is this not a simple cycle 32 or is there any difference ?
set 'oneBeatMS' `param_multiply "get_bpm & param_1_x" 60000` & param_cast 'ms' & repeat_start 'stupidPlayPause' & play_pause & cycle 'SPP' 32 & var_equal 'SSP' 0 ? repeat_stop 'stupidPlayPause' : nothing

Anywho that's it for now, next time WILL be changing settings via script.
hope you'll specify the list of settings allowed to be read/written because somme seems to be restricted i.e. "effects"
 

geposted Thu 30 May 19 @ 6:18 pm
locoDogPRO InfinityModeratorMember since 2013
No difference, [except neater] In the very next script after that one I did cycle 32 (and said it was neater) but I had just introduced the "cycle" action, and it was just to it break it into easily understood steps [first explain how we think, then highlight the small difference of how the program works]

Yeah Settings honestly I don't know the full list of ones allowed to be scripted to, I'd love to be able to do setting "browserColumns" it's a right pain when I've had guests on my rig..
I think I'm just going to give examples of the more common ones and leave users to try stuff
 

geposted Thu 30 May 19 @ 6:40 pm
NicotuxHome userMember since 2014
yes, some as "browserColumns" may finally be understood, have to find the list of possible parameters but some other as "browserSort" badly wont be scriptable for everybody as its parameters are translated depending on the active language.xml :/
 

geposted Thu 30 May 19 @ 6:53 pm
locoDogPRO InfinityModeratorMember since 2013
A small unsexy addition that came with v8.4 [2020] that actual could be a big thing
variables can now hold strings

Set [capture] like this
set 'test1' `get_text 'hello'`
set 'test2' `get_browsed_song "artist"`

And you can compare just like any other variable

prove it with custom_button led logic
param_equal `get_var test1` 'hello' ? on : off

check what the var actually is with this as a custom_button name
`get_var test1`

or inspect with the var list viewer
var_list
I'll post more as I figure any nuances
 

geposted Tue 24 Sep 19 @ 10:37 am
Hi, a quick, question -
I want to be able to turn on a specific shader (eg: "geometry") and then control transparency in the poi editor.
I tried effect_string "shader" 1 "geometry" & effect_slider "shader" 1 +0% but they do not work for me.
can anyone advise?

Tks
 

geposted Wed 30 Oct 19 @ 4:11 am
NicotuxHome userMember since 2014
As locodog said previous page:

Button 1 : show position & size selection tool
Button 2 : AutoChange
Button 3 : BeatMove

Slider 1 : Shader selection
Slider 2 : Transparency

String 1 : Indexed name ... the one on Shadertoy
String 2 : Prety name ... the one we understand

Only shader selection (slider 1) reflect in the GUI, all other actions are not reported
however transparency, BeatMove and AutoChange are effective even not updated in the gui

NOT working anymore ?
When a shader or folder is specified by any of its name , the string is affected, querying them gives the changed value, but nothing apply
maybe some extra action is needed or syntax change ?

for transparency use :
deck master effect_slider 'shader' 2 50%

for a shader...
deck master effect_slider 'shader' 1 12%
it is working but have to know the relative position in the list "All"


Don't play too much with it actually.. it crashed some of my PC just using it ... VDJ still up but WindowManager totally broken.. and another one got BSOD
was working fine before last summer
 

geposted Wed 30 Oct 19 @ 8:25 am
locoDogPRO InfinityModeratorMember since 2013


I've reported effect string not working but the "nudge" of slider 1 [shader select]workaround works here
 

geposted Wed 30 Oct 19 @ 9:50 am
locoDogPRO InfinityModeratorMember since 2013
Just a little thing I've been playing with for NYE, for your 1 hour/ 30minutes /10 minutes etc to go, you'll have something planned yourself
but just as general countdown for your video out you could do this

firstly set some variables, say you start showing your countdown at 9:30pm, 2 & a half hours to go, also turn text fx on

set 'hour' 2 & set 'min' 30 & set 'sec' 0 & effect_active 'text' 1

Second start these variables counting down [really you could do script 1 & 2 together]
repeat_start 'tCounter' 1000ms & cycle 'sec' -60 & var 'sec' 59 ? cycle 'min' -60 & var 'min' 59 ? cycle 'hour' -24 : : :

Third put these variables into a text string & send it to the text fx
repeat_start 'clock2text' 1000ms & get_text "`get_var 'hour' & param_cast '00'`:`get_var 'min' & param_cast '00'`:`get_var 'sec' & param_cast '00'`" & param_cast 'text' & effect_string 'text' 2

realistically you'd ditch this at 1 minute to go and you could kill it via event schedule at 23:58:59 with something like this

repeat_stop 'tcounter' & repeat_stop 'clock2text' & effect_active 'text' 0

And honestly you could put the countdown together with 1 script [I broke it up to make it easier to understand]

set 'hour' 2 & set 'min' 30 & set 'sec' 00 & effect_active 'text' 1 & repeat_start 'clock2text' 1000ms & get_text "`get_var 'hour' & param_cast '00'`:`get_var 'min' & param_cast '00'`:`get_var 'sec' & param_cast '00'`" & param_cast 'text' & effect_string 'text' 2 & cycle 'sec' -60 & var 'sec' 59 ? cycle 'min' -60 & var 'min' 59 ? cycle 'hour' -24 : : :

 

geposted Sat 23 Nov 19 @ 7:54 pm
locoDogPRO InfinityModeratorMember since 2013
A couple of things added as of BUILD 5451 (2019-11-24)

goto "loopsize+" and goto "loopsize-" to jump in steps based on default loop size
goto "loopsize" works on endless rotary knobs

simple enough, goto action will treat the "loopsize+" or "loopsize-" as a number.


effect_bank_save "BANKNAME"
effect_bank_load "BANKNAME"
effect_bank_load "BANKNAME" "multi"

Your fx banks are saved in settings.xml
effect_bank_load "BANKNAME" stops previous effect unless "multi" is added as second parameter
 

geposted Wed 27 Nov 19 @ 1:31 pm
RanikiPRO InfinityMember since 2018
Is it just me or has the drop down explanatory text that used to appear in the Controller Settings Scripting window in 2018, which explained which conditions were active at any point in the script when you pointed to it with the mouse.... disappeared in 2020 (and been replaced by some sort of colour coding)?

If so, is there any way to turn it back on?
 

geposted Fri 20 Dec 19 @ 1:26 pm
locoDogPRO InfinityModeratorMember since 2013
Not just you, I think it vanished during the time they were sorting some text spacing bugs of the editor before 8.4 release.
It was a handy pointer for shorter scripts but anything longer than the textbox size you couldn't scroll down to see the conditioning.

For longer stuff I write in a text editor in a logic tree format, with np++ you can easily change from tree layout to wall of text with shift+tab to remove indents & ctrl+j to turn several lines into one line.
 

geposted Fri 20 Dec 19 @ 1:49 pm
RanikiPRO InfinityMember since 2018
Thanks as ever - I'll check out np++. Looks like a nifty little utility.....

While I'm here I would like to ask about chaining commands in queries and using "&&" ......

According to the VDJ Script page "If && is used instead of &, to chain commands in queries, the query returns true only if both chained commands return true."

However testing out the example that you gave earlier in the Script school (and other ones I've played around with myself):
effect_active "echo" && effect_active "flanger" ? effect_active "brakeStart" : effect_active "echo" on & effect_active "flanger" on
it doesn't seem to behave at all as I would expect....

Both Effects off -----> Press 1: Turns both effects on -----> Press 2: Brakestart Activated -----> Press 3: Echo starts toggling on and off & Brakestart with it.....

So it is looking to me like it is taking the first script effect_active "echo" as a command rather than as part of a single query as to whether both echo and flanger are active.

Could you say a bit more about how chained commands are used in queries using either "&" or "&&"

Cheers
 

geposted Fri 20 Dec 19 @ 5:35 pm
locoDogPRO InfinityModeratorMember since 2013
I see what you mean, strange I see && used lots in skins for conditioning also a pad with something like this
effect_active 'echo' && effect_active 'cut'

will only light up with both conditions true,

but like you said in straight script [query to a command] it's only taking the last as a query and a first as a command.
perhaps something the devs could elucidate.
 

geposted Fri 20 Dec 19 @ 6:27 pm
NicotuxHome userMember since 2014
action1 && action2 ? action3 : action 4

if action1 is false, script stops and action2 is ignored maybe because global query will fail, but the test is ignored too
action2 only execute when action1 is true, making test appearing to only apply to action2

Test:
set a pad and name it " `get_var myvar`" - without quotes, keeping the leading space
as action:
set myvar ` var var1 1 && var var2 2 ? get_constant 55 : get_constant 42`

_ var1 _ var2 _ resulting name:
__ 0 ____ 0 ____ ?
__ 0 ____ 2 ____ ?
__ 1 ____ 0 ____ 42
__ 1 ____ 2 ____ 55

 

geposted Fri 20 Dec 19 @ 11:50 pm
RanikiPRO InfinityMember since 2018
Yes this does seem strange Locodog. Especially as the official script page definitely says:

Quote :
"When chained commands are used in queries, the result depends on the state of the 1st action. E.g. play & loop will return true if the deck is playing (regardless if the deck is looped or not).
If && is used instead of &, to chain commands in queries, the query returns true only if both chained commands return true.
E.g. play && loop query will return true only if both commands return true (deck is playing and is looped) and false in all other cases.


Which doesn't seem to be what is happening in practice.
 

geposted Sat 21 Dec 19 @ 2:07 am
AdionPRO InfinityCTOMember since 2006
The difference between & and && is only when used in queries, so for LED's etc, not when the action is executed when a button is pressed for example.
In that case & and && have the same effect, namely that both are executed.
So "a & b ? c : d" and "a && b ? c : d" both mean the same thing, namely, first do "a", then do "b ? c : d"
If you need "(a && b) ? c : d" you'll have to write it as "a ? b ? c : d : d"
 

geposted Sat 21 Dec 19 @ 3:12 am
RanikiPRO InfinityMember since 2018
Thanks Adion, that clears that one up then! And I don't need to spend any more time trying to get it to work!

It might be worth editing the script page on the website to make it clear that it only applies to "queries" rather than 'scripting questions' creating "conditional branching".
 

geposted Sat 21 Dec 19 @ 9:01 am
skyzo76PRO InfinityMember since 2016
hello vdj user,
I am working on a live show. One of my deck are several loop. Each on a cue (8 hotcues) and edit it "type" "saved loop". for some reasons, i can not be "precise" for triggering at the good time an another loop, then I need to command to vdj "when the 4 bars are completed, go to "loop 1" (or two or three depending on the button i trigger). It s a bit like the smart cue, but I do not like it because it trigger at the same moment of bar and not wait for the end of bars. I don't know if I am clear, my english is bad...for some Ableton users it is like launch a scene with the quantize on 1 bar.
thanks for futur help
bye
 

geposted Thu 26 Dec 19 @ 5:06 pm
locoDogPRO InfinityModeratorMember since 2013
a rsi monitoring get_beat_bar X, looking for a high value <1.0 when true call whatever and stop the rsi.
 

geposted Thu 26 Dec 19 @ 7:56 pm
skyzo76PRO InfinityMember since 2016
thanks locodog for this respons. beginning of a new era for me :)
here is the code i put on custom pad

"repeat_start_instant 'bars' 10ms & get_beat_bar 4 & param_bigger 99% ? repeat_stop 'bars' & deck 1 hot_cue 1 : nothing "

working with my mouse (sometimes missed the first beat and do it at the second)
BUT I Copy Paste this code working good with my mouse on a button of my midi controller (traktor s4) button on cc gate
When i use this code on button encoder , it don't work...If I code my button with "pad1" it work but not ideal for me...does it have an explain for this ?
may be an holding condition?
 

geposted Fri 27 Dec 19 @ 11:00 am
8%