Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: How to set a variable in the mapper?
I have an entry for a slider (LTslider) in my definition file that I'm trying to assign its value to a variable (LTvar). I assumed putting the following in the LTslider entry would work:

set 'LTvar'


but it doesn't set the variable at all. Even setting a value directly (set 'LTvar' 40%) in the Mapping interface does nothing.

The LTslider entry works fine if I assign it to the crossfader. "set 'LTvar' 40%" works when I assign that to a button.

How do I send the slider's value to a variable?
 

Posted Tue 17 Aug 21 @ 8:31 pm
locoDogPRO InfinityModeratorMember since 2013
you mean mapping file [not definition, definition file assigns midi signals a name, mapping file assigns script to a name, (small matter) ]

param_cast & set 'LTvar'
 

Posted Tue 17 Aug 21 @ 8:45 pm
locodog wrote :

param_cast & set 'LTvar'


Thank you for that quick reply! Yes that works! I have worked through your tutorial on params, but didn't think to add it there.

I assumed in the Mapper the slider value is passed as the implicit parameter to the script ("set 'myVar'" or crossfader becomes "set 'myVar' .82" and "crossfader .82"). Why does it work for crossfader but not set? I'm trying to understand what's happening in the message passing.

 

Posted Tue 17 Aug 21 @ 10:55 pm
locoDogPRO InfinityModeratorMember since 2013
it should work to be honest.
perhaps since the crossfader is a global you should use a global var [prefix var name with $ ]

crossfader & set '$LTvar'


 

Posted Tue 17 Aug 21 @ 11:14 pm