12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import oscP5.*;
- import netP5.*;
-
- OscP5 oscP5;
- void setup() {
- size(150,300);
- frameRate(30);
-
- oscP5 = new OscP5(this,9001);
- }
- void draw() {
- background(0);
-
- float analog0Height = map(analogValue0, 0, 1024, 0, 200);
- fill(255);
- rect(50, 250, 50, -analog0Height);
-
- textSize(12);
- text("/analog/0", 50, 270);
- }
- int analogValue0 = 50;
- void oscEvent(OscMessage theOscMessage) {
-
- if (theOscMessage.addrPattern().equals("/analog/0")){
- analogValue0 = theOscMessage.get(0).intValue();
- }
- }
|