Canvas2DMX lets you map pixels from your Processing sketch directly to DMX fixtures in real-time.
This quickstart will guide you through installation and your first test sketch.
Sketch
β Import Library
β Add Libraryβ¦
git clone https://github.com/jshaw/Canvas2DMX.git
Copy the built library folder into your Processing libraries directory:
Documents/Processing/libraries/
Sketch β Import Library
.Create a new Processing sketch and paste the following code:
import com.studiojordanshaw.canvas2dmx.*;
import com.jaysonh.dmx4artists.*;
Canvas2DMX c2d;
DMXControl dmxController;
void settings() {
size(200, 200);
pixelDensity(1);
}
void setup() {
c2d = new Canvas2DMX(this);
// Map one LED at the center
c2d.setLed(0, width/2, height/2);
}
void draw() {
// Animate background color
background(frameCount % 255, 100, 200);
// Get LED colors (samples canvas)
int[] colors = c2d.getLedColors();
// Visualize in a small swatch
c2d.visualize(colors);
// Show LED marker
c2d.showLedLocations();
// Send to DMX only if controller is connected
if (dmxController != null) {
c2d.sendToDmx((ch, val) -> dmxController.sendValue(ch, val));
}
}
Run the sketch β youβll see LED markers drawn over your canvas, with sampled colors shown in a visualization strip at the bottom.
Try the examples included with the library:
Basics
β minimal LED mapping demoStripMapping
β mapping a line of LEDsInteractiveDemo
β drag shapes and see DMX output in real-timeCheck out:
β Thatβs it! Youβre ready to build interactive Processing sketches that control DMX lighting in real time.
MIT License Β© 2025 Studio Jordan Shaw