We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Have been working on an interactive sketch to output to my Resolume program, and found some resources on using the Syphon server. I got as far as having Resolume recognize the output, but the signal seems glitched and totally off.
The image will be a slit-scan type of live feed... still in the works.
import processing.video.*;
import codeanticode.syphon.*;
PGraphics canvas;
SyphonServer server;
Capture cam;
void setup() {
size(600,400, P3D);
canvas = createGraphics(600, 400, P3D);
// Create syhpon server to send frames out.
server = new SyphonServer(this, "Slitscan");
////CAPTURE////
String[] cameras = Capture.list();
if (cameras.length == 0) {
println("There are no cameras available for capture.");
exit();
} else {
println("Available cameras:");
for (int i = 0; i < cameras.length; i++) {
println(cameras[i]);
}
cam = new Capture(this, cameras[0]);
cam.start();
}
}
void draw() {
canvas.beginDraw();
canvas.background(0);
if (cam.available() == true) {
cam.read();
}
image(cam, 0, 0);
for (int high = 800; high > 0; high=high-50){
image(cam, 0, 0, 800, high);
}
server.sendImage(canvas);
//server.sendScreen();
}
This is what the receiving image looks like:
Answers
Please edit your post, select your code and hit ctrl+o to format your code. Make sure there is an empty line above and below your code
Kf
Fixed... for some reason the "code" formatting didn't work the first time... any thoughts on the actual question?
I don't think is the processing code. The line in question is number 37. This is the connection to your other class. Maybe you need to tell the other class the size of the mage that you are sending?
Also, you should send an unmodified image. In your case, comment out line 35.
Consider checking previous code: https://forum.processing.org/two/search?Search=syphon
******EDITED: For example: https://forum.processing.org/two/discussion/17592/syphon-and-processing/p1
Kf
Awesome thanks for the links and suggestion. You were right... I found that instead of line 37 I should use the commented out 38 as well as adding a setting parameter in the beginning to determine the screen size output. Below was the added settings