How to change code switch/LED

I have been making a “MIDI Mule”(small MIDI foot controller) by following the
information at Midi Mule – thoro.de.
One problem I have run into is that most of the LEDs don’t light up next to there cosponsoring switch. When I wired it I decided to wire it up with some kind of symmetry and after change the code.
But how I can’t work out how to change the code.
Could someone please show me how I can fix this.
Thanks

My wiring lay out.

Switch LED
D8 D11
D9 D10
D2 A5
D3 A4
D4 A3
D5 A2
D6 A1
D7 A0

#include "Arduino.h"
#include "avdweb_Switch.h"
#include "MIDI.h"

// Define analog pins for LEDs
int ledPin1 = A0;
int ledPin2 = A1;
int ledPin3 = A2;
int ledPin4 = A3;
int ledPin5 = A4;
int ledPin6 = A5;
int ledPin7 = 10; // Workaround, A6 just works as digital input
int ledPin8 = 11; // Workaround, A7 just works as digital input

// Switches
Switch buttonGND1 = Switch(2); // button to GND, use internal 20K pullup resistor
Switch buttonGND2 = Switch(3); // button to GND, use internal 20K pullup resistor
Switch buttonGND3 = Switch(4); // button to GND, use internal 20K pullup resistor
Switch buttonGND4 = Switch(5); // button to GND, use internal 20K pullup resistor
Switch buttonGND5 = Switch(6); // button to GND, use internal 20K pullup resistor
Switch buttonGND6 = Switch(7); // button to GND, use internal 20K pullup resistor
Switch buttonGND7 = Switch(8); // button to GND, use internal 20K pullup resistor
Switch buttonGND8 = Switch(9); // button to GND, use internal 20K pullup resistor

// MIDI init
MIDI_CREATE_DEFAULT_INSTANCE();

void setup() {
// Set serial baud rate: 31200 for MIDI / 9600 for debugging
// Serial.begin(31200);
MIDI.begin(1); // Launch MIDI and listen to channel 1
}

void loop() {
buttonGND1.poll();
if(buttonGND1.released()) {
// Serial.write("Button 1\n");
MIDI.sendProgramChange(0,1); // Send the MIDI command
ledOffAll();
analogWrite(ledPin1, 255);
}
buttonGND2.poll();
if(buttonGND2.released()) {
// Serial.write("Button 2\n");
MIDI.sendProgramChange(1,1); // Send the MIDI command
ledOffAll();
analogWrite(ledPin2, 255);
}
buttonGND3.poll();
if(buttonGND3.released()) {
// Serial.write("Button 3\n");
MIDI.sendProgramChange(2,1); // Send the MIDI command
ledOffAll();
analogWrite(ledPin3, 255);
}
buttonGND4.poll();
if(buttonGND4.released()) {
// Serial.write("Button 4\n");
MIDI.sendProgramChange(3,1); // Send the MIDI command
ledOffAll();
analogWrite(ledPin4, 255);

}
buttonGND5.poll();
if(buttonGND5.released()) {
// Serial.write("Button 5\n");
MIDI.sendProgramChange(4,1); // Send the MIDI command
ledOffAll();
analogWrite(ledPin5, 255);

}
buttonGND6.poll();
if(buttonGND6.released()) {
// Serial.write("Button 6\n");
MIDI.sendProgramChange(5,1); // Send the MIDI command
ledOffAll();
analogWrite(ledPin6, 255);

}
buttonGND7.poll();
if(buttonGND7.released()) {
// Serial.write("Button 7\n");
MIDI.sendProgramChange(6,1); // Send the MIDI command
ledOffAll();
analogWrite(ledPin7, 255);

}
buttonGND8.poll();
if(buttonGND8.released()) {
// Serial.write("Button 8\n");
MIDI.sendProgramChange(7,1); // Send the MIDI command
ledOffAll();
analogWrite(ledPin8, 255);

}
}

void ledOffAll() {
analogWrite(ledPin1, 0);
analogWrite(ledPin2, 0);
analogWrite(ledPin3, 0);
analogWrite(ledPin4, 0);
analogWrite(ledPin5, 0);
analogWrite(ledPin6, 0);
analogWrite(ledPin7, 0);
analogWrite(ledPin8, 0);
}

If you could post your code using a code block that would allow copying the code by those trying to help.

Why don't you just rearrange the pins in the code like this?

// Define analog pins for LEDs
int ledPin1 = 10;   // Workaround, A6 just works as digital input
int ledPin2 = 11;   // Workaround, A7 just works as digital input
int ledPin3 = A5;
int ledPin4 = A4;
int ledPin5 = A3;
int ledPin6 = A2;
int ledPin7 = A1;
int ledPin8 = A0;

// Switches
Switch buttonGND1 = Switch(8);    // button to GND, use internal 20K pullup resistor
Switch buttonGND2 = Switch(9);    // button to GND, use internal 20K pullup resistor
Switch buttonGND3 = Switch(2);    // button to GND, use internal 20K pullup resistor
Switch buttonGND4 = Switch(3);    // button to GND, use internal 20K pullup resistor
Switch buttonGND5 = Switch(4);    // button to GND, use internal 20K pullup resistor
Switch buttonGND6 = Switch(5);    // button to GND, use internal 20K pullup resistor
Switch buttonGND7 = Switch(6);    // button to GND, use internal 20K pullup resistor
Switch buttonGND8 = Switch(7);    // button to GND, use internal 20K pullup resistor

You could substantially reduce the size of your code by using arrays and loops. Also, I was wondering why you don’t configure the LED pins as OUTPUT? Also, couldn’t you just do a digitalWrite to the LED pins?

Firstly ToddL1962 thank you very much.
I have updated the code and all the LEDs are now working in tandem with the switch, fantastic.

ToddL1962 - If you could post your code using a code block that would allow copying the code by those trying to help.

Hutzpah – I had no idea you could do that, I learnt something. Yes I will next time.

ToddL1962 -Why don't you just rearrange the pins in the code like this?

ToddL1962 - You could substantially reduce the size of your code by using arrays and loops. Also, I was wondering why you don't configure the LED pins as OUTPUT? Also, couldn't you just do a digitalWrite to the LED pins?

Hutzpah –I never wrote the code to be honest I wouldn’t no where to start.
Hoping to learn how to this winter.

Again I want to say I appreciate your help very much, Hutzpah