Issue reading Multiple Xbee/Arduino Combos running Firmata

I am working on a project in which two dancers will be wearing belts rigged with flex sensors that connected to a Lilypad/Xbee combo.

Right now I am running StandardFirmata on the two arduinos which are wirelessly communicating with processing using Xbee modules. The values from the analoginputs are being used in processing to trigger audio samples.

If I only turn on one of the Arduinos, the sketch runs fine. Turning on both results in the readings mixed readings between the signals from the two devices. I am familiar with the idea of using a Start byte, but I do not know how to implement them, where to implement them, or even if they are the most efficient/easiest solution to my problem.

Also another important piece of information is that I tried to pre-empt this issue by using analog pins 0-2 on arduino A and 3-5 on arduino B (each device has 3 flex sensors hooked up to it). This means that at all times, pins 0-2 on A have a higher value then 0-2 on B which read at zero. The same is true for 3-5 on device B. I am not sure if this provides a useful workaround, but though it might be good to know.

I have attached my processing sketch, and like I said both the Arduinos are running StandardFirmata(with a modified baud rate of 9600).

Thank you in advance!

WACIS_AllSensors.zip (1.06 MB)

Sorry - I don't think I ever clearly stated my problem.

How do I differentiate between the signals of my two xbee/arduino combos?
Do I need to alter the Standard Firmata sketch, Xbee settings,Processing sketch, or a combination of those?

Thanks :]

    flexSensor[0].update();
    if (flexSensor[0].trigger() == true|| (keyPressed==true&&key=='1')) {
      file[0].play(1, 1);
      gui[0].play(1);
    } else {
      gui[0].play(2);
    }


    flexSensor[1].update();
    if (flexSensor[1].trigger() == true || (keyPressed==true&&key=='2')) {
      file[1].play(1, 1);
      gui[1].play(1);
    } else {
      gui[1].play(2);
    }

You have a problem with for loops?

How do I differentiate between the signals of my two xbee/arduino combos?

If the 2 XBees/Arduinos are talking to the same receiver XBee, in AT mode, you can't distinguish which one is which using the lame-brained Firmata code. Ditch it.

yes but how to I get the readings into processing without using firmata?

yes but how to I get the readings into processing without using firmata?

Write your own sketch to read the data and send it, via Serial and the XBee, to Processing. Dump the crutches.