Ingresar:     


Forum: VirtualDJ Skins

Tópico: Setting pitch from variable
Hello,

I have been trying to write a script to set the pitch of a deck from a variable but no matter what I try, I cannot get the pitch to change.

Consider this simple example:

set 'test_pitch' 0.5 &
deck left pitch `get_var 'test_pitch'`


I would expect the pitch of the left deck to reset to 0 pitch, but nothing happens.

Am I misunderstanding something about how the variable syntax works?

VirtualDJ v2026 b9005

Thanks in advance.
 

Mensajes 3 hours ago
pitch doesn't accept actions as a parameter, it isn't a script wide convention that you can wrap in `` and it will be parsed , some verbs do but it is a case by case thing, for verbs that don't you get first then cast

get_var 'test_pitch' & param_cast & pitch

Unless a script description mentions it accepts an action as a parameter, it won't.

read this for more info, maybe 4 - 5 pages back from newest
https://www.virtualdj.com/forums/223743/General_Discussion/Script_School.html
When to use apostrophes, quotes, or backticks. ' " `
Posted Sun 20 Apr 25 @ 11:00 pm
 

Thank you, that solved my problem.

Out of interest, what does param_cast do when you don't provide a type?
 

it just passes it with changing it, your set gives it the type float so that's how it's dealt with.