Guitar MIDI Router/Splitter

Hello everyone, and thanks in advance for reading this and any help you can offer me! I'm new to this stuff and learning as I go. But now I'm stuck and need some advice! I hope that someone can help

I'm building a MIDI controllable guitar effects 4 loop selector, that feeds the output signal directly into a mixer circuit which can be split and reblended. I am using STDP relays to route the loops, tied to a Mega2560 for triggering. The guitar signal doesn't go through the Mega at all, it only snakes through the relays that the Mega is controlling. The box also has two pots that are continuously polled to send CC messages whenever they move. The code is written to only send the MIDI TX from the analogread (a CC value) if the input value changes. I have a rotary encoder programmed so that the rotation of the knob changes which CC is selected. After the Arduino part, the circuit is fed into a mixer circuit containing two TL072s. That's the idea.
It's complete, and the software side of programming the Mega2560 is ok, as far as I can tell. Functionally, the damn thing works.

The problem is that whenever I turn one of the CC pots, I get a short click audible in the guitar signal. The speed of the click is dependant upon how fast I turn the pot. When the pot stops, the clicks also stop. I also get the same click when I turn the rotary encoder.

I've tried removing the splitter/mixer side of the circuit, and the clicks remain. I have a 440uF cap across the 9v power supply lines. I've tried adding a 78L05 circuit in an attempt to decouple the 5v going to the pots and rotary encoder. No change at all. Ground of course connects the power, Mega, and mixer circuit, and this is the only place I can think of where noise is getting in. A .mp3 is attached, the first half is rotating the two analog pots, and then the encoder near the end.

I know that there's a lot to improve with routing of the wires, I thought that maybe I was getting signal noise seeping through to a ground wire somewhere. I haven't been able to get any kind of change (better or worse) through rerouting or moving of wires.

How can I get rid of these clicks seeping into the analog audio signal?
Thanks very much!

digital (270 KB)

The noise can be eliminated by commenting out the lines here to set the LCD display. Removing just the MIDI.sendControlChange has no effect, so I guess the TX activity isn't the source of the problem. The rotary encoder still clicks when these lines are commented out.

void ped1update () {

 MIDI.sendControlChange((PedCc1[Prgm]), (PedVal1), 1);

  lcd.setCursor(17, 0);
  lcd.print("   ");
  lcd.setCursor(17, 0);
  oldval1 = PedVal1;

void ped2update () {

  MIDI.sendControlChange((PedCc2[Prgm]), (PedVal2), 1);
  lcd.setCursor(17, 1);
  lcd.print("   ");
  lcd.setCursor(17, 1);
  oldval2 = PedVal2;

It seems that the noise associated with the pots is tied to the updating the LCD display. How can I filter out that noise?

How can I get rid of these clicks seeping into the analog audio signal?

Keep the LCD wiring grouped together and as far away as possible from the audio input.
Add extra supply decoupling on the LCD board.
Reduce the input impedance of any audio amplifier.

Thanks very much.
Any suggestions for a decoupling circuit on the display power line? I tried a 78L05 and it didn't help.
How to reduce input impedance?

Adding a buffer pedal in front got rid of the noise. I'l add an internal buffer to take care of the problem permanently.

I think you need to start again with that wiring job, making it much neater, and using only shielded cable
for the audio signals. In particular you need to route the wires in groups, keeping analog away from
digital, and ensuring each group has ground wire(s) in it for the return currents.

The "rats nest" style of wiring is notorious for crosstalk and noise.

Ribbon cable can be very useful for grouping digital signals and helping neaten up the harness.