touchOsc and Processing 3.2.3?

edited November 2016 in Library Questions

What do I need to do in order to get touchOsc working with processing 3.2.3? I see that my sketch is listening to port 31415, I have my touchOsc app sending out to port 31415, but I am getting nothing. Processing code below ... thank you.

*Edit - I'm not having any luck in 2.2.1 either.

import netP5.*;
import oscP5.*;

OscP5 oscP5;

float redFade;

void setup() {
  size(480, 360);
  oscP5 = new OscP5(this, 31415);
}

void draw() {
  background(33);

  //red rect
  rectMode(CENTER);
  pushStyle();
  fill(0);
  stroke(42, 42, 42);
  rect(width/2, height/2, 255, 67);
  fill(255, 15, 15);
  rect(width/2, height/2, -redFade, 67);
  popStyle();

}

void oscEvent(OscMessage theOscMessage) {
  String addr = theOscMessage.addrPattern();
  float val = theOscMessage.get(0).floatValue();

  if (addr.equals("/1/redFade")) { redFade = val;}

  print("### received an osc message.");
}

Answers

Sign In or Register to comment.