Canvas2DMX is a Processing library that maps pixels from your sketch to DMX fixtures in real time.
Define LED mappings (strips, grids, rings, corners), apply color correction, and send output to any DMX backend using a simple callback.
Inspired by FadeCandy and Open Pixel Control by Micah Elizabeth Scott.
"rgb"
, "drgb"
, "drgbsc"
)import com.studiojordanshaw.canvas2dmx.*;
import com.jaysonh.dmx4artists.*;
Canvas2DMX c2d;
DMXControl dmx;
void setup() {
size(400, 200);
pixelDensity(1);
c2d = new Canvas2DMX(this);
c2d.mapLedStrip(0, 8, width/2f, height/2f, 40, 0, false);
c2d.setChannelPattern("drgb");
c2d.setDefaultValue('d', 255);
c2d.setStartAt(1);
try {
dmx = new DMXControl(0, 512);
} catch (Exception e) {
dmx = null;
}
}
void draw() {
background(0);
ellipse(mouseX, mouseY, 100, 100);
int[] colors = c2d.getLedColors();
c2d.visualize(colors);
c2d.showLedLocations();
if (dmx != null) {
c2d.sendToDmx((ch, val) -> dmx.sendValue(ch, val));
}
}
MIT License © 2025 Studio Jordan Shaw