Hi,
thanks. It's always difficult to guess the formula of a controller response. Here it is visualized:
- ControllerResponse_Original.jpg (35.92 KiB) Viewed 9861 times
It almost seems like it is composed of 2 linear lines. So to simplify matters, I correct the curve in two steps: the first part of the response is made steeper, and the second part less steep.
First part:
I found that the point of change is CC value 33, occurring after 1402ms. Now with a linear curve, given that the total time from 0 to 127 took 2417ms, the linear point at time 1402 would be 73.7. So now we need to expand the range from 0...33 to 0..74. This is done with 2 rules like that:
Code: Select all
// calculate pp/33*73.7
pp=pp*737
pp=pp/330
Note: because MT Pro's rules do not support decimal numbers, we need to first multiply and then divide. Otherwise, we would have big rounding errors. Also, in order to have a bit more resolution, I multiply with 737 (for 73.7) and then divide by 330 instead of 33. This is the same as multiplying by 73.7 and dividing by 33.
Second part:
For the range from 34 and above, the next mapped value from the first part would be 76. So here, we need to map the range from 34..127 to 76..127:
Code: Select all
// calculate ((pp-34) / (127-34) * (127-76)) + 76
pp=pp-34
pp=pp*51
pp=pp/93
pp=pp+76
Now the mapped curve looks like this:
- ControllerResponse_Fixed.jpg (36.19 KiB) Viewed 9861 times
Not 100% linear, but much better
Putting it all together
Code: Select all
[x] Translator: Map Controller Response Curve
Incoming: Control Change on channel 1 with CC#:7 (0x07) set 'pp' to value
Rules:
if pp>33 then Goto "SecondPart"
// calculate pp/33*73.7
pp=pp*737
pp=pp/330
exit rules, execute Outgoing Action
Label "SecondPart"
// calculate ((pp-34) / (127-34) * (127-76)) + 76
pp=pp-34
pp=pp*51
pp=pp/93
pp=pp+76
Outgoing: Control Change on channel 1 with CC#:7 (0x07) and value:pp
Attached is the MT Pro project file.