OSC bundles with surface select then media select don't work
  • User avatar
    xavier.seignard
    member
    Posts: 10
    Joined: Fri Nov 10, 2017 2:39 pm
    Contact:

    OSC bundles with surface select then media select don't work

    by xavier.seignard » Mon Dec 18, 2017 7:37 pm

    Hello,

    I noticed that sending an osc bundle with multiple sequences of surface select then media select only updates the first surface and not the others.

    I send osc bundles from node.js using the excellent https://github.com/colinbdclark/osc.js/

    Here is the shape of my osc bundle (with a 0 timetag)

    Code: Select all

    [ { address: '/surfaces/Branche1/select' }, { address: '/medias/Dunes/select' }, { address: '/surfaces/Branche2/select' }, { address: '/medias/Dunes/select' }, { address: '/surfaces/Branche3/select' }, { address: '/medias/Dunes/select' }, { address: '/surfaces/Branche4/select' }, { address: '/medias/Dunes/select' }, { address: '/surfaces/Branche5/select' }, { address: '/medias/Dunes/select' }, { address: '/surfaces/Branche6/select' }, { address: '/medias/Dunes/select' } ]
    My goal here is to apply the "Dunes" media to all my surfaces.

    And only the first one (e.g. Branche1) is updated with the "Dune" media.

    To achieve what I need, I have to send separate osc messages with a delay between each (30ms seems to work).
    Something like this:

    Code: Select all

    { address: '/surfaces/Branche1/select' } 30ms { address: '/medias/Dunes/select' } 30ms { address: '/surfaces/Branche2/select' } 30ms { address: '/medias/Dunes/select' } and so on...
    Bundles work OK to bulk update other sutff, such as the luminosity or the color of all surfaces.

    Any idea?

    Regards

    Xavier
  • mad-matt
    garageCube team
    Posts: 492
    Joined: Mon Sep 09, 2013 5:50 pm

    Re: OSC bundles with surface select then media select don't work

    by mad-matt » Wed Dec 20, 2017 1:32 am

    You can /medias/Dunes/apply_to_all_surfaces
    Or put all your surfaces in a group and send /surfaces/Group 1/select and then /medias/Dunes/select
    Let me know if it's ok

    Btw, next update will allow controlling group settings directly (so you can do an assignement on /surfaces/Group 1/media_name and it will change the media on all child surfaces)
  • User avatar
    xavier.seignard
    member
    Posts: 10
    Joined: Fri Nov 10, 2017 2:39 pm
    Contact:

    Re: OSC bundles with surface select then media select don't work

    by xavier.seignard » Fri Dec 22, 2017 11:22 am

    Hello matt!

    Actually 'Branche1', 'Branche2' and so on are groups. On each I have 5 surfaces.

    Here is a sample node.js code that you can run to see the problem.

    Code: Select all

    const osc = require('osc'); const oscPort = new osc.UDPPort({ localAddress: '0.0.0.0' }); oscPort.open(); oscPort.on('ready', () => { oscPort.send( { timeTag: osc.timeTag(0), packets: [ { address: '/surfaces/Branche1/select' }, { address: '/medias/Siren/select' }, { address: '/surfaces/Branche2/select' }, { address: '/medias/Dunes/select' }, { address: '/surfaces/Branche3/select' }, { address: '/medias/Siren/select' }, { address: '/surfaces/Branche4/select' }, { address: '/medias/Dunes/select' }, { address: '/surfaces/Branche5/select' }, { address: '/medias/Siren/select' }, { address: '/surfaces/Branche6/select' }, { address: '/medias/Dunes/select' }, ], }, '127.0.0.1', 8010 ); });
    (this code tag renders code in an ugly way :) )

    This way, only is the first (e.g. Branche1) is updated. Sometimes Branche2 gets updated too. But all other messages are missed. But I can tell they are sent from the node.js program.

    Let me know if you need more info.

    Regards
  • User avatar
    xavier.seignard
    member
    Posts: 10
    Joined: Fri Nov 10, 2017 2:39 pm
    Contact:

    Re: OSC bundles with surface select then media select don't work

    by xavier.seignard » Fri Dec 22, 2017 11:48 am

    Also I wasn't aware about the "apply_to_all_surfaces" which is exactly what I need, thanks for the tip.

    Still, the problem I was facing is a valid one when you need to set a specific media to each surface.

    Thanks again for your valuable feedback. It's pleasure to control my 12000 rgb leds from madmapper :)

    Regards
  • mad-matt
    garageCube team
    Posts: 492
    Joined: Mon Sep 09, 2013 5:50 pm

    Re: OSC bundles with surface select then media select don't work

    by mad-matt » Sat Dec 23, 2017 11:34 pm

    The problem is that if you select a surface it will deselect the other ones, and if you send an OSC bundle, it's actually processed as individual messages sequentially so the last "select surface" in your bundle will be the winner...
    Ideally we should add controls to use "Selection Groups" from controls.
  • User avatar
    xavier.seignard
    member
    Posts: 10
    Joined: Fri Nov 10, 2017 2:39 pm
    Contact:

    Re: OSC bundles with surface select then media select don't work

    by xavier.seignard » Mon Dec 25, 2017 4:26 pm

    Hello Matt (and merry christmas!)

    I get your explanation, but it is the contrary that happens, e.g. only the first surface (e.g first message of the bundle) is updated with the according media (e.g. second message of the bundle). Sometimes it is also ok for the second surface/media.

    That's weird because every other bundles I send are ok (like update color of each group, or luminosity).

    It's only with this couple of "selecting a surface/group" then selecting a media" messages in a bundle. So I tried with a sequence of individual messages, and obviously I had to throttle the sending (using some JavaScript "setTimeout").

    So my guess is that updating the UI (like when you select a surface) of madmapper is a synchronous/blocking operation. Hence some OSC messages can be missed. But, hey, that's only a pure guess, I don't have any idea on how madmapper is coded.

    Have a nice day.

    Regards

Who is online

Users browsing this forum: No registered users and 2 guests