[p5osc] how to make things happens?
in
Contributed Library Questions
•
3 years ago
hello,
I'm sending osc messages from supercollider to p5 using p5osc lib.
it receives messages and show it in the post window.
but, well, I just can't find a way to use those messages to do something in my p5 program.
I've tried to trigger a text display each time p5 receives an osc message.
but it becomes more and more confusing.
it does not do anything or triggers the display time to time, very shortly.
can someone please help me??
thank you very much.
I'm sending osc messages from supercollider to p5 using p5osc lib.
it receives messages and show it in the post window.
but, well, I just can't find a way to use those messages to do something in my p5 program.
I've tried to trigger a text display each time p5 receives an osc message.
but it becomes more and more confusing.
it does not do anything or triggers the display time to time, very shortly.
can someone please help me??
thank you very much.
- import processing.video.*;
- import oscP5.*;
- import netP5.*;
- PFont fontA;
- Capture cam;
- OscP5 oscP5;
- NetAddress myRemoteLocation;
- void setup() {
- size(640,480);
- cam = new Capture(this, 640, 480);
- frameRate(25);
- oscP5 = new OscP5(this,12000);
- myRemoteLocation = new NetAddress("127.0.0.1",12000);
- fontA = loadFont("Arial-Black-48.vlw");
- textFont(fontA, 48);
- }
- void draw(){
- if (cam.available() == true){
- cam.read();
- image(cam, 0, 0);
- }
- };
- void oscEvent(OscMessage theOscMessage) {
- float flik = theOscMessage.get(0).floatValue();
- println(flik);
- if(flik > 0){
- background(0);
- fill(255);
- text("heyho", 200, 200);
- }
- }
1