Announcement

Collapse
No announcement yet.

Set address dynamically with message args

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

  • Set address dynamically with message args

    Hi,

    I'm triyng to route dynamically message from my software to a touchosc remote. Message have few args, and i will to know if it's possible to use one of the message args (typically an int) as sub value of address routing.
    ie:

    message is composed like this:

    /provider/message
    0 = param number
    1 = value
    2 = param name

    I would like to route this lie that:
    host/controller<param number> : value
    host/label<param number> : param name

    i can't figure how to do this...
    Thanks in advance.

  • #2
    Hello sonotone,

    That is an interesting question.

    Here is how you can do, though it will not be exactly how you requested. There is no way to extract an argument value and put it in the address string at the moment. However you can do something close:

    (I assume you are using the latest version 2.11, uploaded yesterday).

    First of all you will need to create two routings for the two types of messages you want to send:
    • Open the Parameters Window and go the OSC tab.
    • Click on the + button twice to add two routings.
    • Edit the routings with the OSC Routing Editor, by clicking the pen button.
    • For the first routing, enter /host/controller<address> as the rewrite address.
    • For the second routing, enter /host/label<address> as the rewrite address.
    You will need to adjust the target of these routings. By default the target is the default target, but I would advise you to enter manually the host and port in the second target slot and set you two routings to use the second target. Here is how the configuration looks like at the moment:

    routings configuration.png

    Now, you will need to demultiplex the messages to extract the parameter number:
    • Close the Parameters Window.
    • Select your message (/provider/message) and choose Edit -> Demux.
    • Now send some messages from the provider again to extract the parameter numbers.
    • You will see that it create sub-entries for each parameter number, for which there is two arguments.
    • Assign a OSC Routing event to the first argument (0) and choose the /host/controller<address> routing (named Controller in my example picture).
    • Assign a OSC Routing event to the second argument (1) and choose the /host/label<address> routing (named Label in my example picture).
    • Repeat for each demuxed parameters.
    The configuration now looks like this (note: I used the message /test instead of /provider/message):

    main window demux config.png

    If I look at the result in another window, I get this:

    main window demux result.png

    As you can see, the original address is included in the resulting addresses, but I believe this is not a big deal. If you absolutely need to construct the exact messages you describied, please email me (camille at osculator dot net) and I will see how I can implement a solution to solve this problem.


    Best Regards,
    Camille

    Comment


    • #3
      Thanks for your reply.

      I've tried your solution, but can't get it to work.

      The message is coming from LiveOsc API, and i'm trying t get device params when modified.

      Thismessage is composed with 5 indexes, where the third index represent the parameter index. If i demux the entire message, each device has it's own index, something i don't want.

      So i demux the index[2] like this:

      Capture d’écran 2011-12-07 à 12.10.48.png

      Capture d’écran 2011-12-07 à 12.14.07.png


      If i try with a static route, it works perfectly (thanks for input !), but can't get it with dynamic addresses...

      console log of demuxed message:

      Code:
      ... OSCulator: /live/device/param 1 [1]: "NOISE-AMP"

      Cheers.

      Comment


      • #4
        ok, I have tried with LiveOSC and came up with these two OSCulator files that you can try.
        Let me know if that is what you need.
        Attached Files

        Comment


        • #5
          Sorry, my mistake, my address wasn't correct!

          Comment

          Working...
          X