Connexion rapide:  

Forum: General Discussion

Sujet Script School - Page: 25.55
locoDogPRO InfinityModeratorMember since 2013
saved_loop 16 & eq_low -80% & effect_active 'reverb' & eq_low -80%
 

Posté Fri 01 Apr 22 @ 7:33 am
Thanks for the quick response. LOCODOG, do you think, can create a new thread in the forum "User scripts and their description" so that users can share their developed scripts. Without discussion and questions, just a script and a description - what does this script do if you register it on a certain button or slider.
 

Posté Fri 01 Apr 22 @ 10:20 am
locoDogPRO InfinityModeratorMember since 2013
We had a page for that but it kind of got filled with inaccurate stuff that was confusing more than helpful. so it was locked
however I can update that page still, so just post here, if it's straight forward, I'll remove the post from this thread and I'll post in to the depot

http://www.virtualdj.com/wiki/VDJScript%20Examples
 

Posté Fri 01 Apr 22 @ 10:42 am
You need a certain form to demonstrate your script, so that all users use the same form of description of their script.
for example , this form:

the name of the device on which the script is written is a BUTTON / SLIDER / HANDLE / JOGSHUTTLE or LED.

Description: (a detailed description of what will happen to the controllers if you activate this script).

Script text:

Decryption of the script:
----------------------------------------------------------------------------------------------------------------------

full form example:

BUTTON

Description: If you hold down the shift key on your controller and press the play button, then the track that is playing on this deck is cloned to the opposite deck.

Script text: var "$shift" ? clone_deck : play_pause

Decryption of the script: if you hold shift and press play, the track is cloned: otherwise (without holding shift) the button will work as play_pause.
-------------------------------------------------------------------
Naturally, this forum needs a good moderator, such as LOCODOG, who, even with his eyes closed, can see the flaws in the scripts.
 

Posté Fri 01 Apr 22 @ 1:44 pm
skyzo76PRO InfinityMember since 2016
Hello,
I have a problem with this : before I use Diy controller with script inside "device" and it separate slider volume deck 1 and slider volume deck 2.SO i use a variable that I call "bothfader" to sometimes assign some decks on 1 volume fader, ex one fader for deck 1/2 and sampler and with this variable i can switch easily between some settings...BUT now, I work with a reloop ELITE and the slider for the volume are the same assignement (midi)for deck1 or deck2 so when you want to script a specific code for the slider 1 and deck 1 (exemple) it will do it on the other slider too...because there both called volume, is there a way to separate the settings of those slider (because i do not have the .xml of the "device") i guess I must find a variable for a specific deck ???
 

Posté Mon 18 Apr 22 @ 10:07 am
locoDogPRO InfinityModeratorMember since 2013
action_deck X ?
or
device_side X ? for these types of cases
 

Posté Mon 18 Apr 22 @ 10:19 am
skyzo76PRO InfinityMember since 2016
thanks locodog for the respons! yes it works when "fake fader" are disabled but if I want to keep the fake fader eq etc..it dont work...i don't know if i am wrong but when all "fake" are able (not disable) sound is better.
 

Posté Mon 18 Apr 22 @ 7:28 pm
locoDogPRO InfinityModeratorMember since 2013
show me your script
 

Posté Mon 18 Apr 22 @ 8:18 pm
skyzo76PRO InfinityMember since 2016
hello locodog/
here is the test of my script...so on the "skin" for those code, everything works fine but have no impact on "output" so it doesn't affect the output volume but we see slider moovin on the skin..

action_deck 1 ? deck 1 volume : action_deck 2 ? deck 2 volume
OR
action_deck 1 ? var "$BothFader" 1 ? deck 1 volume & deck 2 volume : deck 1 volume : action_deck 2 ? deck 2 volume

when I add a fake mixer off , everything is good (but Im afraid to loose the "fake mixer" avantage)
action_deck 1 ? fake_mixer off & var "$BothFader" 1 ? deck 1 volume & deck 2 volume : deck 1 volume : action_deck 2 ? fake_mixer off & deck 2 volume

(I find that fake mixer off (on the ONINIT command) affect the quality of the cross fader but I didn't test it for a long time)..
 

Posté Sat 23 Apr 22 @ 7:47 am
locoDogPRO InfinityModeratorMember since 2013

BRACKETS IN SCRIPT


So huge it gets a title box...
BUILD 6920

Oh boy, this doesn't quite tear up the rule book, [because the old rules still work] but it comes close, maybe takes the old rule book and puts it on a high shelf out of the way, because we have another newer rule book and it's way better , it changes a lot of ways of doing things.

Play along at home, do these simple examples and after a few you won't need to really think how to do them you'll just know [and be ready for something else]

We'll start with the old way with a simple example of nested queries

So we have a button, if deck 1 is playing do nothing, if not playing play deck 3,
deck 1 play ? nothing : deck 3 play

but aside from that, we also want if deck 2 is playing do nothing, if not playing play deck 4,
deck 2 play ? nothing : deck 4 play


so combining those we have to write it like this
deck 1 play ? nothing & deck 2 play ? nothing : deck 4 play : deck 3 play & deck 2 play ? nothing : deck 4 play

hard enough for some to understand but I hope you can read what is happening there.

So the new method with brackets
( deck 1 play ? nothing : deck 3 play ) & (deck 2 play ? nothing : deck 4 play )

now I guess that got a whole lot easier to understand what's happening.

This alone is huge, I have a script right now and it needs to check 6 things, so the old way to do it right [cover every possibility] took 63 queries, that was 11,000 chars of script.
[and very close to my limit of too annoying to work with]
the new method, just needs 6 queries, it cut the script down to like 1600 chars [it sounds a lot but it really isn't]

but wait, there's more. && query
a different example, let's say; if deck 1 is playing & deck 2 is playing ? yes both decks are playing then play deck 3 : it is not true both decks are playing, do nothing.

old method
deck 1 play ? deck 2 play ? deck 3 play : nothing : nothing

easy enough but

brackets method
( deck 1 play && deck 2 play ) ? deck 3 play : nothing

the && is important, it's like if both of these are true, return true/1 to the query, if one or both are false return false/0 to the query.

this above is query side brackets, it could be called a && query or a AND query, [&& or AND are name for common logic gate in digital electronics ]
it was sort of possible before with this
param_equal `deck 1 play && deck 2 play` 1 ? deck 3 play : nothing

same kind of thing, if both evaluate as true it returns true/1 to param_equal, if so, does 1 = 1 ? yes, deck 3 play , if it doesn't return true/1 to param_equal then does 0 = 1 ? nope, do nothing.
there is also another similar old way but it's even move typing and even more confusing so I won't mention it further as it was never a good way.

3rd awesome thing brackets do, relates to script deck focus, something I should have prattled on about before but forgot. It's a bigger script thing. [and it used to be really problematic]

consider a custom_button on deck 1, if we gave it this script
play

we press it and deck 1 plays, it knows it's a deck 1 button
now what if we had this as a deck 1 custom button

play & deck 2 play & effect_active 'echo'

both decks play, but it's deck 2 that gets the echo, because the script deck focus was moved to deck 2 with "deck 2 play", until another deck is specified it will act all commands on the last called deck.[last called in the script]

now look at these [still deck 1 custom button]
play & ( deck 2 play ) & effect_active 'echo'


now look at this [still deck 1 custom button]
( deck 2 play ) & play & effect_active 'echo'

these cases it's deck 1 that gets the echo, the script deck focus to deck 2 is contained in the brackets.

now try this,
( deck 2 play & effect_active 'distortion' ) & play & effect_active 'echo'

deck 2 gets distortion, deck 1 gets echo
now you might be thinking, "that's not that good, you could just rearrange the script to get the same result, And you're right. But this is only a simple explanation, bigger scripts that act on several decks this is a big pain saver.


This one next is 50:50, it probably more 90:10, It's not a feature or ability, it's just how it works, I think the devs made the right decision, but it still could be "ummm not sure" how it will work just by reading it the first time.
Read this what do you think should happen?
( wait 8bt & effect_active 1) & ( effect_active 2 )

before I knew, during testing I was 90% sure we would get
effect_active on slot 2 instantly & effect_active on slot 1 after a 8 beat wait and that's what we get. [the "wait" is contained in brackets]

Final thing, the more curious of you might be asking "can brackets in brackets?" and the answer is YES they can!,
this isn't a sensible example just the first one I thought up to prove the concept
deck 1 level 1.0 & deck 2 level 1.0 & deck 3 level 1.0 & wait 2000ms & ( deck 1 play ? ( deck 2 play ) & level 0.5 : (deck 3 play ) & level 0.0 ) & level 0.75


Quiz time, deck 1 is currently playing, you press this button above, what level is deck 1, level is deck 2, level is deck 3, what other deck starts playing because of this button press?

Answers
If you get this, you get all of it.

I need to go back and see what topics need updating now.
 

Posté Fri 29 Apr 22 @ 8:16 am
locoDogPRO InfinityModeratorMember since 2013
the above was huge but that's not everything for this month, a good few script changes & a new verb [ooooh shiny]

-var_equal, var_greater and var_smaller support script as second parameter
not quite worthy of a title box but now these var_* scripts can compare vars against things and not just other vars. And why not, it'll be nice to use them more.

-search_playlists can accept script parameter, search script parameter passes deck correctly

so
search_playlists deck

deck here is literal not a stand in, 4 letters, d e c k,
the script will search for the playlists that hold the track on deck

plus it can also accept a script as a param to say maybe search playlists of what you're looking at in the browser. [example coming] [code][/code]

-goto_cue +1 also cycles through cues with other types than cue
not a new script thing but it deserves mention, previously goto_cue +1 would miss hotcues that are beat anchors, but stop would cycle them.
So yes little poi you can be a beat anchor and a hotcue and we'll just accept you as you are. Now be happy.

-browser_gotofolder can accept script parameter.
Cool cool cool makes navigation that bit easier.

-add get_browsed_folder_path
Shiny new verb, 3 people all asked the same sort of question in a few days needing the full path of what is being looked at in the folder list, the devs thought it would be handy to have too.

-Support "quick_filter 1 on" and "quick_filter 1 off" script
explicitly switch quick filters on / off - marvellous

That's all the script stuff added in the last month.
Added in, in a just month, no huge song and dance, get places, search for stuff, filter stuff, compare stuff, continual improvement.
 

Posté Fri 29 Apr 22 @ 9:29 am
locoDogPRO InfinityModeratorMember since 2013
 
repeat_start 'strobe' ? on & cycle strobe 4 : off & cycle strobe 4 & repeat_start 'strobe' 25ms -1 &
( var strobe 1 ? param_smaller 'get_beat_bar 4' 0.5 ? set strT 0 : set strT 1 :
var strobe 2 ? param_smaller 'get_beat_bar 2' 0.5 ? set strT 0 : set strT 1 :
var strobe 3 ? param_smaller 'get_beat_bar 1' 0.5 ? set strT 0 : set strT 1 :
var strobe 0 ? repeat_stop 'strobe' & set strT 0 : ) &
var strT 0 ? effect_active negative off : effect_active negative on :



Practical example of brackets in scripts, previously where we
set strT 1
we'd have to write
effect_active negative on

likewise with set strT 0 & effect_active negative off,
not a massive saving in this example but goes a long way for readability.
 

Posté Fri 29 Apr 22 @ 10:58 am
Hi all,

I made a few buttons that seem to be performing well (at least in the situation I'm using them for) and I'd like to post this one first:

This is a standalone custom button for those who don't use their mixing console hardware very much. What it generally does is it mixes the left source or right source after dropping loop timing then uses a lower volume explosion. This most likely is not made for mixing experts and users who mainly use their hardware. I designed it for myself who mostly do outdoor mobile parties where my mixing board is slid inside my roadcase to protect it from the outdoor elements. With that being said I use automix most of the time and this button will probably make it easier for me to do an alternative automix during dance segments.

For best effect the first cue point is best set for the next song ahead of time. It's more geared to dance music with a decent beat.

Instructions:
1) Set cue point 1 to a point in the upcoming song where a beat is happening (Let's say that is song B)
2) On the opposite deck with song A playing, click the button with the below code which will end the current song A and start song B.

CrossFade MixExplode
crossfader 0% ? 
deck left select &
deck right hot_cue 1 & deck right play & sync & auto_crossfade 50% &
deck left select &
effect_active "flanger" on &
loop 2 &
wait 3bt &
loop 1 &
wait 3bt &
loop 0.5 &
wait 2bt &
loop 0.25 &
wait 1bt &
loop 0.125 &
wait 1bt &
sampler_volume_master 50% &
sampler_bank 1 &
sampler_play_stop 3 &
sampler_volume_master 50% &
deck left select &
effect_active "flanger" off &
deck left play_pause &
deck left loop 8 &
auto_crossfade 100% &
deck right select :
deck right select &
deck left hot_cue 1 & deck left play & sync & auto_crossfade 50% &
deck right select &
effect_active "flanger" on &
loop 2 &
wait 3bt &
loop 1 &
wait 3bt &
loop 0.5 &
wait 2bt &
loop 0.25 &
wait 1bt &
loop 0.125 &
wait 1bt &
sampler_volume_master 50% &
sampler_bank 1 &
sampler_play_stop 3 &
sampler_volume_master 50% &
deck right select &
effect_active "flanger" off &
play_pause &
deck right loop 8 &
auto_crossfade 0% &
deck left select


Note that it does set the previous song to a loop 8 which can be removed in the code. I might change that on my live gig in the future but right now my thought is that I might want to return to the same loop again after playing the new song.
 

Posté Tue 07 Jun 22 @ 12:52 am
Warnings about the previous script:
It's my thought that anyone using virtual for longer than a few weeks will understand that mixing songs too far apart in bpm are not recommended for this type of button unless it's modified.

Adding pitch_reset to the end of each if condition will reset each songs pitch back to 0%
 

Posté Tue 07 Jun 22 @ 12:57 am
SveninoPRO InfinityMember since 2009
 

Posté Mon 27 Jun 22 @ 6:29 pm
locoDogPRO InfinityModeratorMember since 2013
@Svenino it's just

browser_scroll +/- 1
 

Posté Mon 27 Jun 22 @ 7:36 pm
SveninoPRO InfinityMember since 2009
Hello Locodoc, but it isn´t.
This would be TOO EASY.
Its not about to move the cursor position, but the visible position.

I made a script to jump to a specific folder (have many of them).
(browser_gotofolder 'karaoke' ...)
Now it may be that this folder is very downstairs and the subfolders are not visible.
So I have to move the slider up above to see the (sub)folder(s).
But I want this to automate like:

browser_gotofolder 'karaoke' AND move it to the top of the screen...
Maybe the screenshots (link upstairs) do make clear, what I need...
 

Posté Mon 27 Jun 22 @ 8:44 pm
locoDogPRO InfinityModeratorMember since 2013
visual pos is based on scroll pos, try scroll down 20 & scroll up 10
 

Posté Mon 27 Jun 22 @ 10:02 pm

Sooo Loco Im trying to use the info/sideview area to have a list of compatible songs to the songs on deck.
Ive created a filter titled Immediate compatible with this script.
"Bpm Difference < 5 and Key Difference < 1 and Grouping contains Hot"
this is ok but I wanna have more criteria. Like I use the grouping field as a way to create my DJ library. it is something like.... "year/genre/Hot" So I want a criteria that says the grouping area entries must match. Now grouping area can have multiple entries, each entry is separated with a comma.
Is this doable?


 

Posté Tue 28 Jun 22 @ 12:51 am
SveninoPRO InfinityMember since 2009
locodog wrote :
visual pos is based on scroll pos, try scroll down 20 & scroll up 10


Thanks Locodoc, You brought me to this little trick, wich does the job:

browser_gotofolder "SCHLAGER" & browser_scroll +16 & browser_scroll -16


This brings nearly every selected folder in a toppy position.
Just Folders in "last row" means with less than 16 folders underneath fail this procedure.
So needed folders have to be placed in the beginning of the list.
 

Posté Tue 28 Jun 22 @ 9:53 am
55%