Accesso rapido:  

Forum: VirtualDJ Technical Support

Topic: Mapping velocity-sensitive rotary encoder to pitch
I have a DJ Tech Tools Midi Fighter Twister. It has a "velocity sensitive" rotary encoder mode where it sends higher deltas when you twist it faster. I am trying to map it to control the pitch on my decks, where the pitch will change faster when I turn the knob faster.

More info:
If I rotate the encoder slowly, the CC value comes in at 0.49 or 0.51
If I rotate the encoder quickly, the CC value comes in around 0.35 and 0.65

General idea
I understand the math, but can't seem to get the current pitch value added to it. Something like:

param_add -0.5 //(to get the delta of the input, +/-0.1 thru +/-1.5)
& m_multiply 0.1 //(to scale down the rate of adjustment)
& param_add get_pitch //(to add the original pitch value, where 0.5 is the middle)
& deck 1 pitch //(to assign the new pitch value)


Issues and what I've tried
BUT, it seems like
get_pitch
is returning 0 no matter where the current pitch value is. This verb appears in the verb list [here](https://www.virtualdj.com/manuals/virtualdj/appendix/vdjscriptverbs.html), but not in the list in the software, so I wonder if it's been deprecated.

I am able to assign the controller's pitch value to a variable using set_var 'cur_pitch' `deck 1 pitch`, verified in the var list. But again, I can't seem to add it to the input param:

set_var 'cur_pitch' `deck 1 pitch` //(sets 'cur pitch' var to current pitch where +/-0% is value 50, verified in the var list)


But...
This still adds 0 to the param:
param_add cur_pitch

This doesn't work, either:
param add `get_var cur_pitch`

And this doesn't work, either:
param add `get_var 'cur_pitch'`


I even tried this, to no avail:
param_add `deck 1 pitch`


I am able to do this, but of course it ignores the encoder velocity:
param_greater 50% ? deck 1 pitch +0.01% : deck 1 pitch -0.01%


I wouldn't mind using the relative assignment (+x.x% syntax), but I couldn't figure out how to add a value using a variable or the input parameter, so I started working on the param_add approaches I first mentioned, to add the input value and the current deck value, then do an assignment to that new absolute value.

I've spent an embarrassing amount of time on this, I'd love some help!

Thanks!
 

Inviato Fri 16 Dec 22 @ 4:55 pm
Well I got something working:
param_add -0.5 & param_multiply 0.05 & set_var 'delta' & param_add "`get_var 'delta'`" `deck 1 pitch` & deck 1 pitch


But I still don't fully understand why the second param_add here didn't add the implicit value and the deck 1 pitch:
param_add -0.5 & param_multiply 0.05 & param_add `deck 1 pitch` & deck 1 pitch


Thanks to anyone who pondered or can explain what I'm missing!
 

Inviato Sat 17 Dec 22 @ 2:44 am