Sign In:     


Forum: VirtualDJ Technical Support

Topic: using variables as parameter values
Hey guys I have a simple question. On my controller I have a button which has this action script applied to it:

down ? set 'preFX' `deck 2 get_effect_title 1` & deck 2 effect_active 1 "Loop Roll" & deck 2 effect_button 1 on : deck 2 effect_button 1 off & deck 2 effect_select 1 `get_var 'preFX'`

It's a button which saves the current name of the first effect slot on deck 2 and replaces it with the "Loop Roll" effect which is then activated. When released it should load the previously saved effect.
Problem is I can't pass the variable content to the effect_select action. I also tried it with param_cast "text" `get_var 'preFX'` to no avail.

A workaround would be using bank_effect_load/save, but this too wont work as it will only revert effect slot 2 and 3 and not the first slot where I load the "Loop Roll" effect.

My question is if it is possible to pass a variable as parameter value?

Kind regards,
C
 

Posted Fri 10 Oct 25 @ 10:22 am
effect_select doesnt seem to accept `script`
btw, prefer get_effect_name instead of get_effect_title (which doesnt return just the FX name)

ah wait, this seems to work ...
get_var 'preFX' & param_cast 'text' & effect_select to set back the saved FX to slot 1

So try ..
down ? set 'preFX' `deck 2 get_effect_name 1` & deck 2 effect_active 1 "Loop Roll" & deck 2 effect_button 1 on : deck 2 effect_button 1 off & get_var 'preFX' & param_cast 'text' & effect_select
 

Hey man,
thanks for your reply. When I run your script, it opens the select dropdown when I release the button, but it wont load the previous effect unfortunately. I read somewhere that dynamic variable loading is not supported by the scripting engine... who knows. It's kind of annoying, I mean why give the functionality if I can't pass variables as a parameter ^^
Thanks anyway, I'll keep experimenting.
Kind regards,
C
 

I have the same problem:

param_delta & param_bigger 0 ? set '$fxslot1' `get_effect_name 1` : param_smaller 0 ? effect_select 1 `get_var '$fxslot1'`

then I tried

param_delta & param_bigger 0 ? set '$fxslot1' `get_effect_name 1` : param_smaller 0 ? get_var '$fxslot1' & param_cast 'text' & effect_select 1

I checked with var_list and the name of the effect is saved correctly to $fxslot1 but I can use that value as a parameter for effect_select 1 no matter what I try
 

@devs even my work around failed when testing from padpage param-+
param_cast text 0 & param_add `get_var $fxslot1` & param_cast text & debug



@Tobias Macha
I have other work arounds 😉 send it to a custom button

param_delta & param_bigger 0 ? set $fxslot1 `get_effect_name 1` : param_smaller 0 ? custom_button 9 "get_var $fxslot1 & param_cast & effect_select 1" & custom_button 9