Firmata and 4021B


I am doing an academic project wich involves using Arduino. The project i am doing involves getting information from Arduino to check wich button is pressed ( of a total of 40 buttons). i've seen the Paralell to Serial Shifting-In with a CD4021BE tutorial and it seems to be the solution (with a few changes, like getting it to read 40 buttons). my question is if it is possible to use firmata in the Arduino and use Processing to check the data comming from the buttons...

Many thanks in advance,

Bruno Gustavo Costa