DMX-512 controller library for node.js
npm install dmx
const DMX = require('dmx')
Create a new DMX instance. This class is used to tie multiple universes together.
name
- Stringmodule
- Object implementing the Driver API
Register a new DMX Driver module by its name. These drivers are currently registered by default:
- null: a development driver that prints the universe to stdout
- artnet: driver for EnttecODE
- bbdmx: driver for BeagleBone-DMX
- dmx4all: driver for DMX4ALL devices like the "NanoDMX USB Interface"
- enttec-usb-dmx-pro: a driver for devices using a Enttec USB DMX Pro chip like the "DMXKing ultraDMX Micro".
- enttec-open-usb-dmx: driver for "Enttec Open DMX USB". This device is NOT recommended, there are known hardware limitations and this driver is not very stable. (If possible better obtain a device with the "pro" chip)
- dmxking-utra-dmx-pro: driver for the DMXKing Ultra DMX pro interface. This driver support multiple universe specify the options with Port = A or B
name
- Stringdriver
- String, referring a registered driverdevice_id
- Number or Objectoptions
- Object, driver specific options
Add a new DMX Universe with a name, driver and an optional device_id used by the driver to identify the device. For enttec-usb-dmx-pro and enttec-open-usb-dmx device_id is the path the the serial device. For artnet it is the target ip.
universe
- String, name of the universechannels
- Object, keys are channel numbers, values the values to set that channel to
Update one or multiple channels of a universe. Also emits a update
Event with the same information.
A JSON Object describing some Devices and how many channels they use.
Currently not many devices are in there but more can be added to the devices.js
file. Pull requests welcome ;-)
The following Devices are known:
- generic - a one channel dimmer
- showtec-multidim2 - 4 channel dimmer with 4A per channel
- eurolite-led-bar - Led bar with 3 RGB color segments and some programms
- stairville-led-par-56 - RGB LED Par Can with some programms
Create a new DMX Animation instance. This can be chained similar to jQuery.
to
- Object, keys are channel numbers, values the values to set that channel toduration
- Number, duration in msoptions
- Object
Add an animation Step.
The options Object takes an easing
key which allows to set a easing function from the following list:
- linear (default)
- inQuad
- outQuad
- inOutQuad
- inCubic
- outCubic
- inOutCubic
- inQuart
- outQuart
- inOutQuart
- inQuint
- outQuint
- inOutQuint
- inSine
- outSine
- inOutSine
- inExpo
- outExpo
- inOutExpo
- inCirc
- outCirc
- inOutCirc
- inElastic
- outElastic
- inOutElastic
- inBack
- outBack
- inOutBack
- inBounce
- outBounce
- inOutBounce
Returns a Animation object with the animation step added.
duration
- Number, duration in ms
Delay the next animation step for duration. Returns a Animation object with the delay step added.
universe
- Object, reference to the universe driveronFinish
- Function, called when the animation is done
Run the Animation on the specified universe.
universe
- Object, reference to the universe driver
Runs an animation constantly until animation.stop()
is called
The example below shows a value being animated for 5 seconds:
const animation = new DMX.Animation().add({
1: 255,
}, 100).add({
1: 0,
}, 100).runLoop(universe)
setTimeout(() => {
animation.stop()
}, 5000)
Versions prior to 0.2 included a Webinterface. This has since been moved into its own repository at https://github.com/node-dmx/dmx-web
We're happy to help. Chat with us on IRC in #node-dmx on freenode.