npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

artnet

v1.4.0

Published

Module to send commands to an Art-Net node

Downloads

653

Readme

artnet

NPM version Dependency Status Build Status XO code style License

This is a Node.js module that can be used to send ArtDMX packages to an Art-Net node.

Usage

connect, set channel 1 to 255, disconnect.

var options = {
    host: '172.16.23.15'
}

var artnet = require('artnet')(options);

// set channel 1 to 255 and disconnect afterwards.
artnet.set(1, 255, function (err, res) {
    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]);

...if you want to keep certain channels unchanged set them to null

// set channel 50 to 255 and channel 52 to 127
artnet.set(50, [255, null, 127]);

you can omit the channel, it defaults to 1

// Set channel 1 to 255 and channel 2 to 127:
artnet.set([255, 127]);

Additionally, you can send trigger macros to devices.

// Send key 3, subkey 1 to all devices.
artnet.trigger(1, 3);

// Send key 2, subkey 71 (the letter 'G') to ArtNet Devices responding to 0x6A6B.
artnet.trigger(27243, 71, 2);

This lib throttles the maximum send rate to ~40Hz. Unchanged data is refreshed every ~4s.

Options

  • host (Default "255.255.255.255")
  • port (Default 6454)
  • refresh (millisecond interval for sending unchanged data to the Art-Net node. Default 4000)
  • iface (optional string IP address - bind udp socket to specific network interface)
  • sendAll (sends always the full DMX universe instead of only changed values. Default false)

Methods

set( [ [ uint15 universe , ] uint9 channel , ] uint8 value [ , function(err, res) callback ] )

set( [ [ uint15 universe , ] uint9 channel , ] array[uint8] values [ , function(err, res) callback ] )

Every parameter except the value(s) is optional. If you supply a universe you need to supply the channel also. Defaults: universe = 0, channel = 1

Callback is called with (error, response) params. If error and response are null data remained unchanged and therefore nothing has been sent.

trigger( [ [ uint15 oem , ] uint9 subkey , ] uint8 key [ , function(err, res) callback ] )

Sends an ArtNet ArtTrigger packet. ArtTriggers are typically device specific and perform functions like starting and stopping shows.

Every parameter except the key is optional. If you supply an oem, you need to supply a subkey also.

Defaults:

  • oem = 0xFFFF
  • subkey = null

Callback is called with (error, response) params.

triggers are NEVER throttled, as they are time sensitive. They are always sent immediately upon processing.

close( )

Closes the connection and stops the send interval.

setHost( string host )

Change the Art-Net hostname/address after initialization

setPort( number port )

Change the Art-Net port after initialization. Does not work when using the broadcast address 255.255.255.255.

Further Reading

License

The MIT License (MIT)

Copyright (c) 2014-2017 Sebastian Raff and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

Art-Net™ Designed by and Copyright Artistic Licence Holdings Ltd.