I know why I don't use firmata. Too many unspecified variables. Where does analogPin get changed? Where does ANALOG_MESSAGE come from? Where does TOTAL_ANALOG_PINS come from? You declare ledJ1State and ledJ2State and nothing gets done with them. What is the purpose of TimerFreeTone.h?
I don't know enough about firmata to know what's going on behind the scenes. This I think, is one reason nobody uses it. If you can define more clearly what you're trying to accomplish, maybe there's some advice available for you.