Canvas2DMX

πŸš€ Getting Started with Canvas2DMX

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.


1. Requirements


2. Installation

  1. Install the DMX4Artists library in Processing:
    • Open Processing β†’ Sketch β†’ Import Library β†’ Add Library…
    • Search for DMX4Artists and install.
  2. Download or clone the Canvas2DMX library:
    git clone https://github.com/jshaw/Canvas2DMX.git
    
  3. Copy the built library folder into your Processing libraries directory:

    Documents/Processing/libraries/
    
  4. Restart Processing. You should now see Canvas2DMX listed under Sketch β†’ Import Library.

3. Your First Sketch

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.


4. Next Steps


βœ… That’s it! You’re ready to build interactive Processing sketches that control DMX lighting in real time.


πŸ“š Learn More


πŸ“œ License

MIT License Β© 2025 Studio Jordan Shaw