View Single Post
Old 03-05-2014, 03:47 PM   #10
tunurgitr
Human being with feelings
 
Join Date: Mar 2014
Posts: 1
Default Jumping on an old thread

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);

);
);

Last edited by tunurgitr; 03-05-2014 at 03:56 PM.
tunurgitr is offline   Reply With Quote