Programming pinOuts on EL Escudo with Processing and XBee

I have a pretty successful project but want to take it the next level and make it wireless. I just haven’t used the XBee and want to know if this would sound feasible. Here’s a video: http://metatek.blogspot.com/2012/07/el-wire-beat-detector-with-processing.html.
The Processing sketch below is using the Sonia library to process audio input (youtube) and the sound level triggers EL Wires to light up on the sequencer. I am going through an Arduino Duo though I know I could go directly through the EL Escudo, just don’t have the interface.
So given the approach below, how hard would it be to make this work wirelessly, sending pinOut commands to several different arduino/sequencer/ELWire units to have a centrally controlled program?

import processing.serial.*;
import cc.arduino.*;
import pitaru.sonia_v2_9.*;
Arduino arduino;
int[] ledPin = {2,3,4}; // EL Escudo pinOuts start at A=2, B=3, etc.
float beat;

void setup() {
  //println(Arduino.list());
  arduino = new Arduino(this, Arduino.list()[1], 57600);
  for(int i = 0;i<3;i++) {
    arduino.pinMode(ledPin[i], Arduino.OUTPUT);
  }
  
  size(200,200);
  frameRate(30);
  // change beat value or input volume if beat isn't accurate, or maybe your sample does not have a clear enough beat
  beat = 0.03; 
  
  Sonia.start(this);
  // Start listening to the microphone
  LiveInput.start(); 
}

void draw() {
  float level = LiveInput.getLevel();
  if(level > beat) {
     blink();
  }
}

void blink() {
  for(int i = 0;i<ledPin.length;i++) {
    arduino.digitalWrite(ledPin[i], Arduino.HIGH);
  }
  delay(100);
  for(int i = 0;i<ledPin.length;i++) {
    arduino.digitalWrite(ledPin[i], Arduino.LOW);
  }
  delay(100);
}

// Close the sound engine
public void stop() {
  Sonia.stop();
  super.stop();
}

So given the approach below, how hard would it be to make this work wirelessly, sending pinOut commands to several different arduino/sequencer/ELWire units to have a centrally controlled program?

The XBees replace the wires between the PC and the Arduino. Absolutely no code changes are required.

That Processing code sends data to ONE application on the other end of the serial port. Where does the "several different arduino" part come in?

PaulS: That Processing code sends data to ONE application on the other end of the serial port. Where does the "several different arduino" part come in?

Yes this is something to figure out. I thought there might be some other protocol besides a serial Arduino object to set up for wireless communication but I guess not. Which is good news. But maybe something like arduino1 = new Arduino(this, Arduino.list()[1], 57600); arduino2 = new Arduino(this, Arduino.list()[1], 57600); arduino3 = new Arduino(this, Arduino.list()[1], 57600); arduino4 = new Arduino(this, Arduino.list()[1], 57600); Except I don't know how the program would know which arduino is which.

Arduino.list()[1] is the 2nd element in an array of COM port names. You have just defined 4 connections to the same serial port. Only 1 of them will actually work. The other 3 will fail with "COM Port already in use".

If you want to talk to multiple Arduinos from Processing, firmata needs to be dumped, and replaced with your own protocol. No way to use firmata to do what you want.

Ah, ok thanks.