Announcement

Collapse
No announcement yet.

Why would I only be able to select a certain Event type?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why would I only be able to select a certain Event type?

    Hi guys,

    I'm fairly new to this. I'm trying to get from Processing -- via OSCMsg() -- to Osculator in order to convert OSC to midi so that QLab can see it. So all on one machine, the flow goes: Camera --> Processing --> Osculator --> QLab

    Running into problems between Processing and QLab. I receive discrete messages from Processing into Osculator, but they come in only assignable as an "OSC Routing" or "System Console" event type. Why is it that, what message do I need to send from Processing to get Osculator to let me select any Event type I want -- midiCC, midi note, etc?

    Probably something simple. I can't seem to find what it's looking for, any ideas?


    Thanks,

    - misha

  • #2
    Hi Misha,

    The chapter "The OSC message is detail" covers this issue at page 9 of the manual:


    If you have any further question or if my answer is inaccurate, don't hesitate to ask.

    Best,
    Cam

    Comment


    • #3
      Thank you Cami!

      I read page 9 before I started, guess I need to read it again I was trying to follow the example in the manual, where I get a message into Osculator with 2 arguments, and I in fact _do_ get a message with 2 arguments, '1' and '0' below each, however, the message only looks like:

      redThing
      0
      1



      -- not

      /redThing/1
      0
      1


      and the 0 and 1 arguments never fire, so I must not be passing it enough info from Processing.


      I'll work on it some more...

      thanks for responding.

      k



      Originally posted by camille View Post
      Hi Misha,

      The chapter "The OSC message is detail" covers this issue at page 9 of the manual:


      If you have any further question or if my answer is inaccurate, don't hesitate to ask.

      Best,
      Cam

      Comment


      • #4
        You can try to select the argument 0 or 1 and open a QuickLook window to see what data is received.
        Press the space bar to open the monitoring window.

        Comment


        • #5
          Originally posted by camille View Post
          You can try to select the argument 0 or 1 and open a QuickLook window to see what data is received.
          Press the space bar to open the monitoring window.
          thanks, I did do this, and I get a green light that blinks, but next to it I see the text '(no signal)'...I find this a little strange. Does this mean I'm getting a signal, or I'm not?

          The closest I got to success was a yellow light in the activity monitor for the actual message, and a green light in the activity monitor in same message's argument. (Is the actual message's activity monitor supposed to turn green if all is well, i.e. are both the message and its arguments supposed to light up green?)

          An argument seems to be the only thing I can convert to a midi note. And the only way I get a green light on the argument's activity monitor is if my OSC message comes into Osculator like this:

          01_RedThing

          and I do that by going into Processing and setting a 'path' parameter in a homebrew (and now suspect) object to "01_RedThing".

          I have made the first argument of oscMsg this: ("/0")


          Note that there is no "/" before 01_RedThing, nor is there a "/argument"... If I rejigger Processing so it outputs a slash there, I do not get a green light, but 2 yellow lights in the activity window - one for the message "/01_RedThing" itself and one for the first argument. I also cannot assign the arguments to anything other than "OSC Routing" and "Console Log"...

          Sorry I'm subjecting you to this, I'm just trying to figure out what that could possibly mean so I can fix it in Processing...and it's late, and I'm not sure I'm laying out this problem correctly...

          How come you can't convert the osc message itself to a midi note? Why do you have to convert the argument? Just curious, and probably missing something fundamental about OSC.

          Thank you!

          Comment


          • #6
            thanks, I did do this, and I get a green light that blinks, but next to it I see the text '(no signal)'...I find this a little strange. Does this mean I'm getting a signal, or I'm not?
            I agree this can be a bit confusing.
            The reason why you are seeing this is because something has been received, but with no value, or a value that has not changed.

            I have made the first argument of oscMsg this: ("/0")

            Is it that value you would like to convert to a MIDI Note?

            Note that there is no "/" before 01_RedThing, nor is there a "/argument"... If I rejigger Processing so it outputs a slash there, I do not get a green light, but 2 yellow lights in the activity window - one for the message "/01_RedThing" itself and one for the first argument. I also cannot assign the arguments to anything other than "OSC Routing" and "Console Log"...
            The address of the message has no consequence on how it is interpreted.
            The '/' character is only used as a convention.

            Sorry I'm subjecting you to this, I'm just trying to figure out what that could possibly mean so I can fix it in Processing...and it's late, and I'm not sure I'm laying out this problem correctly...
            Please share the relevant portion of your Processing code here so I can have a look.

            How come you can't convert the osc message itself to a midi note? Why do you have to convert the argument? Just curious, and probably missing something fundamental about OSC.

            Consider how OSCulator works with OSC:
            - Messages have zero to many arguments.
            - Arguments are values (float, integer, string, etc.).
            - Events do 'something' in response to value changes.

            There two special events (OSC Routing and Console Log) that accept messages as a value. They process the message as a whole.

            All other events process values. So a MIDI CC event can only be bound to an argument because it provides a single value.

            Now, to show you how an event is always bound to a value, consider these 3 cases:
            1. The message has several arguments. This is a trivial case: you can bind a (special) event to the message, or events to each argument of the message.
            2. The message has one argument. Here, even though OSCulator gives you the impression you are assign something to the message, you are actually assigning an event to its only argument. Try to duplicate this message to convince yourself this is a message + one argument.
            3. The message has no argument. In this final case, OSCulator does a trick: it simulates a virtual argument with a value going from 1 to 0, thus allowing the use of triggered events, like MIDI Notes.


            Best,
            Cam

            Comment


            • #7
              [QUOTE=camille;8160]I agree this can be a bit confusing.
              >> The reason why you are seeing this is because something has been received, but with no value, or a value that has not changed.

              I see.


              >> Is it that value you would like to convert to a MIDI Note?

              Sure, it doesn't really matter what value it is, I could call it 'this thing' or 5, or 3.14 or whatever. I just want something that I can assign to a midi note. Each message just needs a discrete argument I can convert to a single midi note and send to QLab. It just has to get this note or CC once so it can trigger video once it's received. Then trigger again if it's received again, but I was envisioning that it always could be the same value, no change.


              >> The address of the message has no consequence on how it is interpreted.
              >> The '/' character is only used as a convention.

              Got it. Wonder what is making it behave differently if I remove the '/'...

              >> Please share the relevant portion of your Processing code here so I can have a look.

              Okay, I've got:

              -------------------
              void setupOsc()
              {
              // receiving port
              //
              osc = new OscP5(this, 42002);


              // target IP and port
              //
              osc_target = new NetAddress("127.0.0.1", 8000);

              ---------------
              and then in setup I'm calling:

              redCircle.oscMsg("0");

              ------------------

              Then there's a class called Circle:

              String toString(String prefix)
              {
              String class_desc = className + "(" + osc_path +", "+ colorName +")";
              String class_info = "xy=("+ centerX +","+ centerY +") r="+ radius;


              if ( (prefix != null) && (0 < prefix.length()) )
              {
              class_desc = prefix +" = "+ class_desc;
              }


              return super.toString(class_desc, class_info);


              } // toString()


              -------------------
              which I define here:

              redCircle = new Circle("01_redThing", "red", 30, 60, 25);


              ------------------

              Here, even though OSCulator gives you the impression you are assign something to the message, you are actually assigning an event to its only argument.


              This -- and the rest of your text -- was enlightening, thank you.

              Comment


              • #8
                Hey misha,

                Just a question:
                Do you need to produce a quick note (MIDI Note On followed quickly by a MIDI Note Off), or do you want to control the duration of the note?

                Cam

                Comment


                • #9
                  pretty sure I don't need to control the duration, I was just expecting that QLab would get the note-on ping, and note-off would be ignored....the note-on it would trigger video, the video would play. I expect that QLab would be constantly listening for the next note-in at the set value, though.


                  A note-off message has no effect in the QLab trigger setup, I'm pretty sure. Unless you wanted it to.

                  Comment


                  • #10
                    I have read the docs for the oscP5 library, but can't find the definition for the oscMsg() function. If you have more info about this, I'm interested.

                    Anyway, here is what you could do:

                    Send a message to OSCulator like "/01_redThing" with no argument (use to slash to conform to OSC best practices.
                    Basically, you would just have to add a slash '/' the your circle and call oscMsg() with no argument (though I'm not sure it would work since I don't know the definition of this method).

                    OSCulator should then receive a message called "/01_redThing", to which you just need to assign a MIDI Note event. Because OSCulator receives a message with no argument, it will call the MIDI Note event first with a Note ON, and then shortly after a Note OFF.

                    If you want to send Note ON only, then send a message with the integer argument 1: oscMsg(1) (again, not sure it would work). In this case, OSCulator will always generate a MIDI Note ON.

                    Comment


                    • #11
                      >> h '/' the your circle and call oscMsg() with no argument (though I'm not sure it would work since I don't know the definition of this method).

                      that's what I thought! but no, I get a java error "the method is ambiguous for its type" ...because it's an overloaded method. I must provide at least one argument, or I can't call it at all. Here's the reference documentation I'm looking at:

                      file://localhost/Users/miltnerunit/Documents/Processing/libraries/oscP5/reference/oscP5/OscMessage.html

                      and a code example I found in the 'examples' folder in oscP5:

                      --------------------------------------------
                      /**
                      * oscP5message by andreas schlegel
                      * example shows how to create osc messages.
                      * oscP5 website at http://www.sojamo.de/oscP5
                      */

                      import oscP5.*;
                      import netP5.*;


                      OscP5 oscP5;
                      NetAddress myRemoteLocation;


                      void setup() {
                      size(400,400);
                      frameRate(25);
                      /* start oscP5, listening for incoming messages at port 12000 */
                      oscP5 = new OscP5(this,12000);

                      /* 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. usage see below. for testing purposes the listening port
                      * and the port of the remote location address are the same, hence you will
                      * send messages back to this sketch.
                      */
                      myRemoteLocation = new NetAddress("127.0.0.1",12000);
                      }




                      void draw() {
                      background(0);
                      }


                      void mousePressed() {
                      /* in the following different ways of creating osc messages are shown by example */
                      OscMessage myMessage = new OscMessage("/test");

                      myMessage.add(123); /* add an int to the osc message */
                      myMessage.add(12.34); /* add a float to the osc message */
                      myMessage.add("some text"); /* add a string to the osc message */
                      myMessage.add(new byte[] {0x00, 0x01, 0x10, 0x20}); /* add a byte blob to the osc message */
                      myMessage.add(new int[] {1,2,3,4}); /* add an int array to the osc message */


                      /* send the message */
                      oscP5.send(myMessage, myRemoteLocation);
                      }




                      /* incoming osc message are forwarded to the oscEvent method. */
                      void oscEvent(OscMessage theOscMessage) {
                      /* print the address pattern and the typetag of the received OscMessage */
                      print("### received an osc message.");
                      print(" addrpattern: "+theOscMessage.addrPattern());
                      println(" typetag: "+theOscMessage.typetag());
                      }
                      __________________________________________________ ___

                      >> "/01_redThing", to which you just need to assign a MIDI Note event.

                      The problem is that when I pass it this, I can assign it a MIDI note event, but it doesn't trigger. And unless I give oscMsg 2 arguments when I'm doing this -- not just one -- the arguments won't be detected by Osculator at all.




                      there's got to be some combination of these things that will work...

                      Comment


                      • #12
                        Crap, I just realized the code and reference example I pasted in the last reply is for oscMessage, not oscMsg...sorry, you are right, there doesn't appear to be any documentation for oscMsg. I didn't write this part of the code. I am going to find a different osc object to pass things to Osculator...

                        Comment


                        • #13
                          Misha,
                          Why don't you just use oscP5 directly?

                          Given:

                          Code:
                          [COLOR=#3E3E3E]oscP5 = new OscP5(this,12000);[/COLOR]
                          [COLOR=#3E3E3E]myRemoteLocation = new NetAddress("127.0.0.1",12000);[/COLOR]
                          Send a message with no argument:
                          Code:
                           OscMessage myMessage = new OscMessage("/01_redThing");
                           oscP5.send(myMessage, myRemoteLocation);
                          Send a message with one integer argument, 1:
                          Code:
                          OscMessage myMessage = new OscMessage("/01_redThing");
                          [COLOR=#3E3E3E]myMessage.add(1);[/COLOR]
                          oscP5.send(myMessage, myRemoteLocation);

                          Comment


                          • #14
                            Honestly, I don't know. My collaborator is much more sophisticated than I am, and very unavailable at the moment. The below method is also his. Where is he getting oscSend() ? I don't see that in oscP5 either.

                            -----------------------
                            boolean isActive() // -o-
                            {
                            if (isDelayed()) { return true; }


                            boolean differenceConfirmed = false;
                            int diffcount = 0;


                            scan_difflist:
                            for (int y = centerY-radius; y <= centerY+radius; y++) {
                            for (int x = centerX-radius; x <= centerX+radius; x++) {
                            if ( (pow(centerX-x,2) + (pow(centerY-y,2))) <= radiSq )
                            {
                            if (1 == difflist[(y*width)+x])
                            {
                            if (pixelDiffCountMinimum < ++diffcount) {
                            differenceConfirmed = true;
                            break scan_difflist;
                            }
                            }
                            } // endif -- within circle radius
                            } // endfor -- x
                            } // endfor -- y




                            if (differenceConfirmed)
                            {
                            trigger_count += 1;

                            if (osc_trigger) {
                            oscSend();
                            }
                            setDelayTime(0); // positive hit automatically resets delayInterval
                            }


                            return differenceConfirmed;


                            } // isActive()

                            Comment

                            Working...
                            X