Controlling video and lighting with Max


    Mattijs's icon
    Mattijs's icon
    Mar 31 2014 | 3:02 pm
    I build software to control video and lighting, which I test regularly at techno parties, cooperating with motion graphics designer Jaap Drupsteen and lighting designer Bob Roijen. All video and lighting are controlled with Ableton Live and custom Max applications, replacing any lighting desks or media servers.
    [See the full post at: Controlling video and lighting with Max]

    • Nat's icon
      Nat's icon
      Mar 31 2014 | 9:10 pm
      Very nice, I've worked with a lot of persons who only trust their very expensive lighting desks, nice to see Max used to drive large installations !
    • basvlk's icon
      basvlk's icon
      Apr 01 2014 | 1:45 am
      very nice! but where do we see what it looks like in action?
    • Stephane Morisse's icon
      Stephane Morisse's icon
      Stephane Morisse
      Apr 01 2014 | 12:26 pm
      @ Nat : very expensive, and some still "relying" on floppy disks... :)
    • Mattijs's icon
      Mattijs's icon
      Apr 01 2014 | 6:48 pm
      Hey all, thanks for the kind words.
      Here's some footage of this in action:
      A more lighting-oriented video from a different set:
      Cheers, Mattijs
    • Matthieu Pernaud's icon
      Matthieu Pernaud's icon
      Matthieu Pernaud
      Apr 06 2014 | 10:27 pm
      Nice !
      As I also just started to make custom max/msp patches to drive lightings, I'm really curious about the gear you use to transmit dmx (lanbox ?) to the lighting system. Could you tell a bit more about this ?
    • hepi's icon
      hepi's icon
      Apr 10 2014 | 11:39 am
      Are you sharing these patches? or parts of them?
    • Mattijs's icon
      Mattijs's icon
      Apr 11 2014 | 10:42 am
      @Matthieu: I get a lot of questions about how this works, so here's an attempt at a quick rundown, hopefully it is of some use for those who think about controlling lighting with Max.
      First of all it's important to understand what DMX is. In as little jargon as possible:
      • DMX is just a series of 512 values transmitted about 30 times a second, sent over cables with XLR connectors (3-pins, sometimes 5-pins).
      • every lighting fixture (strobe, moving head, LED bar, smoke machine) has a DMX in -and- a DMX out connector, i.e. it mirrors the input to the output, the fixtures are all connected like a daisy chain.
      • every lighting fixture has a certain number of parameters and a DMX address.
      • if a moving head fixture has 15 parameters and is set to address 163, it will look at the 512 DMX values and pick the 163rd for parameter 1, the 164th for parameter 2, 165th for parameter 3, etc, up to the 178th for parameter 15.
      • this means that when setting the address on a fixture, you need to keep in mind how many parameters the previous fixture has to make sure you don't have overlapping values. This is a process people call 'patching' the fixtures. It is done every time there is a new configuration of fixtures. When all addresses are set on the fixtures, these have to be set in the lighting controller as well (in what is called the 'patch list') so it knows what fixtures to control with what values in the series of 512.
      • if your fixture parameters add up to more than 512 values, you need an extra DMX line. A line is known as a 'universe'.
      The most basic solution to transmit DMX from Max is this:, people have made max objects for it.
      For sending multiple universes I prefer Artnet.
      The purpose of Artnet is nothing more than to send DMX values over ethernet, with UDP packets. Every packet contains the 512 values and a universe value. This allows transmitting any amount of universes over ethernet, up to a maximum of 256 universes (split into 16 'subnets', each of which then has 16 universes).
      These UDP packets have to be translated to DMX by an Artnet->DMX converter box (known as a 'node'), which can be set to look for a particular universe and output those packets as DMX from its XLR output ('DMX port').
      The cheapest node I used (one per universe) is: It works great, although it has a fixed output frequency of 44 Hz (meaning it serially transmits all 512 DMX values, one 'frame', 44 times a second), which is the maximum allowed frequency for DMX. I had a situation where cheap LED tubes would only work properly with 30 Hz, so for that project I switched back to using Enttec USB Pro boxes, which transmit at 30 Hz, although I could also have used a more advanced (but much more expensive) node.
      For more than 1 universe you can simply use a network switch (like and connect multiple Enttec ODE's. They have a software tool, NMU, that allows you to set which universe from the Artnet stream to output as DMX for each box.
      I also have good experiences with nodes with multiple ports, for example from ELC, this has a nice display that indicates which universes it is actually receiving data on and it allows you to route universes to different DMX outputs. I think it sells for around €2500,- usually we rent it for a few days together with the lighting fixtures.
      One thing to note with an ELC node like this is that although it has 6 ports, standard Artnet (as opposed to ELC's own Artnet-like protocol) can only address 4 universes per IP address, so the extra 2 ports won't work as expected. Took me some time to figure out :p
      8-port nodes typically have two IP addresses, like this one I used:, which worked fine, although this particular node has the limitation that it does not process packets sent by broadcast (i.e. sending to, which means sending to each device on the network), but only by unicast (i.e. sending the packets directly to the IP address of the node).
      Something to understand when you are thinking of implementing Artnet in your patch; there are two important components:
      A) the protocol that you use to send the values (basically an UDP packet with a header that identifies it as an Artnet packet and contains stuff like how many values it has, followed by the actual values (one byte each, maximum of 512 values).
      B) the mechanism for polling existence of and information about the nodes in the network. For quick and dirty work you can usually find a way around this.
      Officially for transmitting or receiving Artnet your computer should be set to an IP range of 2.x.x.x or 10.x.x.x, with subnet mask For part B this is necessary (why? see below), but for part A it is not, as long as the UDP packets are sent to the IP(s) where you want them to be used it's all fine.
      A is quite easy to put together from the Artnet-specification (, page 20-21), there are some examples patches available for Max. B is more work, I wrapped the artnet4j library ( in an mxj external for this.
      Officially you are supposed to send your Artnet packets to the IP addresses of each available node separately: unicast. For this you need to know the IP addresses, so you officially need part B to auto-detect all IP addresses of systems that can handle Artnet.
      Part B is essentially doing the same as when you type 'ping' and 'ping' in Terminal, look at the IP's in the replies and compose a list of the addresses of devices that you know can receive Artnet. This is why, when working with part B, you need your computer to be in those ranges.
      But usually just broadcasting your part A packets (i.e. sending to IP address so they get picked up by each node) works just as well as long as your nodes don't actively skip messages that are sent by broadcast, like the Acclaim one I mentioned above.
      I admit that I found all this a bit confusing at start, I guess because you need to learn about DMX and about networking at the same time, and most devices will not show an error message when you make a mistake somewhere in the process, they will just not work and leave it up to you to guess why. But once you get an overview it's all quite straightforward and robust.
      The real challenge is to come up with a user interface that allows you to control a lot of lights that each have a lot of parameters in a way that makes sense and allows for creativity. Lighting desks do a horrible job at that in my opinion ;)
      Anyway, hope this helps, I guess I should take the time to write a proper tutorial for this..
    • Mattijs's icon
      Mattijs's icon
      Apr 11 2014 | 11:06 am
      @Hepi: I would love to share this stuff but the more complex the patches are, the more time it takes to clean them up and make them useful for others.
      Some of the stuff I use is available online though, at Hopefully in the future, more applications and plugins in this category will become available there.
    • basvlk's icon
      basvlk's icon
      Apr 23 2014 | 9:44 pm
      great examples Mattijs, thanks for sharing!
      I'm working on adding visuals to my music but am looking at all kinds of triggers I could use to synchronise visuals to music. Do you do anything like that? I suppose as a minimum, you have time synchronisation with the music -but after that, are visuals generated by independent operators, or do you get some signals from the DJ(s) too to incorporate?
    • Andro's icon
      Andro's icon
      Apr 24 2014 | 1:06 pm
      Mattijs ! I've been busy trying out how to make a DMX controller in Max msp, that huge explanation you gave (especially the hardware aspect) was invaluable ! Thanks a lot !
    • Mattijs's icon
      Mattijs's icon
      Apr 24 2014 | 1:29 pm
      @Basvlk, thanks!
      For festivals we only use the tempo and beat position of the DJs, analyzed by my custom beat tracker. The practical problem with trying to use more inputs in a festival setting is that there is no communication at all between the lighting/video people in the front of house and the performers on stage.
      For the Feed Me live tour though, we make a lighting clip and a video clip for every sound clip in his Ableton Live set, which are mixed in real-time, depending on which clips he feels like using at any given time, and there are real-time visual effects linked with his audio effects.
      @Andro: thanks, happy it helps!
    • keepsound's icon
      keepsound's icon
      May 02 2014 | 3:31 am
      Hi Mattijs, I have read and download the artnet4j library ( but I can't wrap the code to implement it an mxj external. (that's only for the Art-Net Poll implementation. I have problems with an unknown (and chinese) Artnet interface, (and I have two of them...). They receive in broadcast mode from a Madrix app, and the tx gets on 8 different dmx universes, but it seems the two interfaces receives the same information of only the first 4 universes on both. I have tryed to send the data packets on two distint IP addresses, but ther's no way to find out the MAC addresses of them (OEM Code maybe I've find it). Now I've build a little app to extract the IP address from the OEM and MAC infos, but I have to poll the interfaces... could you be so gently to send me your java class script for the mxj? This is my little app:
      Max Patcher
      In Max, select New From Clipboard.
      Show Text
    • basvlk's icon
      basvlk's icon
      May 07 2014 | 2:00 pm
      very cool stuff Mattijs!
    • Mattijs's icon
      Mattijs's icon
      Jul 07 2014 | 6:01 pm
      @keepsound: As soon as I have time I'll clean up the external, do more testing for scenarios other than how I use it myself and then publish it online. Things are busy at the moment though, I'm afraid I don't know when this will get done.
      Best, Mattijs
    • keepsound's icon
      keepsound's icon
      Jul 08 2014 | 12:06 am
      Hi Mattijs! many thanks for your reply here! At this moment I've abandoned this project, but maybe in the next time I'll consider to work now around it. Now I'm more interested in your other project about the SMPTE writer (I have to build a reader, remember?) . I've tryed to build my obj on XCode with the porject you have put here, but without success...I don't know anything about C++... best regards. And about busy things and in Italy it's the same, if not busier. Best regards! Ciao . Italo
    • agustin genoud's icon
      agustin genoud's icon
      agustin genoud
      Sep 26 2015 | 8:19 pm
      hi MATTIJS, this is a great intro to dmx! What do you think about this interface ? for testing purpuses can i connect it directly to a light and try some to patch some things or should i need something else? (im thinking in an amplifier or something like that -talking in audio terms-)
    • Marcelo Padovani's icon
      Marcelo Padovani's icon
      Marcelo Padovani
      Oct 08 2019 | 8:29 am
      For those who are controlling dmx lightning using max or other tools, did any of you ever used something that return euller angles as rotation (such as look at functions in unity) and had to convert them to the pan/tilt system that moving heads for example use? How did you made the conversion between euller angles to pan/tilt rotations?
    • Luke Woodbury's icon
      Luke Woodbury's icon
      Luke Woodbury
      Oct 09 2019 | 10:20 am
      I don't claim to understand eulers and quaternions so I probably can't answer any follow up questions! But do objects like [jit.euler2quat] and [jit.quat2axis] help you any?