Ingreso rápido:  

Forum: VirtualDJ Plugins

Tema: Basic Scripting Question

Este tópico es antiguo y puede contener información incorrecta para la nueva versión.

PhilWPRO InfinityMember since 2011
Hi, I am new to scripting and thought I would ask here after reviewing the wiki and a number of examples and getting a bit frustrated.

I want to set a button to gradually fade a deck then stop it. I have it working to fade the deck gradually with:

deck 1 repeat_start_instant 'fadeout' 50ms 10 & deck 1 level -10%

But when I add the part to pause the deck it stops immediately when I press the key/button:

deck 1 repeat_start_instant 'fadeout' 50ms 10 & deck 1 level -10% & deck 1 pause

I realize I need to somehow let the fade finish before the pause kicks in. Rather than keep getting frustrated, I thought to ask to folks here.

Also, I am trying to use global variables for the number of repeats (10) and amount to reduce the fader (10%) but those don't work properly - var_list shows the right values for the variables but when I substitute them into the script using '@$varname' it works for the -10% (var is set to -0.1) but not the number of repeats (var shows as 10.0000).

I realize this is fairly basic so I'll be grateful for any help.
 

Mensajes Sat 20 Oct 18 @ 4:59 pm
Yes you need to ask how far it has gotten, and only pause if it has finished. So add something like
Deck 1 level 0% ?
After the last & and before the pause
 

Mensajes Sat 20 Oct 18 @ 9:09 pm
PhilWPRO InfinityMember since 2011
Thank you that was it exactly. This does exactly what I wanted:

deck 1 repeat_start_instant 'fadeout' 50ms &
deck 1 level -10% &
deck 1 level 0% ? deck 1 pause & repeat_stop 'fadeout'

I took the number of repeats of out the repeat_instant_start because the test for a level of zero is what I really want. And I added the repeat_stop otherwise it keeps turning the volume down forever (because I took out the fixed number of repeats).

Thanks again
Phil
 

Mensajes Sat 20 Oct 18 @ 9:40 pm


(Los tópicos y foros antiguos son automáticamente cerrados)