Created
October 21, 2017 01:11
-
-
Save TRNT7/d9bfb4df4988524579bb3900409f6d81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import netP5.*; | |
import oscP5.*; | |
OscP5 osc; | |
float xval = 0; | |
float yval = 0; | |
float ellsize = 30.0; | |
void setup(){ | |
fullScreen(); | |
osc = new OscP5(this, 12345); | |
frameRate(30); | |
rectMode(CENTER); | |
noCursor(); | |
noStroke(); | |
} | |
void draw(){ | |
background(245,120,47,30); | |
ellipse(xval, yval, ellsize, ellsize); | |
} | |
void keyPressed() { | |
if (key == 's'){ | |
saveFrame(); | |
} | |
} | |
void oscEvent(OscMessage message){ | |
println(message); | |
if(message.checkAddrPattern("/mtpad/0/x") == true){ | |
xval = message.get(0).floatValue() * width; | |
} | |
if(message.checkAddrPattern("/mtpad/0/y") == true){ | |
yval = message.get(0).floatValue() * height; | |
} | |
if(message.checkAddrPattern("/mtpad/0/size") == true) { | |
ellsize = message.get(0).floatValue()*60.0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment