Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Switch custom mapping with variable
Dear,
I'm probably not enough expert in VDJ Script language but I tried many thing and I cannot achieve my goal:
- I have a variable set by two buttons of my controller, one increments, the other decrements,
- the goal is to allow multiple page
- I would like to switch to a mapping "Mapping X" with X replaced by my variable

But I cannot write expression ...
custom_mapping "Behringer X-Touch MINI MC" "2"

if page number is fixed, it works but when using variable it is never replaced and using get_text and get_var together with inverted quote is not possible ...
 

Posted Thu 21 Nov 24 @ 5:29 pm
locoDogPRO InfinityModeratorMember since 2013
custom_mapping isn't part of the script language.

I don't see why you're complicating it, if variable is a value then you know the mapping you want to select so you can do it that way

var myVar 1 ? controller_mapping keyboard variation1 : var myVar 2 ? controller_mapping keyboard variation2 : ...


But do you really need a variable? You can query what mapping you're on now and you know where you want to go next
controller_mapping keyboard variation1 ? controller_mapping keyboard variation2 : controller_mapping keyboard variation2 ? controller_mapping keyboard variation3 : ...


But if you really must use a var as part of the string,
set variable, cast as text, this will call controller_mapping "keyboard" "1"

set myFloatVar 1 & get_var myFloatVar & param_cast text & controller_mapping keyboard
 

Posted Thu 21 Nov 24 @ 6:09 pm
locoDog wrote :
...


Wow, great, I was not aware of "param" transmit between actions ... great, you're genius. I need variable because I put "page number" inside the skin, my controller did not have a way to show it.

Many thanks !!!
 

Posted Thu 21 Nov 24 @ 10:53 pm