Building MIDI-Controller with 60 Faders [noob]

hmmm. In the ATmega168 data sheet there's some info about ADC conversion times per channel, but that depends on some frequency divider settings. Let's see what's used in the arduino code...

ok, in ../hardware/cores/arduino/wiring.c the prescaler for the ADC is set to 128. the cpu data sheet says something about 13 ADC clock cycles per conversion, so 13*128 = 1664 cpu clock cycles. so if I'm not mistaken one pin's conversion should take 100µs.

does anybody know if this really correct ?

switching the pins to control the 4051 is quite fast if you manipulate the I/O port directly.
there's a tutorial for this in the playground. the only problem with this is that "arduino pins" and "cpu ports" overlap
( http://www.arduino.cc/en/Hacking/PinMapping ).

you could switch the pins like this. this should be as fast as the hardware can:

int analog_fader_input_pin = 0; // analog pin 0
byte pin_A = 5; // digital pin 5 --> PORTD pin 5, 5th bit in the byte value of PORTD
byte pin_B = 6; // 6 --> PORTD pin 6
byte pin_C = 7; // 7 --> PORTD pin 7
int data[8] = {0,0,0,0,0,0,0,0}; // array to store 8 analog values from the 4051 mux chip.

void setup(void) {
   // pinMode(...,INPUT); not needed for analog input pins
   pinMode(pin_A,OUTPUT);
   pinMode(pin_B,OUTPUT);
   pinMode(pin_C,OUTPUT);
}


void loop(void) {
 read_mux();
 // do other stuff with the data...
}


void read_mux(void) {
   byte BCD_counter;
   for(BCD_counter = 0; BCD_counter < 8; BCD_counter++) {    // Binary Coded Digit --> 4051 channel select pins A,B,C
      PORTD = (PORTD & B00011111) + (BCD_counter << 5); // keep the lower bits 4...0 and add BCD_counter shifted 5 bits to the left to get to bits 7...5
      data[BCD_counter] = analogRead(analog_fader_input_pin); // read analog fader value (0...1023) and store it in an array
   }
}