OK, so i've seen a lot of posts asking how to make a Music/Guitar tuner and so on........and oddly enough, a few days ago i was asked by a work collegue if *I* could make a Guitar tuner for him.
My immediate response (including lots of swearing) was "Go buy one, it'll be 100 times cheaper than me working out the code, and mine might not even work".
It then got me thinking about HOW i would achieve such a project.
If anything, it's just a self-satisfaction project to prove if it could be done and accuare too....
I don't think i can find any good reason why i would prefer my own picaxe tuner versus a professional/DSP/super accurate tuner for a measly $50-$200....well, other than bragging rights or something.
My FIRST concern coming to mind is the complete lack of NICE numbers in the musical frequencies to work with.
Besides 'A' which seems to be the only note with a perfectly evenly multiplying number throughout the octaves, all other notes are fractional values.
For example:
A = 440Hz
A# = 466.16 Hz,
B = 493.88 Hz,
C = 523.25 Hz, etc.
My next thought would be to simply multiply the frequency x 100 to get rid of the decimal fraction, so 'Note C' at 523.25Hz would now become 52325, a nice non-fractional number to work with.
I guess using the 'count' command would be the main way to sample a frequency for a given period of 1-5 seconds to find a nice stable average frequency to work with.
Obviously the analog guitar signal right at the beginning is going to be a mess of harmonics, but i'm sure buffering the analog signal and then feeding it through a schmitt trigger to square it up might be my first step to approaching a cleaner digital signal to work within the picaxe realm.
I now wonder if maybe i would use a reference oscillator (let's use 'middle C' for example to match the note/string that i'm trying to tune) and then the guitar signal would be schmitt gated to square it up and then AND gated with the Oscillators signal ('middle C') into a 2nd schmitt trigger, this would almost guarantee the majority of the natural 'C note' signal is now being dealt with into the picaxe and not all the harmonics rubbish.
This is about as far as i got by just 'thinking' about how i might approach it, if i was to go further and build something together.
Anyone up for comments? other than "don't do it" lol ;-)
My immediate response (including lots of swearing) was "Go buy one, it'll be 100 times cheaper than me working out the code, and mine might not even work".
It then got me thinking about HOW i would achieve such a project.
If anything, it's just a self-satisfaction project to prove if it could be done and accuare too....
I don't think i can find any good reason why i would prefer my own picaxe tuner versus a professional/DSP/super accurate tuner for a measly $50-$200....well, other than bragging rights or something.
My FIRST concern coming to mind is the complete lack of NICE numbers in the musical frequencies to work with.
Besides 'A' which seems to be the only note with a perfectly evenly multiplying number throughout the octaves, all other notes are fractional values.
For example:
A = 440Hz
A# = 466.16 Hz,
B = 493.88 Hz,
C = 523.25 Hz, etc.
My next thought would be to simply multiply the frequency x 100 to get rid of the decimal fraction, so 'Note C' at 523.25Hz would now become 52325, a nice non-fractional number to work with.
I guess using the 'count' command would be the main way to sample a frequency for a given period of 1-5 seconds to find a nice stable average frequency to work with.
Obviously the analog guitar signal right at the beginning is going to be a mess of harmonics, but i'm sure buffering the analog signal and then feeding it through a schmitt trigger to square it up might be my first step to approaching a cleaner digital signal to work within the picaxe realm.
I now wonder if maybe i would use a reference oscillator (let's use 'middle C' for example to match the note/string that i'm trying to tune) and then the guitar signal would be schmitt gated to square it up and then AND gated with the Oscillators signal ('middle C') into a 2nd schmitt trigger, this would almost guarantee the majority of the natural 'C note' signal is now being dealt with into the picaxe and not all the harmonics rubbish.
This is about as far as i got by just 'thinking' about how i might approach it, if i was to go further and build something together.
Anyone up for comments? other than "don't do it" lol ;-)