How to Map midi

hdxn:
however having issues with rotary encoder: it only goes two ways, either to 1 or 127, what could be a problem?

That's normal, rotary encoders only send out relative position changes, rather than an absolute position. This is actually an advantage for MIDI controllers, since the initial value in the DAW software doesn't have to match the physical position of the knob.
Your DAW should have a setting for relative MIDI control. What software are you using?