Mega + Max MSP

Hello! I am working on an installation where I receive analog input (photoresistors) with an Arduino and send that data into Max MSP to control sound parameters. I have had success using an Uno, receiving data through six analog ins, then sending to Max MSP using “In and Out for Dummies” (dummies accurately describes my knowledge of Arduino, but catching on quickly). However, I would like to have access to more analog inputs, so I need to use a Mega 2560.

I would appreciate any advice on what to do with modifying the .ini for “I/O for Dummies”, and any suggestions for the max patches. Current attempts have been unsuccessful.

Here’s what I think I need to change in the code: (Full code available on the playground, this chunk is the only occurence of numbers over two, so I assumed it controls what inputs/outputs are read.)

in Arduino

......
void readSendInput(){
  for(int i=0;i<18;i++){              <---- 19 pins on the uno right? so i need to up to the number of pins on the Mega (pin map says 100)
    if(portregister[i]==0){
      if(i<12){                           <---- 13 digital ins (upping to 78 for Mega?)
        Serial.print(i+2);
        Serial.print(" ");
        Serial.println(digitalRead(i+2));
      }
      else{
        Serial.print(i+2);
        Serial.print(" ");
        Serial.println(analogRead(i+2));
      }
    }
  }
}
......

And if anyone is familiar with Max, what I THINK I need to do is increase the spray number of outputs to 100 and assign outputs to the pins I want to use (82 through 97 according to the pin map).

Any suggestions would help. Thanks!