Quick Sign In:  

Forum: General Discussion

Topic: VDJ Script problems

Dieses Thema ist veraltet und kann veraltete oder falsche Informationen enthalten.

Trying to write a button for a quick break. The goal is to 'breathe' between two shaders or video tracks and have a third playing audio. Unfortunately I can't find any good syntax documentation on this scripting language and I'm finding it difficult to piece this all together.
When I run:
repeat_start_instant 'peebreak' 1000ms & param_bigger crossfader 50 ? auto_crossfade 250ms 35% : auto_crossfade 250ms 75%
The little mouseover indicates the conditions are correct but it never tries to go back and forth.
Times are just for testing but I don't think that's the relevant issue.
 

geposted Fri 14 Jun 19 @ 11:02 am
You have a typo there: param_bigger crossfader 50 ?
This tries to compare crossfader value with 50 (absolute number)
I guess that you wanted it to be 50% right ?

So if you change your script to
repeat_start_instant 'peebreak' 1000ms & param_bigger crossfader 50% ? auto_crossfade 250ms 35% : auto_crossfade 250ms 75%

it works fine...
 

geposted Fri 14 Jun 19 @ 11:41 am
So I tried that. It did not work. It only goes to 35%. If I move the slider it at a number below 50 but higher than 35% it still goes back to 35% after the interval.

edit: okay I accidentally clicked on another command and rewrote the second auto_crossfade. Put it back in and now it only goes to 75%. This language is weird.
edit2: okay restarted the program. Now it works. You're good peoples.
 

geposted Fri 14 Jun 19 @ 11:54 am
I don't know what you're really trying to do, but the logic you used is:

1. repeat_start 'peebreak' 1000ms &
This tells the software to do the same action once every second.

2. param_bigger crossfader 50% ?
This works as IF condition is true THEN do this ELSE do that
In this particular example you check the crossfader position against a fixed value (50%)

3. auto_crossfade 250ms 35%
This is the "do this" part of the IF ... THEN ... ELSE ... statement
It moves crossfader from it's current position to 35% within 250ms

4. :
Nothing fancy here. This is the ELSE part (it just means ELSE)

5. auto_crossfade 250ms 75%
This is the "do that" part of the IF ... THEN ... ELSE ... statement
It moves crossfader from it's current position to 75% within 250ms

Now: One thing you need to be careful with is the fact that you change the value you compare.
That's not exclusive to VirtualDJ and it's script language. That's generic programming 101

With simple "human" language your script could be described as:
Every second check the crossfader and if crossfader is less that 50% move it to 35%, else move it to 75%

Now let's rephrase it like this:
Every second check the crossfader and if crossfader is less that 50% move it to 75%, else move it to 35%
(I just flip the numbers the crossfader must go to)

The script will become
repeat_start_instant 'peebreak' 1000ms & param_bigger crossfader 50% ? auto_crossfade 250ms 75% : auto_crossfade 250ms 35%

If you try this script you'll see that the crossfader doesn't stay put. It flips sides every second. Why ?
Because you modify the value you're checking in a way that it creates an endless loop.

That's why you need to be careful when you modify the value you check on your query
 

geposted Fri 14 Jun 19 @ 12:42 pm


(Alte Themen und Foren werden automatisch geschlossen)