Please rate my midi controller code

Hi guys, first post, and first arduino project. I'm quite pleased with how it's turned out because i guessed/googled a lot of it. It all works as intended but I have a feeling the code is a big messy spiders nest. Do any major alarm bells ring when you look at it? I'm not 100% clear on what order I should have put everything in or if there's a more elegant way of doing it. To summarise:

One switch is a 'bank up' which cycles through 6 banks of 4 (ie 24 program changes total). The other switch cycles through 4 patches depending on what bank is selected ie 1-4 or 5-8 etc. The final switch sends out midi expression data up to maximum and back down again and lights an led accordingly. The pot covers the time for this. I mapped it to short values for the first half of the pot and long values for the second half.

The only other twist is that for the penultimate bank the momentary switch sends a control for fx on/off instead of expression, and the final bank sends an fx on signal, then ramps up the expression, back down again then an fx off signal at the end. So any advice on making the code neater would be great. Thanks!

[code]
#include <MIDI.h>

MIDI_CREATE_DEFAULT_INSTANCE();
byte patchNum = 0;
byte bankNum = 0;
byte expNum = 0;

int led_ping = 6;      //Initializing LED Pin g
int led_pinr = 5;      //Initializing LED Pin r
int sensorPin = A0;    // select the input pin for the potentiometer
int sensorValue = 0;  // variable to store the value coming from the sensor
int adjustedValue = 0; //variablefor the ramp time increment
int bank6Time = 15000; //max time increment for expression
int yellowfade= map(expNum, 0, 127, 63, 255);
int switchdelay = 300;
boolean momentaryon;
boolean momexon;

void setup()
 
 {
  
  pinMode(led_ping, OUTPUT); //Declaring LED pin as output
  pinMode(led_pinr, OUTPUT); //Declaring LED pin as output

pinMode (2, INPUT_PULLUP);
pinMode (3, INPUT_PULLUP);
pinMode (4, INPUT_PULLUP);
MIDI.begin(MIDI_CHANNEL_OMNI);
  //Serial.begin(9600);
    MIDI.sendProgramChange (0, 1);
    for (int i = 0; i <= 3; i++) {
    analogWrite (led_pinr, 255); //three red leds to show startup
    delay (100);
    analogWrite (led_pinr, 0);
    delay (100);
   }
        analogWrite (led_ping, 255); //turn green led on for default
}

void loop() {
    
  sensorValue = analogRead(sensorPin); // read the value from the sensor:
  //Serial.println (sensorValue*10);
  
   // expression logic

   if (digitalRead(4) == LOW &&bankNum <4 &&expNum <127 &&sensorValue >0 &&sensorValue <512) 
  { expNum++; 
    MIDI.sendControlChange (1, expNum, 1);
    analogWrite (led_pinr, (expNum*2));
    analogWrite (led_ping, 255-(expNum*2));
   //Serial.println ((String) "Expression number"+expNum);
  adjustedValue = map( sensorValue, 0, 511, 0, 2000);
  delayMicroseconds (adjustedValue);}
  
   if (digitalRead(4) == HIGH &&bankNum <4 &&expNum >0 &&sensorValue >0 &&sensorValue <512) 
  { expNum--; 
    MIDI.sendControlChange (1, expNum, 1);
    analogWrite (led_pinr, (expNum*2));
    analogWrite (led_ping, 255-(expNum*2));
   //Serial.println ((String) "Expression number"+expNum);
   adjustedValue = map( sensorValue, 0, 511, 0, 2000);
  delayMicroseconds (adjustedValue);}

     if (digitalRead(4) == LOW &&bankNum <4 &&expNum <127 &&sensorValue >511) 
  { expNum++; 
    MIDI.sendControlChange (1, expNum, 1);
    analogWrite (led_pinr, (expNum*2));
    analogWrite (led_ping, 255-(expNum*2));
   //Serial.println ((String) "Expression number"+expNum);
  adjustedValue = map( sensorValue, 512, 1023, 2000, 12000);
  delayMicroseconds (adjustedValue);}
  
   if (digitalRead(4) == HIGH &&bankNum <4 &&expNum >0 &&sensorValue >511) 
  { expNum--; 
    MIDI.sendControlChange (1, expNum, 1);
    analogWrite (led_pinr, (expNum*2));
    analogWrite (led_ping, 255-(expNum*2));
   //Serial.println ((String) "Expression number"+expNum);
   adjustedValue = map( sensorValue, 512, 1023, 2000, 12000);
  delayMicroseconds (adjustedValue);}

     if (digitalRead(4) == LOW &&bankNum <4 &&sensorValue == 0) 
  { 
    MIDI.sendControlChange (1, 127, 1);
    analogWrite (led_pinr, (255));
    analogWrite (led_ping, (0));
}
     if (digitalRead(4) == HIGH &&bankNum <4 &&sensorValue == 0) 
  { 
    MIDI.sendControlChange (1, 0, 1);
    analogWrite (led_pinr, (0));
    analogWrite (led_ping, (255));}

//expression momentary logic bank 5

    if (digitalRead(4) == LOW &&bankNum ==4 &&momentaryon == false)
  {  
    MIDI.sendControlChange (11, 127, 1);
    momentaryon = true;
    analogWrite (led_pinr, 255);
    analogWrite (led_ping, 0);
    delay (50);
   //Serial.println ((String) "FX on");
  }
  if (digitalRead(4) == HIGH &&bankNum ==4 &&momentaryon == true  )
  {  
    MIDI.sendControlChange (11, 0, 1);
    momentaryon = false;
    analogWrite (led_pinr, 63);
    analogWrite (led_ping, 255);
    delay (50);
    }
   //Serial.println ((String) "FX off");

//expression and momentary logic bank 6

   if (digitalRead(4) == LOW &&bankNum ==5 &&expNum ==0 &&momexon == true) 
  { MIDI.sendControlChange (11, 127, 1);
  momexon = false;
    expNum++; 
    MIDI.sendControlChange (1, expNum, 1);
   analogWrite (led_pinr, yellowfade);
    analogWrite (led_ping, 255-(expNum*2));
   //Serial.println ((String) "Expression number"+expNum);
  adjustedValue = map( sensorValue, 0, 1023, 0, bank6Time);
  delayMicroseconds (adjustedValue);}
  
     if (digitalRead(4) == LOW &&bankNum ==5 &&expNum >0 &&expNum <127) 
  { expNum++; 
    MIDI.sendControlChange (1, expNum, 1);
   analogWrite (led_pinr, yellowfade);
    analogWrite (led_ping, 255-(expNum*2));
   //Serial.println ((String) "Expression number"+expNum);
  adjustedValue = map( sensorValue, 0, 1023, 0, bank6Time);
  delayMicroseconds (adjustedValue);}

     if (digitalRead(4) == HIGH &&bankNum ==5 &&expNum ==0 &&momexon == false) 
  { MIDI.sendControlChange (11, 0, 1);
  momexon = true;
   }
  
     if (digitalRead(4) == HIGH &&bankNum ==5 &&expNum >0) 
  { expNum--; 
    MIDI.sendControlChange (1, expNum, 1);

    analogWrite (led_pinr, yellowfade);
    analogWrite (led_ping, 255-(expNum*2));
   //Serial.println ((String) "Expression number"+expNum);
  adjustedValue = map( sensorValue, 0, 1023, 0, 12000);
  delayMicroseconds (adjustedValue);}

//bank 0 logic

if (digitalRead(3) == LOW &&patchNum <3 &&bankNum ==0) 
  { patchNum++; 
    MIDI.sendProgramChange (patchNum, 1);
  Serial.println ((String) "Patch number"+patchNum);
  delay(switchdelay);}
  
if (digitalRead(3) == LOW &&patchNum ==3 &&bankNum ==0) 
  { patchNum = 0; 
    MIDI.sendProgramChange (patchNum, 1);
   Serial.println ((String) "Patch number"+patchNum);
  delay(switchdelay);}
  
  //bank 1 logic

  if (digitalRead(3) == LOW &&patchNum <3 &&bankNum ==1) 
  { patchNum++; 
    MIDI.sendProgramChange ((patchNum+4), 1);
   Serial.println ((String) "Patch number"+(patchNum+4));
  delay(switchdelay);}
  
if (digitalRead(3) == LOW &&patchNum ==3 &&bankNum ==1) 
  { patchNum = 0; 
    MIDI.sendProgramChange ((patchNum+4), 1);
   Serial.println ((String) "Patch number"+(patchNum+4));
  delay(switchdelay);}

  //bank 2 logic

if (digitalRead(3) == LOW &&patchNum <3 &&bankNum ==2) 
  { patchNum++; 
    MIDI.sendProgramChange ((patchNum+8), 1);
  Serial.println ((String) "Patch number"+(patchNum+8));
  delay(switchdelay);}
  
if (digitalRead(3) == LOW &&patchNum ==3 &&bankNum ==2) 
  { patchNum = 0; 
    MIDI.sendProgramChange ((patchNum+8), 1);
   Serial.println ((String) "Patch number"+(patchNum+8));
  delay(switchdelay);}
  
  //bank 3 logic

  if (digitalRead(3) == LOW &&patchNum <3 &&bankNum ==3) 
  { patchNum++; 
    MIDI.sendProgramChange ((patchNum+12), 1);
   Serial.println ((String) "Patch number"+(patchNum+12));
  delay(switchdelay);}
  
if (digitalRead(3) == LOW &&patchNum ==3 &&bankNum ==3) 
  { patchNum = 0; 
    MIDI.sendProgramChange ((patchNum+12), 1);
  Serial.println ((String) "Patch number"+(patchNum+12));
  delay(switchdelay);}

  //bank 4 logic

if (digitalRead(3) == LOW &&patchNum <3 &&bankNum ==4) 
  { patchNum++; 
    MIDI.sendProgramChange ((patchNum+16), 1);
  Serial.println ((String) "Patch number"+(patchNum+16));
  delay(switchdelay);}
  
if (digitalRead(3) == LOW &&patchNum ==3 &&bankNum ==4) 
  { patchNum = 0; 
    MIDI.sendProgramChange ((patchNum+16), 1);
   Serial.println ((String) "Patch number"+(patchNum+16));
  delay(switchdelay);}
  
  //bank 5 logic

  if (digitalRead(3) == LOW &&patchNum <3 &&bankNum ==5) 
  { patchNum++; 
    MIDI.sendProgramChange ((patchNum+20), 1);
   Serial.println ((String) "Patch number"+(patchNum+20));
  delay(switchdelay);}
  
if (digitalRead(3) == LOW &&patchNum ==3 &&bankNum ==5) 
  { patchNum = 0; 
    MIDI.sendProgramChange ((patchNum+20), 1);
   Serial.println ((String) "Patch number"+(patchNum+20));
  delay(switchdelay);}
  
  //bank logic
  
if (digitalRead(2) == LOW &&bankNum ==0) {
  bankNum++;
  MIDI.sendProgramChange ((bankNum*4), 1); 
  patchNum = 0;
   analogWrite (led_pinr, 0);
   analogWrite (led_ping, 255);
Serial.println ((String) "Bank number"+bankNum);
  delay(switchdelay);}

  if (digitalRead(2) == LOW &&bankNum ==1) {
  bankNum++;
  MIDI.sendProgramChange ((bankNum*4), 1); 
  patchNum = 0;
   analogWrite (led_pinr, 0);
   analogWrite (led_ping, 255);
Serial.println ((String) "Bank number"+bankNum);
  delay(switchdelay);}

    if (digitalRead(2) == LOW &&bankNum ==2) {
  bankNum++;
  MIDI.sendProgramChange ((bankNum*4), 1); 
  patchNum = 0;
   analogWrite (led_pinr, 0);
   analogWrite (led_ping, 255);
Serial.println ((String) "Bank number"+bankNum);
  delay(switchdelay);}

    if (digitalRead(2) == LOW &&bankNum ==3) {
  bankNum++;
  MIDI.sendProgramChange ((bankNum*4), 1); 
  patchNum = 0;
   analogWrite (led_pinr, 63);
   analogWrite (led_ping, 255);
Serial.println ((String) "Bank number"+bankNum);
  delay(switchdelay);}

    if (digitalRead(2) == LOW &&bankNum ==4) {
  bankNum++;
  MIDI.sendProgramChange ((bankNum*4), 1); 
  patchNum = 0;
   analogWrite (led_pinr, 63);
   analogWrite (led_ping, 255);
Serial.println ((String) "Bank number"+bankNum);
  delay(switchdelay);}

if (digitalRead(2) == LOW &&bankNum == 5) {
  bankNum = 0;
  MIDI.sendProgramChange ((bankNum*4), 1); 
  patchNum = 0;
     analogWrite (led_pinr, 0);
   analogWrite (led_ping, 255);
Serial.println ((String) "Bank number"+bankNum);
  delay(switchdelay);}}
[/code]