Accesso rapido:  

Forum: General Discussion

Topic: Script School - Page: 41
One possible solution for the color, could be:
effect_stems 'kick' ? effect_stems 'vocal' ? blink 600ms ? color 'red' : color 'blue' : color 'red' : effect_stems 'vocal' ? color 'blue' : color 'gray'

where the last color is to your choosing. gray or black (off) or .. for the pad color when its NOT Kick or Vocal.

Not tested.

PS
I prefer when creating a blinking pad.. to also change the intensity also during the blink, so maybe the blink part of the script becomes:
blink 600ms ? color 'darkred' : color 'blue'

if one's LEDs allow for that.
 

Inviato Mon 30 Oct 23 @ 2:32 am
locoDogPRO InfinityModeratorMember since 2013
I don't know what browser ElementDJ is using but the stylised ‘ “ are not compatible within the script engine.
@IIDEEJAYII I fixed the code block in your reply
 

Inviato Mon 30 Oct 23 @ 5:16 am
Thanks Locodog.. great catch :)

I copied and pasted from OP script.. (not tested)
(and now don't see the stylized single quote in the OP)



 

Inviato Mon 30 Oct 23 @ 6:34 am
@Locodog

Could you elaborate on this as it sounds like it could be interesting:

-Filter folders can use `` to include script as values to compare to
script in filters, worth it's own topic, you can now get some value from a track and use it in a filter.
I think I'll demo a circle of 5ths filter.
 

Inviato Mon 30 Oct 23 @ 11:34 am
locoDogPRO InfinityModeratorMember since 2013
@DJPhallus when I feel upto it, I've had a few interactions recently, one really positive and several others that treat me like I'm gpt.
The difference left me feeling pretty sour.

unrelated a bit of housekeeping - remembered an old short post I didn't link in the index; Appending a tag
 

Inviato Fri 03 Nov 23 @ 6:24 pm
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
90%