hiroyuki / ofxArtnet

ultra simple artnet addon for openFrameworks
MIT License
68 stars 31 forks source link

Receiving ArtNet from multiple universes? #39

Closed Prodical closed 1 year ago

Prodical commented 1 year ago

Hi hiroyuki

I'm working on a project where I need to receive, (do some stuff) and then send ArtNet from/to multiple universes.

Sending to multiple universes no problem... that functionality is in the addon... but receiving from multiple universes doesn't quite work as I need...

Receiving ArtNet from different single universes works OK... though getUniverse() always returns 0 irrespective of the source universe no.

Receiving ArtNet from multiple universes also kinda works... but only seems to process data from a single universe i.e. getUniverse() always returns 0 and getSize() only returns the active channels from a single universe.

Any thoughts appreciated.

Best

Lewis

Prodical commented 1 year ago

Hi hiroyuki

Doh! I was calling m.getUniverse() before artnetReceiver.getData(m)... so that now works...

I've also managed to get closer to what I need by creating multiple instances of ofxArtnetSender and ofxArtnetReceiver with each universe using a discreet port... but it's a bit clunky...

Still, if I try to send two universes on the same port ofxArtnetReceiver only seems to process the last sendArtnet() - e.g. ofxArtnetMessage m2(data); m2.setUniverse(0, 0, 3); artnet.sendArtnet(m2); ofxArtnetMessage m0(data); m0.setUniverse(0, 0, 1); artnet.sendArtnet(m0);

only m0 is received via getData()...

Am I missing something? Any advice appreciated.

Best

Lewis

Prodical commented 1 year ago

Hi hiroyuki

Ahh... getNextData() seems to do it...

As per the code above both m2 and mo are received and split out using getUniverse()...

Sorry for thinking out loud in your Issues... I've noted a post on the oF Forum asking exactly this with no resolution... so hopefully my musings might help someone else.

Best

Lewis