We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › DMX ouput library - suggestion
Pages: 1 2 3 
DMX ouput library - suggestion (Read 26058 times)
DMX ouput library - suggestion
Oct 10th, 2005, 12:23pm
 
background:
I am working on an interactive installation featuring a lighting chandelier made up of lots of addressable RGB light sources.  I am using Processing to generate the colour behaviours and colour maps that will be displayed across the light fitting -- this is clearly where Processing really demonstrates its power!  

proposal - DMX output module:
The lighting chandlier is controllable via industry-standard DMX lighting protocol.  At present, I will be using a seperate VIDEO to DMX converter software to get the Processing output displayed on the light.   What would be great is if I could have Processing directly generate the DMX commands.   It would be an interesting Library to have as it would allow Processing to interface with an enormous library of lighting / special effects / controllers, etc..
In my immediate application, it seems that grabbing RGB values from the Processing screen and output these as RGB values over DMX should not be too difficult?
This however is a little beyond my own programming abilities and therefore I would really like to hear what you think about this, and if anyone else is interested in collaboration, or even already developing something similar?

notes:  
about DMX:   http://en.wikipedia.org/wiki/DMX_(lighting)
Re: DMX ouput library - suggestion
Reply #1 - Oct 10th, 2005, 9:17pm
 
If you are flexible on platform and get stuck trying to do it with processing; MAX (http://cycling74.com) has support for DMX controllers through this product http://www.lanbox.com/
Re: DMX ouput library - suggestion
Reply #2 - Oct 10th, 2005, 10:25pm
 
generating the commands through processing shouldn't be too bad, though is there a good way to get an interface to it? either via serial or network? from the wikipedia page, it's talking about it being an XLR cable that's sending RS-485, so you'll need another hardware layer between p5, so it all depends on what that layer looks like--for instance, if there's a converter box that hooks up to your serial port or something like that. and sends out the signals over XLR or whatever.
Re: DMX ouput library - suggestion
Reply #3 - Oct 13th, 2005, 4:01pm
 
Just to share some infos, I am also looking into that atm and I found some cool wireless DMX lights, called eDMX which use a simple WLAN for receiving control commands, so no more wires required, just a WLAN-Router.
Anyway I would really appreciate seeing this library, and help where I can, also I am not very experienced in Processing or Java.
Re: DMX ouput library - suggestion
Reply #4 - Oct 16th, 2005, 12:56pm
 
VVVV has DMX output as well. There's lots of discussion on it over. at their tiki, including practical tips, info about hardware interfaces etc.
Re: DMX ouput library - suggestion
Reply #5 - Oct 8th, 2006, 8:04pm
 
If anyone is still thinking about developing such library this may be a good way of interfacing to DMX:

Open DMX USB interface: this project created by ENTTEC (www.enttec.com) is an open source hardware and software DMX512 interface

http://sourceforge.net/projects/opendmxusb/
http://www.enttec.com/index.php?menu=Products&prod=70303&show=description

Re: DMX ouput library - suggestion
Reply #6 - Feb 11th, 2007, 12:52am
 
I just got one of those enttec USB pro DMX controllers (not the openDMX model though).

It's fairly easy to interface with it via the serial library.  I've borrowed a DMX dimmer pack and am having WAY too much fun with some desk lamps now.

There's a message format you have to use to communicate with the DMX controller over USB (as a virtual com port).  You can find the spec for talking to the DMX box on the enttec site.  This sketch will fade channel zero depending on the mouse position.  The DMX pro has several messages to do things like set the DMX timings etc, but right now I've only implemented the "send DMX packet" message..

Hope this helps someone.  Depending on how much work it turns out to be, I may build a library around this thing.

-Ben

Code:

import processing.serial.*;

static byte DMX_PRO_MESSAGE_START = byte(0x7E);
static byte DMX_PRO_MESSAGE_END = byte(0xE7);
static byte DMX_PRO_SEND_PACKET = byte(6);

Serial dmx;
int universeSize = 6;// lower = faster updates..
byte[] channelValues;

void setup()
{
size(256, 200);
frameRate(60);

channelValues = new byte[universeSize];

for(int i = 0; i < universeSize; i++)
{
channelValues[i] = byte(0);
}

dmx = new Serial(this, "COM8", 115200);
}

void draw()
{
setDMXChannel(0, mouseX);
}


int getDMXChannel(int channel)
{
return int(channelValues[channel]);
}

void setDMXChannel(int channel, int value)
{
if(channelValues[channel] != byte(value))
{
channelValues[channel] = byte(value);
byte[] data = new byte[universeSize+1];

data[0] = 0; // DMX command byte..

for(int i = 0; i < universeSize; i++)
{
data[i+1] = channelValues[i];
}

dmxMessage( DMX_PRO_SEND_PACKET, data );
}
}

void dmxMessage( byte messageType, byte[] data )
{
byte[] message;
int dataSize = data.length;
message = new byte[5 + dataSize];

message[0] = DMX_PRO_MESSAGE_START;

message[1] = messageType;

message[2] = byte(dataSize & 255);
message[3] = byte((dataSize >> 8) & 255);

// there's probably a faster way to do this...
for(int i = 0; i < dataSize; i++)
{
message[i+4] = data[i];
}

message[4 + dataSize] = DMX_PRO_MESSAGE_END;

dmx.write(message);
}
Re: DMX ouput library - suggestion
Reply #7 - Dec 1st, 2007, 1:06am
 
Thanks Rrrufusss!  It would be great if a library was made for Enttec's USBpro.  I'd support it and use it in multiple lighting control applications I’m working on.

Contact me if there is any new info regarding this dev: events at faultlineshow dot com
Re: DMX ouput library - suggestion
Reply #8 - Apr 14th, 2008, 5:19pm
 
Hi,

I just finished a project for a class at the university:

http://users.design.ucla.edu/~acolubri/home/Group/PopMotion/PopMotion.html

where I used a DMX board and a DMX USB pro adapter.

Based on the code posted here I implemented a little DMX object for processing. It's simpler than the original example, and I think it's a little bit faster too:

http://users.design.ucla.edu/~acolubri/home/Group/PopMotion/code/DMX.pde

Andres
Re: DMX ouput library - suggestion
Reply #9 - Sep 17th, 2008, 10:19am
 
Hi Guys,

i was trying the dmx class with a enttec DMX and a Showtech LED Pixel Track Fixture, but when i enter the serial port etc. i get this error:

java.lang.NullPointerException
at processing.serial.Serial.write(Serial.java:518)
at sketch_080917d.dmxMessage(sketch_080917d.java:76)
at sketch_080917d.setDMXChannel(sketch_080917d.java:51)
at sketch_080917d.draw(sketch_080917d.java:28)
at processing.core.PApplet.handleDraw(PApplet.java:1400)
at processing.core.PApplet.run(PApplet.java:1305)
at java.lang.Thread.run(Thread.java:613)


for calling it simply looks like this:

DMX dmx;

void setup(){
 size(200,200);
 dmx = new DMX(this,"cu.usbserial-ENR2OIA8",3000,100);
//  initDMXChannels();
}


void draw(){
 dmx.setDMXChannel(1,255);
}
Re: DMX ouput library - suggestion
Reply #10 - Sep 17th, 2008, 10:19am
 
i meant with an Enttec DMX USB Pro
Re: DMX ouput library - suggestion
Reply #11 - Sep 17th, 2008, 12:28pm
 
I have been using the class with the DMX USB Pro adapter. Initialization was usually something like this:

dmx = new DMX(this, "COM1", 14000, 12);

What COM port the DMX adapter gets mapped to on your computer?
Re: DMX ouput library - suggestion
Reply #12 - Sep 17th, 2008, 12:48pm
 
Since i am on an Mac (OS X 10.5) the port ist cu.usbserial-ENR2OIA8 and tty.usbserial-ENR2OIA8 but usually its the cu.usbserial-ENR2OIA8.

and the error only occurs, as soon i enter a value greater then 0 for the value of the channel:
dmx.setDMXChannel(1,0);  <- no error, but nothing happens
dmx.setDMXChannel(1,2); <- error

best
Re: DMX ouput library - suggestion
Reply #13 - Sep 17th, 2008, 5:23pm
 
Not quite sure what the problem could be... Have checked your DMX adapter for hardware defects?

The code of the DMX class is rather simple, at the and all the setDMXChannel function does is to call serial.write(message) where message is the array containing the values for each channel.
Re: DMX ouput library - suggestion
Reply #14 - Sep 18th, 2008, 10:22am
 
Yes i chekc it all, when i am using vvvv.org it works perfectly, i only get this java.lang.NullPointerException in processing. maybe trouble with the port, i tried several
Pages: 1 2 3