Trouble with a MIDI USB Expression Pedal Transformer

Hello there,
I am building a MIDI transformer into which i can plug in an expression pedal and send a signal via USB to the computer, I have been using Arduino for a while and felt this wouldnt be very complicated, but for some reason, it is.
The expression pedal I'm using is the M-Audio EX-P pedal, which connects via a JACK input to my Arduino. I have a stereo jack, so i can give one ground, one power and i can read the potentiometer wiper inside the pedal with the spare ring on the stereo jack.

However, there is not one but two potentiometers inside, one is controlled by the footpedal, one Sensitivity Adjustment Potentiometer is connected on the ground line of the pedal poti.
When the Adjustment is low, i get a resistance range from 1k to 12k ohm, when its set high i have a resistance range of 54k to 65k ohm.
Now i have no idea how i can map the values i read from the jack to a 0..127 Midi range as I dont see how i can figure out what setting the sensitivity adjustment poti is set to.

I've been researching for hours and can't seem to wrap my head around it, however, plugging this pedal into a Midi keyboard just seems to work? I feel like im missing something.

Thank you! :slight_smile:

I have that pedal on my M-Audio 88 MK3 keyboard, and I can confirm the side pot (no, it isn't Texas hold'em, just an abbreviation for "potentiometer" :wink: ) should set something like the starting volume you want to get when you completely raise the pedal.

Said that, when I play al always use a zero adjustment (because I want to competely silence the output when I completeli raise the pedal) so to make things easier you also could assume the adjustment will be always to zero, then map the readings you have on the analog pin.

Anyway, have a look at this page, I think you could find some useful things about that pedal, including its schema:
http://blackaddr.com/expression-pedal-repair-and-mod/