This is a Node.js module that can be used to send commands to an Art-Net node.
connect, set channel 1 to 255, disconnect.
var artnet = require('artnet');
artnet.connect('172.16.23.15');
artnet.set(1, 255, function () {
artnet.close();
});
The set method can set multiple channels at once:
Use an array to set subsequent channels...
// set channel 100 to 10, channel 101 to 20 and channel 102 to 30
artnet.set(100, [10, 20, 30]);
...or use an object to set multiple channels.
// set channel 100 to 255 and channel 200 to 127
artnet.set({100: 255, 200: 127});
-
connect( host, port, universe, interval )
- port (default
6454
) - universe (default
0
) - interval (if a number >= 50 is set, data will be send to the Art-Net node in given microsecond intervals)
- port (default
-
set( )
- set( number channel, number value, function callback )
- set( number channel, array values, function callback )
- set( object channelvalues, function callback )
if callback is set to boolean false
data will only be written to the internal buffer without sending. This makes sense if you wanna make sure that multiple set commands are sent simultaneously or if you're using the interval option.
-
send( callback )
sends buffered data to the Art-Net node. callback is called with no arguments. -
close( )
closes the connection
Copyright (c) 2014 hobbyquaker [email protected]
Art-Net™ Designed by and Copyright Artistic Licence Holdings Ltd.