Help adding switch to MIDI Controller

there is constant trasmitting of CC data all the time,

What you put in will not change that. Unless you have removed the delay( 10 ) line. I said it was crap because it is a very poor way of limiting the number of messages sent. But if you remove it then you will be constantly sending MIDI messages.

I think the problem is that you don't understand the code you have.

What proper code does is to compare the current reading from a pot with the reading of the last time you sent the pot's value as a MIDI message and only sends a MIDI message when it is different.

also had to change the number of analogue inputs to 16 or it wouldn't compile due to the extra controllers in the array...

Again rubbish code that array line should be

int controllers[] = {
  0xE, 0x4A, 0x47, 0x46, 0x49, 0x4B, 0x4C, 0x48, 0xF, 0x11, 0x12, 0x13, 0x4D, 0x4E, 0x4F, 0x10
};

The original code should never have had a line defining the number of bytes in that array.