This allows all notes to have their velocity determined by an automation curve. This started life as the stock velocity control jsfx and then had its guts ripped out to make something as simple as possible.
desc:MIDI Fix Velocity JDA
//tags: MIDI processing
slider1:63<1,127,1>Velocity
in_pin:none
out_pin:none
@init
@slider
@block
while (
midirecv(ts,msg1,msg23) ?
(
m=msg1&240;
vel=(msg23/256)|0;
note=msg23&127;
m == 9*16 && vel > 0 ?
(
vel = slider1;
midisend(ts,msg1,note+vel*256); // send note on
) :
(
midisend(ts,msg1,msg23); // passthru
);
);
);