Connexion rapide:  

Forum: General Discussion

Sujet Script School - Page: 30
mg_1978PRO InfinityMember since 2008

 

Posté Fri 21 Oct 22 @ 5:12 am
I want to script a button to open skin_panel scratchmixer when i have skin_panel audiomixer open (or video)
I can get a button to toggle:

skin_panel 'scratchmixer' ? skin_panel 'audiomixer' : skin_panel 'scratchmixer'

But how should the script look like if i want it to work only while_pressed?

I have try:
skin_panel 'scratchmixer' while_pressed ? skin_panel 'audiomixer' : skin_panel 'scratchmixer'
skin_panel 'scratchmixer' ? skin_panel 'audiomixer' : skin_panel 'scratchmixer' while_pressed
 

Posté Fri 21 Oct 22 @ 3:11 pm
down ? skin_panel 'audiomixer' : skin_panel 'scratchmixer'

 

Posté Fri 21 Oct 22 @ 4:02 pm
locoDogPRO InfinityModeratorMember since 2013
@Denny thanks for jumping in :)

@sofit can you break it down some, I have to admit; I see a wall of text and I'm reluctant to read.
 

Posté Fri 21 Oct 22 @ 4:10 pm
Thanks!!
But what is the difference between down and while_pressed and when do you use down instead of while_pressed?
 

Posté Fri 21 Oct 22 @ 6:03 pm
locoDogPRO InfinityModeratorMember since 2013
down is the same as while pressed, except down also has a not down part to the query
 

Posté Fri 21 Oct 22 @ 7:22 pm
Ahhh. Thanks!
 

Posté Fri 21 Oct 22 @ 8:44 pm
mg_1978PRO InfinityMember since 2008
mg_1978 wrote :
locodog wrote :
param_equal there is checking against the literal string 'samplename', it needs backticks and get_var
there is almost nothing [only 1 case I can think of] you can actually do with a var by just name alone


i have quite know solution:
button: set ‘$samplename’ `get_browsed_title’ & browser_gotofolder ‘Sampler/Recordings’ & browser_window ‘songs’ & browser_scroll ‘top’ è repeat_start 20ms param_equal `get_browsed_title` `get_var ‘$samplename’` ? repeat_stop ‘scorri’ &sampler_edit : browser_scroll +1

not always work well, could you help me?


Eureka....solution is: browser_window 'songs' & browser_scroll 'top' & browser_window 'sidelist' & set ‘$samplename’ `get_browsed_title’ & browser_gotofolder ‘Sampler/Recordings’ & browser_window ‘songs’ & repeat_start 20ms param_equal `get_browsed_title` `get_var ‘$samplename’` ? repeat_stop ‘scorri’ &sampler_edit : browser_scroll +1

error is that browser_scroll 'top' it must be at beginning script (no inside script)

 

Posté Fri 21 Oct 22 @ 9:29 pm
Scripting Help - pad_pushed script not specific to the pad number ?
i want to have any pad push change the color of the led jog , in the script below i have pad 1 set to do so , but i wasn't sure if there was a good way to go about doing this for all 8 pads.
Here is the script I have set on my led jog , i like feedback and colors...

not loaded ? color white : touchwheel_touch ? blink 0.25bt ? color red : color blue : pad_pushed 1 ? blink 0.5bt ? color white : color green : automix ? masterdeck? color green : color blue : leftdeck ? color magenta : rightdeck ? color cyan
 

Posté Mon 07 Nov 22 @ 6:37 am
locoDogPRO InfinityModeratorMember since 2013
A couple of ways, just chaining the queries is probably simplest

not loaded ? color white : touchwheel_touch ? blink 0.25bt ? color red : color blue : pad_pushed 1 ? blink 0.5bt ? color white : color green : pad_pushed 2 ? blink 0.5bt ? color white : color green : pad_pushed 3 ? blink 0.5bt ? color white : color green : pad_pushed 4 ? blink 0.5bt ? color white : color green : pad_pushed 5 ? blink 0.5bt ? color white : color green : pad_pushed 6 ? blink 0.5bt ? color white : color green : pad_pushed 7 ? blink 0.5bt ? color white : color green : pad_pushed 8 ? blink 0.5bt ? color white : color green : automix ? masterdeck? color green : color blue : leftdeck ? color magenta : rightdeck ? color cyan
 

Posté Mon 07 Nov 22 @ 11:16 am
locodog wrote :
looked ok, try this thinned down version

repeat_start 'colorTracks' ? on & repeat_stop 'colorTracks' : off & browser_window "songs" & browser_scroll "top" & repeat_start 'colorTracks' 100ms & ( get_browsed_song 'harmonic' & param_cast 'text' & 
param_equal '01A' ? browsed_song color '#70ECD4' :
param_equal '01B' ? browsed_song color '#00EDC9' :
param_equal '02A' ? browsed_song color '#92F0A4' :
param_equal '02B' ? browsed_song color '#27EC82' :
param_equal '03A' ? browsed_song color '#B1EE86' :
param_equal '03B' ? browsed_song color '#85ED4E' :
param_equal '04A' ? browsed_song color '#E6E0A2' :
param_equal '04B' ? browsed_song color '#E0C86E' :
param_equal '05A' ? browsed_song color '#FEC8AC' :
param_equal '05B' ? browsed_song color '#FFA279' :
param_equal '06A' ? browsed_song color '#FFB3BF' :
param_equal '06B' ? browsed_song color '#FF8C93' :
param_equal '07A' ? browsed_song color '#FFB4D2' :
param_equal '07B' ? browsed_song color '#FF85B4' :
param_equal '08A' ? browsed_song color '#EBB7F9' :
param_equal '08B' ? browsed_song color '#F087D9' :
param_equal '09A' ? browsed_song color '#E7B6F8' :
param_equal '09B' ? browsed_song color '#CE93FF' :
param_equal '10A' ? browsed_song color '#C0CEFB' :
param_equal '10B' ? browsed_song color '#A1B9FF' :
param_equal '11A' ? browsed_song color '#94E5F8' :
param_equal '11B' ? browsed_song color '#3ED2F8' :
param_equal '12A' ? browsed_song color '#50EBF0' :
param_equal '12B' ? browsed_song color '#01EDED' : )
& browser_scroll 'bottom' ? repeat_stop 'colorTracks' : browser_scroll +1


I really like this script.
Just wondering could it be possible to make files matching the master deck in BPM, Key and Grouping start blinking?

 

Posté Mon 07 Nov 22 @ 2:22 pm
locoDogPRO InfinityModeratorMember since 2013
blinking; no possible way.
bpm is dynamic but only numbered beat difference not % beat difference,
so precision falls apart for fast or slow bpms [depending on which you're biased to]
Key difference is dynamic but not strict matches only compatible
Grouping isn't dynamic at all

I can't do any plugin tricks like sticky because setting colorRules can't be accessed by script.
you couldn't even have a scroll evaluate & send to sidelist thing due to how you've got multiple groupings on one track.

best you can do is build a string dynamically with bpm % range and strict key then cast that as text to a quick_filter.
It won't be colours only a quick filter & you'll have to pick the bones out of grouping, as that's unique to your workflow.
Oh you'll have toggle the filter as deck master track changes to update for any bpm changes.

custom_button
quick_filter 0 ? on & quick_filter off :  off & get_text "Bpm < `param_multiply 1.04 'deck master get_bpm'` and Bpm > `param_multiply 0.96 'deck master get_bpm'` and key is `deck master get_key`" & param_cast 'text' & quick_filter


current bpm is +- 4%, you can change that with the numbers next to param_multiply
 

Posté Mon 07 Nov 22 @ 4:19 pm
locodog wrote :
A couple of ways, just chaining the queries is probably simplest

Thank you !

 

Posté Mon 07 Nov 22 @ 4:27 pm
Hi,

is there a way to get a true/false Value about get_status

has status true, has no status false
 

Posté Thu 10 Nov 22 @ 12:41 pm
locoDogPRO InfinityModeratorMember since 2013
first thought is compare against a blank string, I'll check now

*edit* yeah that does it.
param_equal `get_status` "" ? on : off
 

Posté Thu 10 Nov 22 @ 12:42 pm
Wow.. I've test so much things with param_equal and param_bigger the `` was the key :D....
There are many moment i cry with the Virtual DJ Script :D

THANK YOU
 

Posté Thu 10 Nov 22 @ 12:46 pm
locoDogPRO InfinityModeratorMember since 2013
yeah the thing is with param_equal, it can do strings or actions, so while param_bigger doesn't need `` [but still can use] because it can't deal with strings and it uses '' or "" to encapsulate actions that include a space like

param_bigger 'get_var a' 'get_var b'

because param_equal can do strings, then it needs the action to be specified as an action, by wrapping in `` and strings wrapped in "" or ''
It's a little messy as a rule set but to clean it up would remove capabilities.
...script, it's a language, and languages have these weird nuances that a first are confusing but there's usually a reason as to why.
 

Posté Thu 10 Nov 22 @ 1:01 pm
Hi. Can a script count the number of letters in a string?
set_var 'a' "text"

How many letters are there in the variable 'a'?
 

Posté Sat 12 Nov 22 @ 1:45 am
locoDogPRO InfinityModeratorMember since 2013
setting another var to your first var with param_cast 'text' X, [X being the number of chars to cast] then comparing for equality.
set_var 'a' "text" & set b `get_var a & param_cast 'text' 1` & 
var_equal "a" "b" ? SIZE OF 1 :
set b `get_var a & param_cast 'text' 2` &
var_equal "a" "b" ? SIZE OF 2 :
set b `get_var a & param_cast 'text' 3` &
var_equal "a" "b" ? SIZE OF 3 :
set b `get_var a & param_cast 'text' 4` &
var_equal "a" "b" ? SIZE OF 4 :


truth be told you don't even need a 2nd var, same sort of idea but with param_equal
param_equal `get_var a` `get_var a & param_cast 'text' 1` ? SIZE OF 1 : 
param_equal `get_var a` `get_var a & param_cast 'text' 2` ? SIZE OF 2 :
param_equal `get_var a` `get_var a & param_cast 'text' 3` ? SIZE OF 3 :
param_equal `get_var a` `get_var a & param_cast 'text' 4` ? SIZE OF 4 :

 

Posté Sat 12 Nov 22 @ 3:49 am
Perfect!!!
 

Posté Thu 17 Nov 22 @ 12:40 pm
64%