Processing 2.2.1 + Shift registers

I'm building a project that involves shift registers. The project also involves taking keyboard input using processing, and controlling an LED matrix through the shift registers.

Controlling the shift registers through the board in the Arduino language is easy using the shiftOut command. Unfortunately, if I use Processing to change the board after a keyboard input, I have to make the board output to the shift registers through Processing, and I don't know what the commands to do that are.

So I have 3 possible ways of doing it, and 3 questions

1) Is there a command to output data to a shift register in Processing?

2) Is it hard to write a function to output the data myself?

3) Is there a way to activate a function on the Arduino based off input collected in Processing?

Unless its a very basic hardware change, I can't really do much in terms of adding hardware at this point.

1) Is there a command to output data to a shift register in Processing?

No, because a shift register requires more than one pin.

2) Is it hard to write a function to output the data myself?

No. Look at what shiftOut() does, and replicate that.

3) Is there a way to activate a function on the Arduino based off input collected in Processing?

If, by "Processing", you actually mean after you've installed a Firmata sketch on the Arduino, the answer is no. But, you could write your own protocol to send data, from Processing to the Arduino, via the serial port, and have the Arduino do whatever you want when it receives your commands.

No. Look at what shiftOut() does, and replicate that.

I was wondering if it really was that easy.

So is it as simple as just writing a loop at outputs a single bit to the shift register each loop? Does there need to be a delay between the time the bits are sent? Or can the shift register handle inputs faster than the Arduino can output

If, by "Processing", you actually mean after you've installed a Firmata sketch on the Arduino, the answer is no. But, you could write your own protocol to send data, from Processing to the Arduino, via the serial port, and have the Arduino do whatever you want when it receives your commands.

What you're saying is that I can write data to the serial port, and modify the Firmata sketch to take that input and do what I want with it?

and modify the Firmata sketch to take that input and do what I want with it?

No, I mean you can replace the Firmata sketch with one you write.