• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum
    • Categories
    • Recent
    • Popular
    • Tags
    • Register
    • Login

    A Processing sketch to an Isadora stage

    Off-Topic Discussion
    10
    23
    7.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      stj
      last edited by

      @Vanderzee
      I have been using Syphoner to get about any software/video stream on my screen into Isadora, including Processing:
      http://syphoner.sigma6.ch/

      1 Reply Last reply Reply Quote 0
      • Bill CottmanB
        Bill Cottman
        last edited by

        @stj : I am looking at the Syphoner demo later today. Thanks.

        http://www.BillCottman.com : Isadora3.0.8f09 with MBP OS X 10.11.6 in Minneapolis, MN

        1 Reply Last reply Reply Quote 0
        • ericE
          eric
          last edited by

          A simpler, but more limited method, that I've used is to record your Processing sketch using saveFrame in the Draw loop, and then use Movie Maker to create a mov file from the saved images.

          e.g.  saveFrame("/Users/eric/Documents/Processing/images/evo/####.tiff");
          1 Reply Last reply Reply Quote 0
          • rainbowR
            rainbow
            last edited by

            @vanderzee, Camtwist 2.5 (for free) uses screen grab, desktop, plus syphon out, and the camera in also works with Isadora. Processing with OSC is simple to use, syphon out is more difficult. thanks for the inspiration.

            1 Reply Last reply Reply Quote 0
            • fubbiF
              fubbi
              last edited by

              or just use syphoner: http://syphoner.sigma6.ch/

              streams out any window

              Mac M2 Ultra, 64gb — Berlin

              1 Reply Last reply Reply Quote 0
              • B
                bareimage
                last edited by

                SYPHONER is not a good way to go. Latest cam twist supports syphon.

                1 Reply Last reply Reply Quote 0
                • Bill CottmanB
                  Bill Cottman
                  last edited by

                  Interesting comments. Thanks everyone. I think creating a Syphon server in my Processing code and using Izzy's Syphon Server actor is the way I'm going. Here is a simple example of a rotating cube:

                  import codeanticode.syphon.*;
                  PGraphics canvas;
                  SyphonServer server;
                  void setup()
                    {size(400,400, P3D);
                    canvas = createGraphics(400, 400, P3D);
                    // Create syhpon server to send frames out.
                    server = new SyphonServer(this,"eureka");}
                  void draw()
                   {canvas.beginDraw();
                    canvas.background(0);
                    canvas.lights();
                    canvas.translate(width/2, height/2);
                    canvas.rotateX(frameCount * 0.009);
                    canvas.rotateY(frameCount * 0.009);  
                    canvas.box(200);
                    canvas.endDraw();
                    image(canvas,0,0);
                    server.sendImage(canvas);}

                  http://www.BillCottman.com : Isadora3.0.8f09 with MBP OS X 10.11.6 in Minneapolis, MN

                  1 Reply Last reply Reply Quote 0
                  • rainbowR
                    rainbow
                    last edited by

                    import codeanticode.syphon.*;

                    import oscP5.*;
                    import netP5.*;
                    PGraphics canvas;
                    SyphonServer server;
                    OscP5 oscP5;
                    NetAddress myBroadcastLocation;
                    float factor;
                    void setup()

                    {

                    // DISPLAY SETUP

                    size(640, 480, P3D);

                    canvas = createGraphics(width, height, P3D);

                    initTheScene();

                    // SYPHON SETUP

                    server = new SyphonServer(this, "Processing Cube");

                    // OSC SETUP

                    oscP5 = new OscP5(this, 5001);

                    myBroadcastLocation = new NetAddress("127.0.0.1", 5000);

                    factor = 1;

                    }

                    // RENDER AND SEND TO SYPHON

                    void draw()

                    {

                    canvas.beginDraw();

                    renderTheScene();

                    canvas.endDraw();

                    image(canvas, 0, 0);

                    server.sendImage(canvas);

                    }

                    // SEND ORDER TO MILLUMIN

                    void mouseMoved()

                    {

                    OscMessage myOscMessage = new OscMessage("/millumin/layer/opacity/0");

                    myOscMessage.add(100*mouseX/width);

                    oscP5.send(myOscMessage, myBroadcastLocation);

                    }

                    // RECEIVE ORDER FROM MILLUMIN

                    void oscEvent(OscMessage theOscMessage)

                    {

                    if ( theOscMessage.addrPattern().equals("/millumin/layer/scale/0") )

                    {

                    factor = theOscMessage.get(0).floatValue()/100;

                    }

                    }

                    1 Reply Last reply Reply Quote 0
                    • rainbowR
                      rainbow
                      last edited by

                      rest of the code, must be put together, was too much for one message, sorry, can post the txt file as zip.

                      void initTheScene() {

                      }

                      void renderTheScene() {

                      background(0);

                      noStroke();

                      rect(0, 0, width, height);

                      float sine = sin(phasor * TWO_PI);

                      float angle = map(sine, -1.0, 1.0, -HALF_PI, HALF_PI);

                      float divPoint = map(sine, -1.0, 1.0, 1.0, 0.5);

                      for (int i = 0; i < nBranches; i++) {

                      float L = startingLength;

                      float a = TWO_PI / (float) nBranches * (float) i;

                      PVector v1 = new PVector(width / 2, height / 2);

                      PVector v2 = getVCoordinates(v1, L, a);

                      while (L > 2) {

                      canvas.stroke(random(255), 255, 0, 32);

                      L *= 0.95;

                      canvas.line(v1.x, v1.y, v2.x, v2.y);

                      a += angle;

                      v1.x = lerp(v1.x, v2.x, divPoint);

                      v1.y = lerp(v1.y, v2.y, divPoint);

                      v2 = getVCoordinates(v1, L, a);

                      }

                      }

                      phasor += rate;

                      if (phasor >= 1.0) {

                      phasor -= 1.0;

                      }

                      }

                      1 Reply Last reply Reply Quote 0
                      • Bill CottmanB
                        Bill Cottman
                        last edited by

                        @rainbow: I copy/pasted your code and I get an error at line 87, "cannot find anything named "phasor". I am a Processing beginner with no debugging skills yet. Can you help? Also can you describe what your sketch does? Thanks.

                        http://www.BillCottman.com : Isadora3.0.8f09 with MBP OS X 10.11.6 in Minneapolis, MN

                        1 Reply Last reply Reply Quote 0
                        • rainbowR
                          rainbow
                          last edited by

                          @vanderzee: sorry some code is missing, I used Gras.pde and Organic.pde for examples, also a Processing beginner.

                          thanks for the inspiration.
                          rainbow

                          c592fa-syphon.zip

                          1 Reply Last reply Reply Quote 0
                          • Bill CottmanB
                            Bill Cottman
                            last edited by

                            @rainbow: just took a quick look. i'm traveling for next couple days. i will look carefully when i get to my studio. thx.

                            http://www.BillCottman.com : Isadora3.0.8f09 with MBP OS X 10.11.6 in Minneapolis, MN

                            1 Reply Last reply Reply Quote 0
                            • ArmandoA
                              Armando Beta Gold
                              last edited by

                              Millumin ia a very nice piece of software. Not really a competitor for Isadora. because less interactivity, no 3D, but it is very simple, well structured, timeline based and does softedge, osc, midi, syphon. It is a great player and does some real time too. I was surprised. The programmer is great, (lives in Lyon, France) responsive and very generous. The soft is quite expensive (double that izzy las time I saw).

                              By the way, I tried your code and as strange as it seems processing syphons out to mad mapper but doesn't in Isadora... any clue?
                              Thanks

                              Armando Menicacci

                              www.studiosit.ca
                              www.armandomenicacci.net

                              Macbook pro 16 inches 2022 64 GB RAM, M1 MAX. OS 14 Sonoma

                              1 Reply Last reply Reply Quote 0
                              • rainbowR
                                rainbow
                                last edited by

                                Well, on my hardware its working, I am beginner, and share some knowledge, I just like Processing syphon oSC tools 😉

                                1 Reply Last reply Reply Quote 0
                                • Bill CottmanB
                                  Bill Cottman
                                  last edited by

                                  @Armando: this processing code sends the rotating cube to an izzy syphon to video actor and projector and shows on stage 1. I cannot comment on MadMapper.

                                  import codeanticode.syphon.*;
                                  PGraphics canvas;
                                  SyphonServer server;
                                  void setup()
                                    {size(400,400, P3D);
                                    canvas = createGraphics(400, 400, P3D);
                                    // Create syhpon server to send frames out.
                                    server = new SyphonServer(this,"eureka");}
                                  void draw()
                                   {canvas.beginDraw();
                                    canvas.background(0);
                                    canvas.lights();
                                    canvas.translate(width/2, height/2);
                                    canvas.rotateX(frameCount * 0.009);
                                    canvas.rotateY(frameCount * 0.009);  
                                    canvas.box(200);
                                    canvas.endDraw();
                                    image(canvas,0,0);
                                    server.sendImage(canvas);}

                                  http://www.BillCottman.com : Isadora3.0.8f09 with MBP OS X 10.11.6 in Minneapolis, MN

                                  1 Reply Last reply Reply Quote 0
                                  • ArmandoA
                                    Armando Beta Gold
                                    last edited by

                                    Thanks. Vanderzee the problem might be on my version I'm testing a higher prerelease. Your code works on on syphon recorder, works on mad mapper but doesn't in my version. I'll file a bug report.

                                    Thanks So this is the code for the CI and the Texture. Bur it is not the code for the video actors isn't it? It works (partially only with image and texture actors.

                                    Armando Menicacci

                                    www.studiosit.ca
                                    www.armandomenicacci.net

                                    Macbook pro 16 inches 2022 64 GB RAM, M1 MAX. OS 14 Sonoma

                                    1 Reply Last reply Reply Quote 0
                                    • rainbowR
                                      rainbow
                                      last edited by

                                      found this on http://forum.processing.org/two/discussion/comment/3810#Comment_3810

                                      saves my time coding processing syphon out

                                      latest IsadoraCore prerelease OSX 10.9.1 Processing 2.11

                                      Simple cube,syphon and osc scetch. well documented, enjoy …….

                                      rainbow

                                      e4bc5b-simple.zip

                                      1 Reply Last reply Reply Quote 0
                                      • primaldivineP
                                        primaldivine
                                        last edited by

                                        I have a blog page here on OSC and Processing:
                                        http://www.jamiegriffiths.com/isadora-and-processing-via-osc/

                                        Pro-User Latest Beta - MacBook Pro i7 2.66GHz SSD
                                        www.jamiegriffiths.com Arctic Canada
                                        www.chickweedarts.com

                                        1 Reply Last reply Reply Quote 0
                                        • bruperB
                                          bruper
                                          last edited by

                                          this is what I used 2 years ago with Processing 1.5.1, it does still works with that version but not with v.2.
                                          Don't know why...
                                          you can then use any Syphon client anywhere:


                                          import javax.media.opengl.;
                                          import processing.opengl.
                                          ;
                                          import jsyphon.*; // Syphon

                                          JSyphonServer mySyphon;
                                          PGraphicsOpenGL pgl;
                                          GL gl;
                                          int[] texID;

                                          void setup() {
                                            size(640, 480, OPENGL);
                                            pgl = (PGraphicsOpenGL) g;
                                            gl = pgl.gl;
                                            initSyphon(gl,"processing");

                                          strokeWeight(0.5);
                                            stroke(255, 50);
                                            background(0);

                                          }

                                          void draw() {
                                            line(width/2, height/2, random(0, width), random(0, height));
                                            renderTexture(pgl.gl);
                                          }

                                          void initSyphon(GL gl, String theName) {
                                              if(mySyphon!=null) {
                                                mySyphon.stop();
                                              }
                                              mySyphon = new JSyphonServer();
                                              mySyphon.test();
                                              mySyphon.initWithName(theName);

                                          // copy to texture, to send to Syphon.
                                              texID = new int[1];
                                              gl.glGenTextures(1, texID, 0);
                                              gl.glBindTexture(gl.GL_TEXTURE_RECTANGLE_EXT, texID[0]);
                                              gl.glTexImage2D(gl.GL_TEXTURE_RECTANGLE_EXT, 0, gl.GL_RGBA8, width, height, 0, gl.GL_RGBA, gl.GL_UNSIGNED_BYTE, null);
                                          }

                                          void renderTexture(GL gl) {
                                            gl.glBindTexture(gl.GL_TEXTURE_RECTANGLE_EXT, texID[0]);
                                            gl.glCopyTexSubImage2D(gl.GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, 0, 0, width, height);
                                            mySyphon.publishFrameTexture(texID[0], gl.GL_TEXTURE_RECTANGLE_EXT, 0, 0, width, height, width, height, false);
                                          }

                                          public void stop() {
                                            dispose();
                                          }

                                          void dispose() {
                                            println("\n\nabout to stop sketch ...");
                                            println("deleting textures");
                                            gl.glDeleteTextures(1, texID, 0);
                                            if(mySyphon!=null) {
                                              println("stopping the syphon server");
                                              mySyphon.stop();
                                            }
                                            println("sketch stopped, done.");
                                          }

                                          17"MBP 2.93GHZ Core2Duo mid 2009 - OSX10.11.6 - 8GB, 1TBCrucial_SSD, izzy 3.0.7

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post