I'm thinking about putting the 'capacitor discharge' emulation into the same interrupt, so something high level like this...
(I will use a variable called previous_sample to store highest ADC sample)
1. does present incoming ADC sample equal (or is greater than) previous_sample.
i)if so previous_sample = present incoming sample .....& retrun
ii) if not, decrement previous_sample by '1' & return
with an ADC sample of 8 bits, the maximum signal sample is 255.....the maximum pseudo discharge time will be the interrupt rate (22khz) * 255, therefore about 12ms (which is nicely tied in with the lowest frequency 'cycle' on a guitar @82Hz)....sound about right?
Bookmarks