SourceForge has been redesigned. Learn more.
Close

Reactivision MaxMSP/Processing simultaniously

morten_ben
2007-06-12
2013-06-12
  • morten_ben

    morten_ben - 2007-06-12

    Hi all!

    We I am using reactivision for a prject on a design school in denmark... I have a problem:

    I have an audio-part going through MaxMSP, and a visual part going through processing. But when I turn on the TUIO (Max), Processing stops reacting on the fiducials. WHY?

    Has anyone tried this, and more important, does anyone have a solution?

    Please be fast, I am very short for time.
    Thanks
    morten_ben

     
    • nick

      nick - 2007-06-13

      I think you can only recieve the osc in one application at a time unless it is sent as an osc broadcast (which presumable this isn't as its not working for you).

      If this is the case then you need to have one app recieving the original Tuio osc info,and then resend it on a different port (but still on local ip) for the other application to recieve.

      HTH

      Nick

       
      • loren

        loren - 2007-11-20

        HI!!!

        [i created an account just to respond to this!]

        I HAVE THE EXACT SAME PROBLEM!!!

        i'm trying to use reactivision / max/msp / ableton live / processing to create a multitouch interface that both controls audio (in live) and video (in processing.) i've gotten to the point of getting both to run seperately, but i cant get them to run at the same time?? (i use max/msp to translate osc to midi for live.)

        when i turn on my processing app, i can get it to track just fine. (with reactivision sending osc.) then, when i turn on max/msp, processing stops recieving osc!!! so, i think that the answer would be to create an osc broadcast so that both programs can hear the osc. but HOW DO YOU DO IT??? (i'm real new to processing, and i think it can be done with that.)

        here's a video of what i've created thus far:
        http://www.youtube.com/watch?v=0KS9AX6Rgeg

        if you know anything about this, i could greatly use some help!

        thanks so much!

        - loren

         
    • nick

      nick - 2007-11-21

      It can be done in either.

      You just need to take the ion you are receiving and send it again from either Max or Processing to a different port number, and have the other program listen to that port number. Look at the p5 examples for processing - there are examples of receiving and sending osc - basically you need to combine those in one patch but have the send ing port number set to a different value than the one you are receiving the osc on, and then set the max receive object to listen to that.

       
      • nick

        nick - 2007-11-21

        Sorry that first line should read - you just need to take the info you are receiveing

         
    • loren

      loren - 2007-11-22

      uuuug, i dont understand... i've looked over all the patches from P5osc, but they dont make sense. i've tried copying the patches onto the end of my original patch (and moved all the import stuff to the start of the patch with all the rest of the stuff,) but it's not working! i'm sure that it's just because i dont understand it. i've only been working with these programs for the last 4 days. there's quite the learning curve.

      anyway, the goal is to have the osc from reactivision broadcast over port 3333 (127.0.0.1 i think) and have max AND processing feed off it. it seems like this would be a simple thing to do. perhaps run 2 processing patches? one to broadcast the osc and the other to run the visuals???

      the broadcast patch (P5osc) seems to be promising; i change the listen port from 12000 (or whatever it is) to 3334 and the "myRemoteLocation = new NetAddress("127.0.0.1",12000);" to be "myRemoteLocation = new NetAddress("127.0.0.1",3333);"

      than, initiate reactivision in terminal with "-p 3334" at the end and open my visual patch for processing.

      but NOTHING HAPPENS in the visual patch! i get some kind of "bootstrap" error. and nothing is tracked / displayed.

      although, the info area of processing shows a stream of text that updates more quickly when reactivision is tracking an object. (i assume this is the osc createing these messages.)

      for reference, i'm useing the processing patch from the reactivision site. and by the way, how do you change the port that the patch is listening on? from 3333 to say 3334? because if not everything can run on 3333, then this must be changed...

      sorry this message was so long, but it just seems like i'm %99 of the way there and there's this one last bug stoping me. quite angering. quite.

      once again, thank you all for your help.
      - loren

       
    • nick

      nick - 2007-11-22

      Heres the top half of a processing sketch that forwards the add object messages to a program on the same machine on port 1234. - just replace the bit of the example patch code to the end of the add object method with this (you need the rest of the code too, but replicating it here would be unnecessary as it isn't changed from the original.

      Just launch reactable and the patch in processing listens to port 3333 and generates osc messages targeted at isadora - but a max patch using a udpreceive 1234 object will receive them fine.

      import oscP5.*;
      import netP5.*;

      /*
              TUIO processing demo - part of the reacTIVision project
              http://mtg.upf.es/reactable

              Copyright (c) 2006 Martin Kaltenbrunner <mkalten@iua.upf.es>

              Permission is hereby granted, free of charge, to any person obtaining
              a copy of this software and associated documentation files
              (the "Software"), to deal in the Software without restriction,
              including without limitation the rights to use, copy, modify, merge,
              publish, distribute, sublicense, and/or sell copies of the Software,
              and to permit persons to whom the Software is furnished to do so,
              subject to the following conditions:

              The above copyright notice and this permission notice shall be
              included in all copies or substantial portions of the Software.

              Any person wishing to distribute modifications to the Software is
              requested to send the modifications to the original developer so that
              they can be incorporated into the canonical version.

              THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
              EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
              MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
              IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
              ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
              CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
              WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
      */

      import tuio.*;
      OscP5 oscP5;
      NetAddress myRemoteLocation;
      TuiObjectList objectList;
      TuiCursorList cursorList;
      TuioClient client;

      void setup()
      {
        size(10,10);
        noStroke();
        fill(0);
        noLoop();
        redraw();
        objectList = new TuiObjectList();
        cursorList = new TuiCursorList();
        client  = new TuioClient(this);
         /* start oscP5, listening for incoming messages at port 3333 */
        oscP5 = new OscP5(this,3333);
       
        /* myRemoteLocation is a NetAddress. a NetAddress takes 2 parameters,
         * an ip address and a port number. myRemoteLocation is used as parameter in
         * oscP5.send() when sending osc packets to another computer, device,
         * application.
        myRemoteLocation = new NetAddress("127.0.0.1",1234);
      }

      void draw()
      {
        background(255);
        cursorList.draw();
        objectList.draw();
      }

      // called after each message bundle
      void refresh() { redraw(); }

      // called when an object is added to the scene
      void addTuiObject(Integer s_id, Integer f_id) {
        objectList.activate(s_id,f_id);
        OscMessage myMessage = new OscMessage("/isadora");
       
        myMessage.add(f_id); /* add an int to the osc message */
       
        /* send the message */
        oscP5.send(myMessage, myRemoteLocation);
        System.out.println("add object "+f_id+" ("+s_id+")");
      }

      HTH Good luck

      Nick

       
    • loren

      loren - 2007-11-22

      wow, thanks guys!

      i think that patch is working, but max still takes over the osc signal. (or port or whatever)
      perhaps there's a better way to be translating my osc data into midi... perhaps processing? (i'm useing the demo of max, and i dont really know how to use it...)

      so, if anyone knows of a processing sketch that translates osc to midi, i would love to try it!

      thanks all, you guys help WAY more thank you know!!!

      - loren

       
    • Paula

      Paula - 2007-11-29

      Hello n_i_c_k_w,

      thank you for the code! How can I get max to listen to another port then 3333? Just add another port number after 'TuioClient' does not seem to work, can you help?

      Kind regards,
      Paula

       
    • nick

      nick - 2007-11-29

      You need to use a udpreceive object rather than the tuioclient, as you are no longer looking for the tuio messages, you are looking for the osc messages that proccessing is forwarding.

      A udpreceive 1234 object (as this is the port porcessing is sending information out on) will receive the messages.

      HTH

      Nick

       
    • Paula

      Paula - 2007-11-29

      Hey Nick,

      thanks so much, I got it to work!

      I would like to duplicate the message Max would normally receive from the TuioClient, which he now receives from the UDP over port 1234. In order to do that I want to turn the java.lang.Integer into a float. Do you have any ideas on this matter? I know that what I have now is definitely wrong, but I cannot find a starting point to solve it.

      Kind regards,
      Paula

      piece of example code:

      // called when an object is added to the scene
      void addTuiObject(Integer s_id, Integer f_id) {
        objectList.activate(s_id,f_id);
        OscMessage myMessage = new OscMessage("addObject");
        float count = s_id;
        float fidu = f_id;
        myMessage.add(count); /* add an int to the osc message */
        myMessage.add(fidu);
        oscP5.send(myMessage, myRemoteLocation); /* send the message */
      }

      error received:

      C:/DOCUME~1/s040507/LOCALS~1/Temp/build10387.tmp/Temporary_4361_6315.java:75:9:75:19: Semantic Error: The type of the right sub-expression, "java.lang.Integer", is not assignable to the variable, of type "float".

       
    • Paula

      Paula - 2007-11-29

      Hi Nick,

      no worries, I found the way to do it!

      In case you wonder how...

      // called when an object is added to the scene
      void addTuiObject(Integer s_id, Integer f_id) {
        objectList.activate(s_id,f_id);
        OscMessage myMessage = new OscMessage("addObject");
        myMessage.add(s_id.floatValue()); /* add an int to the osc message */
        myMessage.add(f_id.floatValue());
        oscP5.send(myMessage, myRemoteLocation); /* send the message */
      }

      Regards,
      Paula

       
    • Eric Wafford

      Eric Wafford - 2008-01-23

      I dunno if this would help in your situation and I haven't tested it completely but you are able to forward the information given by the TuioClient max object by using a udpsend object. Currently I only use this as a way to run two different max patches at the same time, one to create my sound and one to generate my visuals. This allows me to run the patches on two different computers, so I assume that this can also be used between programs also... no?

       
    • tomislav

      tomislav - 2008-12-21

      i use osculator and its great for this, you should try it if you dont like max...

       

Log in to post a comment.