Canvas2DMX

Troubleshooting

Quick fixes for common issues when using Canvas2DMX with Processing.


πŸ–₯️ Colors look wrong / always white

Likely: HiDPI scaling or sampling the wrong pixels.

Fix

  1. Force 1Γ— pixel scale:
    void settings() { size(400, 300); pixelDensity(1); }
    
  2. Confirm mapping on-screen:

    c2d.setShowLocations(true);
    c2d.showLedLocations();
    
  3. Make sure you mapped an LED:

    c2d.setLed(0, width/2, height/2);
    
  4. Sample after drawing:

    // draw scene...
    int[] colors = c2d.getLedColors();
    c2d.visualize(colors);
    c2d.showLedLocations();
    

πŸ”Œ DMX not connecting (no light output)

Likely: Wrong device selection, drivers, or permissions.

Fix

  1. 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
    
  2. Verify you’re sending:

    if (dmx != null) c2d.sendToDmx((ch, val) -> dmx.sendValue(ch, val));
    
  3. OS tips:

    • macOS: System Settings β†’ Privacy & Security (allow serial).
    • Windows: Install FTDI/ENTTEC drivers, check COM port.
    • Linux: Add user to dialout/uucp, check /dev/ttyUSB* perms.
  4. Prove data is generated:

    int[] frame = c2d.buildDmxFrame(32);
    println(java.util.Arrays.toString(frame));
    

πŸ“ Library not showing in Processing

Likely: Wrong install path.

Fix

  1. Check Processing Sketchbook Location (Preferences).
  2. Ensure the folder exists:

    <Sketchbook>/libraries/canvas2dmx/
    
  3. Reinstall & restart Processing:

    ./gradlew deployToProcessingSketchbook
    

    Or set a custom path in gradle.properties:

    sketchbook.dir=/Users/you/Documents/Processing4
    

πŸŽ›οΈ Fixture colors wrong (e.g., red/green swapped)

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.


πŸ—ΊοΈ Markers off / some LEDs stay black

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().


πŸƒ Low performance / high CPU

Fix


🌈 Gamma/brightness feels off

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);

πŸ§ͺ Verify pipeline without hardware

Log a tiny preview periodically:

if (frameCount % 30 == 0) {
  c2d.sendToDmx((ch, val) -> { if (ch <= 16) println("ch " + ch + " = " + val); });
}

πŸ†˜ Still stuck?

1) First, try the included examples: Basics, StripMapping, InteractiveDemo.

2) If the problem persists, open an issue here:
πŸ‘‰ Open an issue

Please include:

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);
    });
  }

πŸ“š Learn More


πŸ“œ License

MIT License Β© 2025 Studio Jordan Shaw