To take out frequencies out of the signal use Fast Fourier Transform FFT library - google it and understand what it does.

The library i recomend for arduino is FHT library

linkIn the pasted link you will find code example on how to use it.

Learn what sampling rate and nyquist frequency is.

What you want to do is to detect 12 musical tones out of few guitar octaves.

Check table with

tone frequenciesYou can also find a formula to calculate notes in each octave:

frequency calculation formulaFht will give you FHT_SIZE/2 bins of output data which can be calculated into frequencies from the formula:

bin_freq = sampling_rate * bin_nb / FHT_SIZE

Read library description as there are few output types like linear, logarithmic, etc...

The bigger sampling rate is, the more bandwidth is sampled (bandwidth from 0 to SR/2 Hz), but

each bin width is greater too so you loose on frequency resolution.

In my project i use sampling rate = 1760 as the max frequency is 880 Hz which gives me decent resolution to detect sounds from the beggining of the fretboard.

Now i met a lot of code examples in which sampling is done in main loop. If program does only this its ok, it works, but don't be a noob and use timer interrupt to do proper sampling. Otherwise if your program does something else than sampling and processing, for example you add some interrupt handlers for some external communication signals - your sampling rate may change - or you may sample not in right moments, so the FHT output will be distorted.

Hope it helps, keep on diggin !