Hi all! I'm just looking for a quick dirty fix for my midi controller's limited velocity output. Literally, if someone can help me write a little JS snippet that maps velocity from (20-110) to (10-127), I'll be the happiest of campers.

I did the math, and the function f(x) = (13x - 160) / 10 will linearly accomplish this.

Could someone tell me what JS code would take the input velocity value, and times-it-by-13-subtract-160-all-over-10, then spit it back out at this remapped velocity ?

The ultimate version of this would let you type in your controller's lowest and highest possible velocities, and let it remap it to (0-127) or whatever you choose, automatically. I'll be happy to just get mine working in the meantime though

THANKS!

Ferro