Skip to content

Instantly share code, notes, and snippets.

@lossius
Created October 4, 2014 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lossius/82dd259a50c35f304148 to your computer and use it in GitHub Desktop.
Save lossius/82dd259a50c35f304148 to your computer and use it in GitHub Desktop.
automation Reaper JS test plugin
desc: Automation test
slider1:0<-1,1,0.001>x
slider2:0<-1,1,0.001>y
in_pin:1
in_pin:2
out_pin:1
out_pin:2
/********************************************************************
Graphics
********************************************************************/
@gfx 500 500
// Determine geometry
gCenterX = gfx_w * 0.5;
gCenterY = gfx_h * 0.5;
// Update sliders when mouse is pressed
(mouse_cap == 1) ? (
slider1 = (mouse_x - gCenterX) / gCenterX;
slider2 = -(mouse_y - gCenterY) / gCenterY;
slider_automate(slider1);
slider_automate(slider2);
);
// Draw circle
gfx_a = 1.;
gfx_r = 0.8;
gfx_g = 0.2;
gfx_b = 0.2;
gfx_circle((slider1 + 1)*gCenterX, (-slider2+1)*gCenterY, 10, 1, 1);
/********************************************************************
Samples are just passed through
********************************************************************/
@sample
spl0 = spl0;
spl1 = spl1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment