Can you simplify the check_what_channel function by replacing it with:
void check_what_channel() {
pot_val=analogRead(pot_pin); // analog reading the 10K pot
channel = map(pot_val, 0, 1023, 1, 128);
}
Note, there was an error in the map function that may or may not have been fixed in the core...