Sorry to jump on an old thread, but I just wrote a JS plugin that reverses the polarity of a sustain pedal. Just copy/paste this into a new JS plugin, and set that midi plugin to be the first thing in your chain. At the moment this affects all MIDI channels -- if anyone wants to improve this plugin, feel free.
desc:MIDI Sustain Pedal Inverter
slider1:0<0,1,1(0 Enabled,1 Disabled)>Is Disabled?
slider2:0<0,1,1(0 Down,1 Up)>Pedal Position (read-only)
@init
@slider
isdisabled=slider1;
@block
while (
midirecv(mpos, msg1, msg23) ? (
msg3 = (msg23/256)|0;
msg2 = msg23-(msg3*256);
isCC = ((msg1/16)|0)==11;
(isCC && msg2 == 64 && isdisabled == 0) ? (
x_msg3 = msg3;
msg3 == 127 ? (msg3 = 0
: (msg3 = 127
;
msg23 = (msg3*256+msg2)|0;
slider2=msg3;
);
midisend(mpos, msg1, msg23);
);
);