Quick Sign In:  

Forum: General Discussion

Topic: Script School - Page: 2.85

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

locodog wrote :


repeat_start_instant "name" 33ms & get_beat & param_greater X% ? level 0% : level 100%



Since I need to sync the fader cuts to the on air deck, but act on the opposite deck, can the repeat look at one side and act on the other? That was where I ran into trouble before using a similar method. So for example:

repeat_start_instant "name" 33ms & deck right get_beat & param_greater X% ? Deck left level 0% : deck left level 100%


Also it looks like this would only cut one time per beat, any way to get it to cut in when the beat value is at 1% 25% 50% and 75%, and out at 12.5% 37.5% 62.5% and 87.5% for a quarter beat transform?

Thanks for the reply loco. I have used a lot of your advice and tips to up my game.
 

geposted Wed 09 Jan 19 @ 8:34 am
PachNPRO InfinityMember since 2009
Sure it's possible.
You can also adress a fixed deck by using "deck 1" instead of deck left/ right. If you are using more than two decks deck left/right is the currently active deck on each side.
 

geposted Wed 09 Jan 19 @ 8:40 am
locoDogPRO InfinityModeratorMember since 2013
Thanks PachN.
Yeah just specify what deck you want it to read/act upon
deck 1 get_whatever & deck 2 do_something
ZeroZuluBrav0 wrote :


Also it looks like this would only cut one time per beat, any way to get it to cut in when the beat value is at 1% 25% 50% and 75%, and out at 12.5% 37.5% 62.5% and 87.5% for a quarter beat transform?


You're right (one cut per beat), I kept the explanation simple, take a second to think what you want the script to do
Above this but below that ? Yes,drop volume : No, above that but below another value ? Yes, raise volume : No above the other... below a 4th value ?
So it will look something like this

repeat_start_instant "name" 33ms & deck right get_beat & param_greater 0% ? param_smaller 12.5% ? Deck left level 0% : param_smaller 25% ? deck left level 100% : param_smaller 37.5% ? deck left level 0% : etc etc

If really needs be I could make a plugin to monitor masterdeck to cut another deck but even plugins have a scan limit of ∼15ms
 

geposted Wed 09 Jan 19 @ 10:25 am
freppaPRO InfinityMember since 2002
Edit...fixed
 

geposted Thu 10 Jan 19 @ 6:10 pm
You may have already explained this, but I can't find it, so here goes

You do you do a general AND after a CONDITION (?) block

So like
(A ? B : C) & D

I relialize that you can just put D in the front
D & A ? B : C
but the D part may also hold a condition

You can also do
A ? B & D : C & D
But again D may be complex in itself

So is there a general way to handle for instance :
(A ? B : C)
&
(D ? E : F)
&
(G ? H : I)
&
(J ? K : L)
 

geposted Thu 24 Jan 19 @ 2:52 pm
locoDogPRO InfinityModeratorMember since 2013
Not with straight script, I've put in requests to execute a "second script" with some sort of symbol after the end of the false reply (something like A ? B : C * D ? E: F) but it's either low in the todo pile or it's in the not happening pile.

However, you can do what you want by another way,
Lets say you want to run all 4 queries from one button press, without making it multibranch
(avoid D query in the reply B and C, and G query in the reply E and F etc)

Use a pad page :-), simply put each single query on a single pad then your calling button performs the script
pad 1 & pad 2 & pad 3 & pad 4

To work properly there needs to be a new verb to store and call pad pages, I'll add it in wishes.
 

geposted Thu 24 Jan 19 @ 7:43 pm
locodog wrote :
Use a pad page :-), simply put each single query on a single pad then your calling button performs the script
pad 1 & pad 2 & pad 3 & pad 4


Nice idea!
Let me try that :)
 

geposted Thu 24 Jan 19 @ 8:27 pm
locoDogPRO InfinityModeratorMember since 2013
Shader stuff

How do, has been awhile but this I think shader scripts need to be written down.
klausMogenson, I has a video on this subject, his focus is his workflow (shaders as audioonlyvisualisation)


That's his workflow, below is mine (shaders on decks)

Selecting specific shaders
effect_string "shader" 1 "shaderName"

So we want to set a string on a effect
the effect we want to set the string on is the "shader" fx
the string number (some fx have several effect_stings) is number 1
the string we want to send is "shaderName"
Now "shaderName" can be either the shader's name as given by it's creator or it can be the address the shader can be found at the shadertoy site something like
"GdAFMK" (best guess is some sort of base64 filing system that means very little to us humans)

To display the current shader name (and I'll assume you want the given name because you're not a computer) use
get_effect_string "shader" 2
string 2 because while the machine is smart enough to set the shader by either given or indexed name on string 1, if you get string 1 it always returns the indexed name, (must be under the hood stuff) string 2 is the "pretty name"

Ok a specific shader at a specific time, great, what else can we do?
Well how about the next or previous (in the list) shader, do that like this..
effect_string "shader" 1 +1
effect_string "shader" 1 -1

What about shader folders, yep we got that covered, with effect_string 3
effect_string "shader" 3 "B&W"

(I have a folder called "B&W" for black & white shaders)

okey cokey, how about the buttons "auto-change" & "beatMove"
They're just fx buttons and are toggled like so
effect_button "shader" 2 (change)
effect_button "shader" 3 (move)

I've covered buttons earlier, what with fxslots, no slot, on, off , toggle so I'll avoid repeating myself.

effect_button "shader" 1 opens the shader position box if you were wondering. (well done for wondering)

Ok just a few sliders to cover
effect_slider "shader" 1

this one picks the shader, but I'm honestly not sure how useful it is (difficult to use with precision), I suppose time will tell.
I suppose it might be better if it obeyed the folder, but currently it just picks from the "all" folder.

effect_slider "shader" 2
this one does transparency.

I think that's it for shader scripts to date.
Any topics you'd like covered just ask.
I might cover the setting action next as it's one that users need quite often.



*post script*
This post lead to quite a bit of head scratching, partly my fault for focusing on my personal work flow (this instance a shader on a deck)

So some clarification
In instances of audioOnlyVisualisation or videoOverlay

* For the video source for audio tracks:
effect_string "audioonlyvisualisation" 1 +1
Since the slot is specified, you don't specify the effect as well, so it depends on shader already selected as audio only visualisation.

* For video effect overlay
deck master effect_string "video" 1 +1
If shader is selected in the video slot
or
deck master effect_string "shader" 1 +1
Independent of which slot it is currently selected in (or none at all)
 

geposted Wed 27 Mar 19 @ 10:36 am
 

geposted Tue 02 Apr 19 @ 6:42 am
locoDogPRO InfinityModeratorMember since 2013
I missed your msg mitchmasha, yeah they'll get added.

Right the real reason I'm posting, New action in 4909 mic ducking.

mic_talkover 20% 1000ms
this will gradually drop all decks and the sampler to 20% volume over 1000ms.
if you call the script without params (so just 'mic_talkover') it defaults to 30% over 400ms.
*edit*
for differing speeds
mic_talkover ? mic_talkover 19% 30ms & repeat_start 'wait' 40ms 1 & mic_talkover 100% 600ms & mic_talkover off : mic_talkover 30% 300ms

down to 30% in .3 seconds up to return level in .6 seconds
/edit
That's all for now but I'm sure some of you will welcome this.
 

geposted Sat 27 Apr 19 @ 5:46 pm
VDJ RonPRO InfinityMember since 2010
Locodog would you help with a script to activate a master effect like tellyvisuals. I might be being a little lazy but this could help a lot of people. I used "deck master..." but I don't think that activates a proper master effect?
Second thoughts if I have the effect in the correct slot just "master.." might now work.
Hm the extra buttons are on the decks..tellyvisuals does not work with a deck effect.
I'm gonna have to try again. Maybe a sub controller button script. I'm a little confused.
 

geposted Sat 27 Apr 19 @ 7:15 pm
locoDogPRO InfinityModeratorMember since 2013
Not sure what you're really after but here's my best guess
video_source_select 'TellyVisualsV' ? video_output off : video_source_select 'TellyVisualsV' & video_output on
 

geposted Sat 27 Apr 19 @ 8:48 pm
VDJ RonPRO InfinityMember since 2010
I copied that directly onto an F1 button but it did nothing. I've updated to 2018. The skin button works fine with a mouse click. Tellyvisuals will only run properly as a master effect and not a deck effect. I can control it with "deck master.." but that might be a deck effect.
This is pre and after mixer stuff.

What I want is it on all the time and overlaying the videos as a master effect. It should be easy? If I feel the need I also want to turn it off. I can do this using the laptop gui but would like a sub controller button.

After updating once again to 2018 the video effect slot looks a bit of a mess but the master effect slot looks ok.

Hm tellyvisualsV is an effect not a video source?
 

geposted Sat 27 Apr 19 @ 9:05 pm
locoDogPRO InfinityModeratorMember since 2013
Yeah the above script is a bit weird, single source is a bit clunky I'm yet to really understand when it will and won't work, this below is probably what you want
deck master video_fx 'tellyvisualsv'
 

geposted Sat 27 Apr 19 @ 9:26 pm
VDJ RonPRO InfinityMember since 2010
I was using deck master effect active "tellyvisualsV" and it appears to work. However Don, who should know said tellyvisuals won't work properly as a deck effect? Basically tellyvisuals does not know which deck is being used. I've been getting crashes.

The laptop gui buttons seem to work well and I had no crashes last night.
 

geposted Sat 27 Apr 19 @ 9:42 pm
VDJ RonPRO InfinityMember since 2010
deck master video_fx 'tellyvisualsv'

It works..

..but "deck" is still there?????
I'm not sure but I think deck might be a problem.

and removing deck ......master video_fx 'tellyvisualsv' does not work
 

geposted Sat 27 Apr 19 @ 9:50 pm
action_deck 1 ? holding ? sync & get_pitch_zero ? set 'syncON' 0 : set 'syncON' 1 : play_sync & deck 2 beatlock on & deck 1 pitch_reset 0.5% & repeat_start 'lightBPM' 200ms 100 & deck 1 pitch 'get_pitch_value' & get_pitch_zero ? repeat_stop 'lightBPM' & set 'syncON' 0 & deck 2 beatlock off & get_pitch_zero ? set 'syncON' 0 : set 'syncON' 1 : deck 1 set 'syncON' 1 : holding ? sync & get_pitch_zero ? set 'syncON' 0 : set 'syncON' 1 : play_sync & deck 1 beatlock on & deck 2 pitch_reset 0.5% & repeat_start 'lightBPM' 200ms 100 & deck 2 pitch 'get_pitch_value' & get_pitch_zero ? repeat_stop 'lightBPM' & set 'syncON' 0 & deck 1 beatlock off & get_pitch_zero ? set 'syncON' 0 : set 'syncON' 1 : deck 2 set 'syncON' 1

Hello, this is a script for the SYNC button on the WeGO controller. Now it smoothly lets the tempo go to the next track. And the button glows always when BPM is not 'get_pitch_zero'. Please express your opinion and correct mistakes. Thank you.
 

geposted Mon 13 May 19 @ 1:01 pm
locoDogPRO InfinityModeratorMember since 2013
Looks good, but you could avoid using var 'syncOn' if you are just using it to fire a LED
by just mapping the led to
pitch_zero ? off : on

Also you queried action_deck too early, you don't need it until just before beat_lock [not that it matters if it works, it works!]
This is my shot at it (untested)(led needs to be mapped seperate)

holding ? sync : play_sync & action_deck 1 ? deck 2 beatlock on & deck 1 pitch_reset 0.5% & repeat_start 'lightBPM' 200ms 100 & get_pitch_zero ? repeat_stop 'lightBPM' & deck 2 beatlock off : nothing : deck 1 beatlock on & deck 2 pitch_reset 0.5% & repeat_start 'lightBPM' 200ms 100 & get_pitch_zero ? repeat_stop 'lightBPM' & deck 1 beatlock off : nothing

holding
..? sync
..: play_sync &
....action_deck 1
....? deck 2 beatlock on &
......deck 1 pitch_reset 0.5% &
......repeat_start 'lightBPM' 200ms 100 &
......get_pitch_zero
......? repeat_stop 'lightBPM' &
........deck 2 beatlock off
......: nothing
....: deck 1 beatlock on &
......deck 2 pitch_reset 0.5% &
......repeat_start 'lightBPM' 200ms 100 &
......get_pitch_zero
......? repeat_stop 'lightBPM' &
........deck 1 beatlock off
......: nothing
 

geposted Mon 13 May 19 @ 2:39 pm
Thanks Loco! I'll pay attention to that.
 

geposted Tue 14 May 19 @ 8:22 am
locoDogPRO InfinityModeratorMember since 2013
repeat_start
repeat_start_instant
repeat_stop

repeat_start actions are possibly the most powerful of all vdj scripts, and they're really simple to get started with.

repeat_start_instant "giveThisAName" XXms Y & YOUR ACTION
XX the fastest it can repeat is about 25ms
Y the number of times your action will be called [optional, omit if you are going to stop the repeat_action manually, or you can use 0]

example
repeat_start_instant "stupidPlayPause" 468.75ms 32 & play_pause

press the button and instantly play_pause is called, then every 467.75ms [1 beat at 128bpm, I'm honestly not sure if it considers the fraction of the ms] play_pause is called again. All together play_pause will be called 32 times [including the first call], it's job is done and it stops.

before you try that out, set up another button
repeat_stop 'stupidPlayPause'
...because the repeat_action is annoying and listening to that for 16 beats would be painful. That just bypasses the count and stops it instantly.

repeat_start "stupidPlayPause" 468.75ms 32 & play_pause

this does the same thing but will wait 468.75ms before first performing the action.
Ok I put a manually put time in, how about vdj putting a time in dynamically? Strap in.
[POST EDIT The info below is dated, still functional so I'll keep it for now (and covers some useful concepts)
Build 6404 now allows the time param to be measured in beats.
It also allows the time param and the repeat count param to be set with variables. More info here
http://www.virtualdj.com/forums/223743/General_Discussion/Script_School.html?page=14.65 ]

To get ms/beat we need to 60,000 / bpm, but vdj has no param_divide action so we need to 60,000 * (1/bpm) that we can do
param_multiply "get_bpm & param_1_x" 60000
we could save this as a variable if we want
set 'oneBeatMS' `param_multiply "get_bpm & param_1_x" 60000`

Now how to give this value to the repeat_start
set 'oneBeatMS' `param_multiply "get_bpm & param_1_x" 60000` & param_cast 'ms' & repeat_start 'stupidPlayPause' & play_pause
Notice here we haven't included a time to the repeat_start [as the time is cast to the script]
We also haven't included a count, well we can't, cast values always go on the end and for repeat_start the first parameter is time, we have to make our own counter but it's not very hard.
To make a counter just after "play_pause" we will cycle a variable [cycle; increase or decrease by 1. cycle 'varName X, X being the number it will loop back round to zero] then query the value against our desired maximum.
if true we stop the repeat_start, if false we do nothing and let it carry on.

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

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

Isolated that works fine, for some scripts that will do, but what happens if you press this button while it is already running or call repeat_stop from another button.
The counter won't be right, let's reset the counter when we press the button.
set 'SSP' 0 & 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

That's about it, other than other beat lengths, say you want 1/2 beat, well
param_multiply "get_var 'oneBeatMS'" 0.5

set 'oneBeatMS' `param_multiply "get_bpm & param_1_x" 60000` & param_multiply "get_var 'oneBeatMS'" 0.5 & 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.
 

geposted Wed 29 May 19 @ 8:17 pm
6%