Page 1 of 1

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

Posted: Mon Dec 18, 2017 7:37 pm
by xavier.seignard
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

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

Posted: Wed Dec 20, 2017 1:32 am
by mad-matt
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)

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

Posted: Fri Dec 22, 2017 11:22 am
by xavier.seignard
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

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

Posted: Fri Dec 22, 2017 11:48 am
by xavier.seignard
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

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

Posted: Sat Dec 23, 2017 11:34 pm
by mad-matt
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.

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

Posted: Mon Dec 25, 2017 4:26 pm
by xavier.seignard
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