detect which button is pressed and use that value in switch statement?

When you start numbering variables, that's a sure sign that you need arrays.

When you copy and paste code to change only the number in the name, that's another sign that arrays would lead to a for loop, instead of copy/paste/paste/paste/oh-shit-forgot-to-change-that-number/paste/paste crap.

You almost certainly DO want the state change detection code that you commented out.

You could almost certain have ONE channel() function, taking an argument (that happens to match the for loop/array index), with just a little thought, and 80% less code (and bug hiding places) than you have now.