In order to isolate parts I breadboarded just what you see on the schematic:
If I generate a constant clock signal with the Atmega it's not heard, only Midi input from external device.
I placed a 10uF on pin 7 and I realized the midi clicks were attenuated, so I put a 1000uF and they are gone now!!
That part is solved.
Now testing the entire synth, that has also a LPF and a Delay (not in schematic):
I can listen to the clicks in all stages, on LPF output I hear them until the cutoff it's closed. On Delay output I can hear the LPF's clicks plus clicks on the Delay itself.
I placed a gigantic 3300uF on +5 and GND and the clicks got lowered a little! the Delay clicks are gone, but they still sound on the LPF when the cutoff it's opened.
The LPF works with +9V and GND, so that's why I think it didn't got affected by the capacitor.
Also now midi generated from INSIDE Atmega are heard and not attenuated by the cap (tried several places)
Errors on the PCB design I realized now:
* There are islands of copper pour which are not connected to anything
* I didn't separated DIGITAL GND from ANALOG GND (to join them only at the power supply in star topography)
* It seems that didn't decouple enough (with high value capacitors)
My question is, could the clicks of MIDI Input and Output be because of these 3 errors? Should I redo the PCB?