desc: SimpleTest
slider1:48<0,127,1>note
slider2:100<0,127,1>velo
@init
str = " TEST: Set note, velo, press and drag(up-down) ";
@slider
offset = 0;
note = slider1;
velo = slider2;
@block
mouse_down ? (midisend(offset, 144, note, velo); gfx_clear=-1;);
mouse_up ? midisend(offset, 128, note, velo);
mouse_cap&1 ? (
V = 8192 + (16384/gfx_h) * (mouse_down_y-mouse_y);
PitchBend = floor( min(max(V,0),16383) );
lsb = PitchBend & 0x7F;
msb = PitchBend >> 7 ;
midisend(offset, 224, lsb, msb);
);
mouse_up ? midisend(offset, 224, 0, 8192);
@gfx 300 300
gfx_r=gfx_g=gfx_b=gfx_a=1;
gfx_x = gfx_y = 20;
gfx_drawstr(str); //-- REAPER 4.59+
mouse_down = mouse_cap&1 && !(last_mouse_cap&1);
mouse_up = last_mouse_cap&1 && !(mouse_cap&1);
mouse_down ? (mouse_down_x=mouse_x; mouse_down_y=mouse_y;);
mouse_down ? (gfx_clear=-1; gfx_line(0, mouse_y, gfx_w, mouse_y););
mouse_up ? gfx_clear=0;
mouse_cap&1 ? (gfx_line(last_mouse_x, last_mouse_y, mouse_x, mouse_y ) ;);
last_mouse_cap = mouse_cap;
last_mouse_x = mouse_x;
last_mouse_y = mouse_y;