Search code examples
delphioscdmx512

Delphi UDPClient example -> ArtNet communication and parser


Recently I started a project where I need to combine OSC with ArtNet protocol. While OSC (Open Sound Control) has a few examples and documentation available, and the vvvv group also wrote Delphi parser which works really good, the ArtNet - Ethernet DMX protocol - has practically no support or, better said, example for delphi at all. The only thing I managed to found was this: http://mbed.org/users/okini3939/code/DmxArtNet/docs/c59dc374fc64/DmxArtNet_8cpp_source.html which seems incomplete and I can't get it done at all. Contacting the author was a shot in the dark...

Anyway, the main thing is in byte encoding before sending them via UDPClient. Now, since this is basically the same way the OSC works, I guess it's not that big deal, especially since apart from OSC, the ArtNet only needs to SEND tose bits via UDPClient, and does not receive nothing at all (with OSC, most of the parser was about receiving and decoding the packet...) But, along with the fact that I dare to say "it's not a big deal", I do have to say that at the same time I'm not familiar with how to do it at all.

Here at page 22 and 23 is the ArtDmx table with byte format informations...

www.artisticlicence.com/WebSiteMaster/User%20Guides/art-net.pdf

I think this is what I'd have to do in order to send commands...

Does anyone know anything about it, or have some time to give it a quick look on how it works, and maybe even give an example on how could I send the data from delphi's app...?

Thanks!

MarcS

EDIT: Looks like their site is down, since the link to pdf doesn't work anymore, however I still have a copy of it opened, so I'll copy the contents below:

ArtDmx packets can be broadcast, but it is not recommended. Significant network efficiency gains can be achieved by unicasting ArtDmx. When ArtDmx is Unicast, the following rules must be used: The transmitting device must regularly ArtPoll the network to detect any change in universe switch settings. If the transmitting device opts to Unicast, then it must Unicast ArtDmx to all nodes that are subscribed (In the ArtPollReply) to that universe. Subscribed means any universes listed in both the Swin and Swout array. If there are no subscribers to a universe that the transmitter wishes to send, then the ArtDmx may be broadcast. Implementers should provide for dynamic change between Unicast and broadcast. If the number of universe subscribers exceeds a given number, it may become more efficient to broadcast. Use of unicast only is mandatory for systems using greater that 30 universes. Table: http://shrani.si/f/2c/GQ/3NF9rewr/artnet-udp-table.png


Solution

  • So, after a while, one of main VVVV developers, Joreg, wrote thing down to delphi units, so big thanks to them and the vvvv team.

    https://github.com/vvvv/DelphiArtnet

    And here's a thread: http://vvvv.org/forum/delphi-artnet-dmx-support...#comment-110297

    Hope this helps to anyone else!