Quick fixes for common issues when using Canvas2DMX with Processing.
Likely: HiDPI scaling or sampling the wrong pixels.
Fix
void settings() { size(400, 300); pixelDensity(1); }
Confirm mapping on-screen:
c2d.setShowLocations(true);
c2d.showLedLocations();
Make sure you mapped an LED:
c2d.setLed(0, width/2, height/2);
Sample after drawing:
// draw scene...
int[] colors = c2d.getLedColors();
c2d.visualize(colors);
c2d.showLedLocations();
Likely: Wrong device selection, drivers, or permissions.
Fix
Try alternate initializers (DMX4Artists):
dmx = new DMXControl(0, 512); // first device
dmx = new DMXControl("SERIAL_NUMBER", 512); // by serial
dmx = new DMXControl("/dev/tty.usbserial-XXXX", 512); // explicit path
Verify youβre sending:
if (dmx != null) c2d.sendToDmx((ch, val) -> dmx.sendValue(ch, val));
OS tips:
dialout
/uucp
, check /dev/ttyUSB*
perms.Prove data is generated:
int[] frame = c2d.buildDmxFrame(32);
println(java.util.Arrays.toString(frame));
Likely: Wrong install path.
Fix
Ensure the folder exists:
<Sketchbook>/libraries/canvas2dmx/
Reinstall & restart Processing:
./gradlew deployToProcessingSketchbook
Or set a custom path in gradle.properties
:
sketchbook.dir=/Users/you/Documents/Processing4
Likely: Channel pattern mismatch or dimmer not set.
Fix
c2d.setChannelPattern("rgb"); // or "drgb", "drgbsc", etc.
c2d.setDefaultValue('d', 255); // full brightness if using dimmer 'd'
c2d.setDefaultValue('s', 0); // strobe off
c2d.setStartAt(1); // DMX is 1-based
Match your fixtureβs manual.
Likely: Off-canvas mapping or out-of-bounds sample.
Fix
int n = c2d.getMappedLedCount();
for (int i = 0; i < n; i++) {
int pos = c2d.getLedPixelLocation(i); // -1 = unmapped
if (pos >= 0) println("LED " + i + " β pixel " + pos);
}
Re-map to valid x,y
inside 0..width-1
, 0..height-1
.
Ensure you donβt clear the screen after getLedColors()
.
Fix
Limit frame rate:
void setup() { frameRate(30); }
Throttle logs:
if (frameCount % 30 == 0) println("debug...");
Fix
c2d.setResponse(1.2f); // 1.0 = linear
c2d.setTemperature(0.15f); // -1 warm β¦ +1 cool
float[] curve = {0.0, 0.05, 0.2, 0.5, 0.8, 1.0}; // overrides response()
c2d.setCustomCurve(curve);
Log a tiny preview periodically:
if (frameCount % 30 == 0) {
c2d.sendToDmx((ch, val) -> { if (ch <= 16) println("ch " + ch + " = " + val); });
}
1) First, try the included examples: Basics, StripMapping, InteractiveDemo.
2) If the problem persists, open an issue here:
π Open an issue
Please include:
library.properties
)/dev/tty.usbserial-B001N0ZB
)startAt
, setChannelPattern(...)
, any setDefaultValue(...)
Tip (no hardware): preview DMX output in console
// Log the first 16 channels about twice per second
if (frameCount % 30 == 0) {
c2d.sendToDmx((ch, val) -> {
if (ch <= 16) println("ch " + ch + " = " + val);
});
}
MIT License Β© 2025 Studio Jordan Shaw