Two PGraphics to Two syphon servers

hey I had a quick question...I think it may be a syphon issue but wanted to make sure it wasn't a dumb processing mistake. I am trying to make a app that will display my generative sketches. The strategy was to make each sketch as an object. Then to have two PGraphics layers sending to two syphon servers to VDMX. I got everything to work....two layers in vdmx with two syphon outputs the weirdest thing is that the animation only works on one layer.....so i think the issue is with server.sendImage(canvas); server2.sendImage(canvas2); The weird part is server 2 is the only one playing the animation part but both are coming through just one is moving the other isn't....any help please here is the code. Also the thing I am worried about is if I had like 10 different objects I wanted to write the funcationality that I could send the object to either canvas 1 or canvas 2.....I'm not sure if there is a better way without just making more servers which seemed kind of backhanded to me. I am still a newbie...technically. Thanks.

import codeanticode.syphon.*;
import oscP5.*;
import netP5.*;


OscP5 oscP5;
NetAddress myRemoteLocation;
PGraphics canvas;
PGraphics canvas2;
SyphonServer server;
SyphonServer server2;

float low;
float mid;
float high;
float x;
float y;

void setup(){
  size(1280,720,P3D);
  canvas = createGraphics(1280,720,P3D);
  canvas2 = createGraphics(1280,720,P3D);
  smooth(8);
  frameRate(60);
  oscP5 = new OscP5(this, 12345);
  myRemoteLocation = new NetAddress("127.0.0.1", 12345);
  server = new SyphonServer(this, "Processing Syphon");
  server2 = new SyphonServer(this, "josh");
  float x=1;
  float y=1;

}

void draw(){
clear();
move();

canvas.beginDraw();
canvas.background(0,0,0,0);
canvas.noFill();
canvas.stroke(255);
canvas.strokeWeight(30);
canvas.line (0,height/2+x,width,height/2+x);
canvas.endDraw();
canvas2.beginDraw();
canvas2.background(0,0,0,0);
canvas2.noFill();
canvas2.stroke(255);
canvas2.strokeWeight(60);
canvas2.line(width/2+y,0,width/2+y,height);
// canvas2.image(canvas,0,0);//merge
canvas2.endDraw();
image(canvas,0,0);
image(canvas2,0,0);
server.sendImage(canvas);
server2.sendImage(canvas2);
}
void move(){
x+=1*0.5;
y-=1*1;
}
Tagged:
Sign In or Register to comment.