Got some sort of working code.
if (sensormappedValue < switchpointValue)
speedValue = map(sensormappedValue, 0, 255, speedstartValue, 255); // can be switched off later stage when curve section works.
else
// speedValue = (int) (0.5 + speedstartValue + pow(sensormappedValue/127.0, gammaSValue) * ((speedfinalValue - speedstartValue) / 2.0) );
speedValue = (int) (0.5 + speedfinalValue - pow((255 - sensormappedValue)/127.0, gammaSValue) * ((speedfinalValue - speedstartValue) / 2.0));
I added switchpointValue variable instead of the fixed 128 to change the point on the trigger baseline where the linear line is starting to bend. Both options earlier supplied give a drop down in speedfinalvalue after switchpointValue is reached.
I tried to figure out how to change the line to linear climbing after the switchpointValue but I failed sofar.
Paco