M4L + DMX + DMX.SIMPLE + ARDUINO UNO - HELP!

brian randall's icon

Hey all!

So I am in the midst of attempting to use an Arduino Uno to act as the brain for my DMX light show. Through LOTS (and i mean LOTS) of trial and error, I've settled on the attached patch...
From what I've figured out in order to use the "serial to dmx" function of the DMX Simple library (I'm working with the Tinker Kit Mastershield) the DMX messages need to be formatted as "(channel)c(value)w" hence the reason why the outgoing message to the serial port is formatted as such. Everything seems to be working ok, I can grab any of the sliders and whip them around and nothing breaks. Same with the color selector. But as soon as I automate any of the parameters in the Session View in Live, everything freezes up and runs exponentially slower than if i were to just be moving the sliders manually. I need to be able to sync this all up to music for something I am working on but I can't for the life of me seem to get it working right.

I've also tried formatting the outgoing message as 1c(value)w2c(value)w3c(value)w[etc] all as one string being sent out simultaneously as opposed to the individual values being sent out separately but that didn't make it much better either.

I'm really curious if any one out there has any other suggestions I could try before I cave in and buy a "real" DMX interface. Sure that would be easier, but this is more fun! (yet extremely frustrating ^_^) If I sent the DMX info out in "true" DMX syntax would that help? Is there something wrong with my patch to be making it slug up like this? Or is the Arduino Uno just not cut out to do something like this.
(once i get it running smoothly, i have another few lights i want to hook up too if possible..)

Thanks

RGBduino3.amxd
amxd
brendan mccloskey's icon

Hi
my only experience with Arduino and M4L in this area, has been constant program hangs/crashes, which I narrowed down to the baud rate. I discovered this through unplugging the Arduino during a M4L hang, and everything came back to life. So I pulled the baud rate back to 9600, and M4L behaved itself when parsing serial data. This is purely anecdotal, and might not solve your specific issue, but worth a shot maybe?

Never tried automating parameters though; maybe some conflict caused by Live if you're automating a parameter that's already assigned remote (serial-USB) control??

Brendan

kodamapixel's icon

I would second Brendan's post. I've found that using automation in Live seems to exacerbate the problem, and if you can put a [speedlim] or similar in there, you might find things running more smoothly.

mvf's icon

I suggest, that you set an update limit for all live.sliders you use. In edit mode select the slider object, click cmd+i (opens the object-inspector), then set "update limit (ms)" to maybe 20 ms (default is 1., which is too fast for most automation). In your patch the metro sends data only each 100 ms, so you can even use 100 ms as an update limit.
You can also try "defer automation output" (in the inspector).
qlim or speedlim objects, even deferlow before the swatch object could help, too. But maybe this is not needed.

brian randall's icon

@mvf hot dang adjusting the slider update limit totally fixed it. thank you so much!

HERE IT IS FOR ANYONE ELSE OUT THERE LOOKING FOR A WAY TO DO IT.

a max for live patch that works with ableton and the DMX tinker kit master shield.

(for those who are wondering, i'm using the DMXSimple serial to dmx example patch, slightly tweaked of course to reflect the proper amount of dmx channels i am using. also, FOR THE RECORD, the arduino website says that you don't need the FTDI driver for serial i/o to work, but in this case you DO.) if anyone else has any other questions from here on out, i'd be happy to be of assistance. i feel like i've just about mastered DMX protocol in the last couple weeks figuring all this stuff out lol.

fair warning: this is still kind of buggy. it works, but still hangs occasionally and needs a hard reset on not only ableton, but the arduino and the light module itself too. if anyone else has any suggestions on how to sturdy it up, i'm all ears (or, well, eyes...)

RGBduino31.amxd
amxd
brian randall's icon

UPDATE.
output was freezing / added a qmetro to poll at same rate as slider refresh rate. very crucial that you enable the qmetro by turning on the X under light 1. (alternatively, a slider whose range from 0-1 could be used and midi mapped if you don't want to have to click it every time)

100% reliable and working now.

don't forget, you still need the FTDI comport driver for this to work.

RGBduino33.amxd
amxd
Jimmy Dorsey's icon

Does this patch work with Sierra? I had it working (and freezing up) with Yosemite and when i just upgraded I cant seem to get my arduino with DMX simple to work. From what I read you dont have to use the FTDI com Port drivers anymore as Apple has its own version? Am i reading that correct?