Set a custom range value

Valy20007

2010-02-06 17:34:40

Hi, I can't figured out how to make a normal midi knob with range value 0-127 to a custom one, 25-102, but i want to stretch the first value(0-127) to second one(25-102).I needed for controlling traktor EQ.I'm waiting for your reply.

Attigo

2010-02-08 05:39:48

Hi Valy20007,

To do this you will need to do something called 'upsampling'. What you really want is a whole number that both your 'ranges' divide into. Because MIDI doesn't support decimal numbers (therefore, neither does MT, it rounds up), this becomes a little tricky.

0-127 has 128 steps and 25-102 has 77 steps, so that number we are looking for is probably HUGE, so we will just settle for something close enough for this example:

128 x 3 = 384
384 / 77 = 4.99 (This is close enough to 5 so we shall use it.)

(I chose 3 because it was the first value I tested that came close a whole number)

To make the range of 128 into 77, we will take 128 and multiply it by 3, then divide that by 5 (4.99). This gives us 76.8, close enough to 77. To make this into the range you want, we just add 25 to that value, and there is (roughly) 25-102.

The Translator should look something like:

Code: Select all

Translator 0: Change Range
Options: stop=false
Incoming: MIDI B0 01 oo 
Rules: 
  oo=oo*3
  oo=oo/5
  oo=oo+25
Outgoing: MIDI B0 01 oo 
The higher the numbers you use, will make this new range more accurate, and if you can find a whole number that both 128 and 77 divide into then it should be perfect...

I hope you understand and this helps!

cheers,
Scott

Valy20007

2010-02-08 15:36:25

Thanks man, it's work fine, but i will try to make more accurate.
Cheers