Accesso rapido:  

Forum: General Discussion

Topic: Script School - Page: 41.25
locoDogPRO InfinityModeratorMember since 2013
Script in filters


Quick fire examples, want to use script as a value, just wrap the script in ` `

Artist contains `deck master get_artist` FIND MORE BY CURRENT ARTIST
Bpm > `deck master get_bpm & param_multiply 0.48` and Bpm < `deck master get_bpm & param_multiply 0.52` ~0.5* BPM MATCH
key is `deck master get_key` EXACT KEY MATCH
key is `deck master get_harmonic` EXACT KEY MATCH [vdj figures out key from harmonic]

All very straight forward, lets do something interesting

A circle of 5ths, AKA +1 on the Camelot wheel, AKA harmonic

First we'll do the "I hate myself method" in steps

key is `deck master get_harmonic & param_equals "01A" ? get_text "02A" : `

if harmonic is 01A then +1 is 02A, because we're inside ` ` the filter is given what the script inside evaluates to, so get_text the value you want.

So go nuts, there's only 24 possibilities

key is `deck master get_harmonic & param_equals "01A" ? get_text "02A" : deck master get_harmonic & param_equals "02A" ? get_text "03A" : ...`


do that for 01-12 for A and carry on for 01-12 B and that's it, it's ugly but it works.
If you do it like that you'll get bored by your 6th copy paste, hopefully bored enough to think "there has to be a better way"

So a better way then,
how do we add 1 to the harmonic and for the case of 12X loop round to 1? we best try some stuff, [play along at home because I'm not going to give you the final filter]
load up a track with any key and open your custom_button editor, use this as the name
`get_harmonic`
that gives our current harmonic, not what we want yet, try adding 1

`get_harmonic & param_add 1`
same result, that doesn't work, try the other way of adding

`param_add get_harmonic 1`
different result, wrong answer, it's put a 1 in front of our harmonic
it was understood as a string, let's try cast it as an integer then add 1

`get_harmonic & param_cast 'integer' & param_add 1`
well we added 1 but a few issues, and this depends on you starting harmonic as to what you see
first off obvious, we're missing the A or B
now if your starting harmonic was 09X, 10X or 11X that's the only issue you'll see
but if it was less than 09X you'll see you lost your leading zero. or if your start harmonic was 12X you now have 13

let's deal with the leading zero, param_cast '00' will cast a number with a fixed number of digits

`get_harmonic & param_cast 'integer' & param_add 1 & param_cast '00'`
that fixes our leading zeros issue, now to try add A or B with a query on the end

`get_harmonic & param_cast 'integer' & param_add 1 & param_cast '00' & get_harmonic & param_contains "A" ? param_add "A" : param_add "B"`
that doesn't work, go back a step can we actually add a letter to it, forget the query just try add a letter on the end

`get_harmonic & param_cast 'integer' & param_add 1 & param_cast '00' & param_add "P"`
we got an P there, must be the query at fault, let's try the query at the start and double up the script, one for A case one for B case

`get_harmonic & param_contains "A" ? get_harmonic & param_cast 'integer' & param_add 1 & param_cast '00' & param_add "A" : get_harmonic & param_contains "B" ? get_harmonic & param_cast 'integer' & param_add 1 & param_cast '00' & param_add "B"`
That works, now just the issue of starting with harmonic 12X gives 13X
this is where I'm not going to give you a copy paste

if we know get_harmonic & param_contains "A" ? is true, the only thing we need to know after that is get_harmonic & param_contains "12" ? if that's true we want 01A, and I already covered that in the long boring method, : if it's false then do the other stuff.
we've got to ask the same contains 12 question after get_harmonic & param_contains "B" ? as well, but that's all there is to it.

if you've done that right your custom_button name will be == starting harmonic +1
that custom button name is what you paste into a filter that starts

key is

one tiny difference though, custom_buttons know what deck they belong to, filters follow the selected deck unless told otherwise, so when you paste it in to the filter, just after the opening ` specify deck master just before the first get_harmonic

I've told you everything here except the answer explicitly, the whole jigsaw is built up into only a couple of separate pieces, just put them together, or use the horrible way.

Or if time is money for you, I can work on those terms too.

[wow that got lengthy, but to do scripting you have to put some effort in, there won't always be a copy paste solution given]
 

Inviato Sun 05 Nov 23 @ 1:59 am
Hey yall, my name is Big King Zilla, I just started DJing on Twitch because I figured out how to DJ using virtual DJ with my wheelchair. I am physically disabled so it pretty awsome but im trying to figure out how to do some more complex scripts for the custom buttons for better transitions that are a little more elaborate not to simple. Right now I am trying to figure out how to eq_kill_low & filter 25% & effect_active 'reverb' & mix_now 16bt but I cant get the effects to turn off automatically after I transition . If anybody can help me out I would really appreciate it.
 

Inviato Sat 11 Nov 23 @ 7:17 am
locoDogPRO InfinityModeratorMember since 2013
using a wait 16bt & then calling effect_active off would be easiest.
 

Inviato Sat 11 Nov 23 @ 7:31 am
mg_1978PRO InfinityMember since 2008
hi at all, i have this question: i have a playlist named “Sequencer” (in browser i have seen that is a file.m3u) and this is my script:
get_browsed_folder_path & param_cast & param_contains ‘Sequencer’ ? browser_remove : playlist_add
because only in Playlist Sequencer (or folder Sequencer?) i would remove songs…in other folders i would add songs in Automix..doesn’t work (i think problem is that “Sequencer” isn’t a folder, but is a Playlist
Can you help me with correct script? Thanks
 

Inviato Sun 12 Nov 23 @ 6:45 pm
locoDogPRO InfinityModeratorMember since 2013
check with a custom_button LED logic

get_browsed_folder_path & param_cast & param_contains 'Sequencer' ? on : off

does it work there? also check capitalisation, also check your ' marks, vdj does not like curved ' " like you have typed here.
 

Inviato Sun 12 Nov 23 @ 7:47 pm
mg_1978PRO InfinityMember since 2008
yes, correct thanks! my ‘ wasn’t right, now it works

 

Inviato Sun 12 Nov 23 @ 11:43 pm
mg_1978PRO InfinityMember since 2008
hi at all! script: linein 3 get_haslinein ? on :off
doesn’t work :( i would know if is there only linein 3 in audio setup
can you help me? thanks
 

Inviato Wed 06 Dec 23 @ 5:34 pm
locoDogPRO InfinityModeratorMember since 2013
probably not possible. get_haslinein ? on : off is the best there is.
 

Inviato Wed 06 Dec 23 @ 10:04 pm
Hi vdjscript Community,

I'm seeking advice on a specific VDJScript challenge. My goal is to apply the same type of filter effect on different stems within a track, but with varying intensities for each stem. For example, applying a filter to the kick drum stem at one intensity level while applying a different intensity of the same filter to the vocal stem simultaneously. I'm considering whether the 'effect_stems' command can be combined with the 'filter' command for this purpose. Has anyone successfully achieved this kind of independent stem-specific filter control? If so, how did you script it?

Any advice or shared experiences with similar scripting challenges would be greatly helpful.

Thanks a lot!
 

Inviato Thu 07 Dec 23 @ 12:45 am
locoDogPRO InfinityModeratorMember since 2013
native fx are limited to one instance of that effect per deck. Truth be told so are non native fx BUT you can rename them to dodge that limitation.
SBDJ has a solid filter fx available
https://forum.sbdj.co.uk/topic/2/sbdj-filter-v2-0-released
install, make several copies, give each a name that makes sense like
filterRhythm
then call them like so
effect_active rhythm filterRhythm
and control like so
effect_slider rhythm filterRhythm 1 20%
or show the gui
effect_show_gui Rhythm filterRhythm
 

Inviato Thu 07 Dec 23 @ 1:18 am
Hi Locodog,

Thank you for your insightful response. I appreciate the clarity you've provided about the limitations of native effects and the workaround with non-native effects. The suggestion to use SBDJ's filter fx, make copies, and rename them for individual stem control seems like a practical solution to my challenge. I will definitely try implementing this method and see how it works out.

Thanks again for your advice and for sharing your expertise!
 

Inviato Sun 10 Dec 23 @ 12:27 pm
locoDogPRO InfinityModeratorMember since 2013
effect_stems applies the active effects on the standard effect slots to the specified stem.

Specific effects on specific stems follows the syntax I posted above, here's a video proving just that.

 

Inviato Sun 10 Dec 23 @ 10:56 pm
mg_1978PRO InfinityMember since 2008
hi, where is in setting? And this refresh is for Denon Dj Prime 4 (for example) when file .xml (skin) change and doesn’t need to close the software and restart it to see the changes in the skin?
Thanks
 

Inviato Wed 13 Dec 23 @ 4:11 pm
locoDogPRO InfinityModeratorMember since 2013
not a script, it's how the interface & mapping windows have changed visually
 

Inviato Wed 13 Dec 23 @ 4:17 pm
mg_1978PRO InfinityMember since 2008
Hi at all, i have problem with script:
sampler_output “headphones”

if i would listen samples only in headphones….i don’t listen any sample :( i have mapped a button: sampler_pfl
but i listen sample only in headphones only when i pushed continuosly the button mapped sampler_pfl.
What is wrong?
thanks
 

Inviato Sat 16 Dec 23 @ 11:26 pm
Trying to figure out how to have my gain go up 4 DBs when ever I hit my "Vocal" button and then switch back to match the other track when I hit the same button again.

This is my "Vocal" button now

var 'stem_page' 1 ? var 'pad_fx_sngl' 1 ? padfx_single 'echo out' 80% 1bt 'stemfx:vocal' smart_pressed : padfx 'echo out' 80% 1bt 'stemfx:vocal' smart_pressed : var 'stem_page' 0 ? stem_pad 'acapella' smart_pressed : stem_pad 'vocal' smart_pressed

Could I get some help please??
 

Inviato Sun 17 Dec 23 @ 3:19 pm
locoDogPRO InfinityModeratorMember since 2013
I'm not sure oh how to raise a specific number of dB, I'd just give gain a poke up of a few % and down by the same %


( var vocalBoost 0 ? gain +0.04 & set vocalBoost 1 : gain -0.04 & set vocalBoost 0 ) & var 'stem_page' 1 ? var 'pad_fx_sngl' 1 ? padfx_single 'echo out' 80% 1bt 'stemfx:vocal' smart_pressed : padfx 'echo out' 80% 1bt 'stemfx:vocal' smart_pressed : var 'stem_page' 0 ? stem_pad 'acapella' smart_pressed : stem_pad 'vocal' smart_pressed
 

Inviato Sun 17 Dec 23 @ 3:56 pm
Ok so your script raises the gain but does not turn and keep on the vocal when pressed.

Its close 👍🏾

EDIT

After a restart its working, just need a little more gain now.
 

Inviato Sun 17 Dec 23 @ 4:19 pm
locoDogPRO InfinityModeratorMember since 2013
It's your script, I just added a bit for gain on the start in brackets so your script should work as it did.
 

Inviato Sun 17 Dec 23 @ 4:21 pm
Ok I figured out how you boosted it but now when I turn the vocals off I went the gain to match the opposite track on the other deck??

Appreciate the help

Ok so I got it to match the gain but now my button isn't lighting up when the vocal is on. That's the last problem I got 😅
 

Inviato Sun 17 Dec 23 @ 4:24 pm
88%