I don't have a guitar but I can tap on my desk, and that seems to result in random notes. Maybe there's a way to improve the detection so it knows it's a guitar note?
A whistle or clean guitar string pluck would have one strong tone, and a random banging noise would have many tones overlapping. Typically a digital guitar tuner is just doing a discrete Fourier transform of a sound sample and checking the frequency of the most dominant tone in that sound. Sure it's possible check the signal for tone clarity, such as count how many discrete Fourier components are in the sound sample and their relative strength, where fewer strong components is a cleaner tone.
... but is it really worth it in this case? No, because guitar tuner apps are cheap and plentiful, and electric guitar players use an inline tuner rather than a tuner with a microphone. And for tuners with microphones I get annoyed when the tuner doesn't respond so I prefer a tuner that doesn't try to be too smart and filter out too much.
This is really just a cool example of audio signal processing in javascript (or I suppose we call it "HTML5" nowadays)
hoddez: this is a non-issue and a poor suggestion, please ignore this advice and continue to make great things. I doubt anybody has ever had trouble tuning their guitar because they accidentally tapped their desk instead of strumming their guitar, subsequently getting lost in a pool of confusion. Just doesn't happen, so no point in building a solution to that 'problem'.
Sometimes people go out of their way to find flaws with a service - this is one of those times.
Stand alone electric tuners can also confuse ambient sound for notes. I suspect if guitar detection were desirable and easy to implement, someone would have done it already.
You can sing "do, re, mi, fa, so, la, di", you've probably heard it before somewhere. If you do it right, every word you sing should result in the letter changing up the alphabet more or less. Doesn't matter if you're notes aren't very true, or that you don't start at the right frequency, I guarantee that you will get the relative distances close to right, and the tuner will have you believe it ;)
... but is it really worth it in this case? No, because guitar tuner apps are cheap and plentiful, and electric guitar players use an inline tuner rather than a tuner with a microphone. And for tuners with microphones I get annoyed when the tuner doesn't respond so I prefer a tuner that doesn't try to be too smart and filter out too much.
This is really just a cool example of audio signal processing in javascript (or I suppose we call it "HTML5" nowadays)