I think you will want to reduce the existing track proportionally to the incoming track.
What I do is reduce the guitar track, mix it with the recorded track at unity gain and record the mix again. This way, the recorded track is in fact reduced as well. This way both tracks keep the same level and there is no attenuation when re-recording. But of course this does not avoid clipping after a big number of overdubs. I need to investigate a little more on this.
Is the write speed on the SD card fast enough for 16 bit processing? I was under the impression that you couldn't write that quickly to SD cards since you need to write large chunks of data at a time rather than streaming it in.
This was the main intention of the proof of concept, test if the read/write speed is enough, and so far it's been positive. I'm recording at 16 bits and 25Khz (unless my math is wrong with the ADC configuration), and in chunks of 512 Bytes (this is the minimum block size). I can't hear any artifact due to lost samples, so I guess the speed is enough.
You have to read and write 512+512 Byes in the time you need to play 256 samples (around 10.4 ms), so you need an overall transfer rate of around 20KB/s, which seems achievable (I've seen some people in the net having much higher write transfer rates)
And you have to consider that most of the read/write time is wasted when accessing (the access time is usually bad), so by working with bigger buffers I could probably achieve higher rates (and some more latency). Probably the fastest setup would be to use DMA and write around 8 blocks at a time. If you just need to record (and not play), you can continuously "stream" data to the card as well.
BTW, in order to get the maximum speed I'm accessing the SD card sectors directly, without any filesystem (I'm not using the FAT library from Microchip).
Mat