Hi All,
Since i play bass and guitar I thought that I would try to make a tuner but I recently moved and have not setup my workbench yet so I decided to start with the software side of things. Many existing projects use this nifty little algorithm called Yin to estimate the fundamental frequency (Fo) so I decided to port it over to the teensy. Well, to my surprise there was already a c++ library out their but the only problem was it was real slow to converge on the Fo. When I mean slow it took seconds to process the samples sometimes so I rewrote the library which greatly sped up the algorithm. I also reduced the size of the huge floating point array it used to hold the difference data. Until this point I was using the Audio library to simulate a sine wave on a second teensy at different frequencies to test it out and I thought I should just make Yin Audio object as well. This allowed me to use one teensy and feed it directly with the AudioSynthWaveformSine object to test. Now the crux of the issue is that even with my speed up it is still to slow to use in the update function so I put the algorithm in the read function. It works fine like this but from all the other Audio objects it seems like most of the processing should be in the update function so not slow down user code? This would get rid of the data buffer I have too in the library. Well, here is the my feeble attempt at making a new object and was hoping for some pointers on how to best implement it. I tried to document it as best as possible. I based it off the analyze_tonedetect object.
see github for the latest code.
I know there is Goertzel algorithm (analyze_tonedetect) but it will not work for the low frequencies of the bass and guitar.
I have some examples too of actual guitar notes (open tuning) in wav format that I converted using labview (yes labview for the haters out their) but not going to post here, I'll put all this up on my Github account once I finalize some stuff.
Since i play bass and guitar I thought that I would try to make a tuner but I recently moved and have not setup my workbench yet so I decided to start with the software side of things. Many existing projects use this nifty little algorithm called Yin to estimate the fundamental frequency (Fo) so I decided to port it over to the teensy. Well, to my surprise there was already a c++ library out their but the only problem was it was real slow to converge on the Fo. When I mean slow it took seconds to process the samples sometimes so I rewrote the library which greatly sped up the algorithm. I also reduced the size of the huge floating point array it used to hold the difference data. Until this point I was using the Audio library to simulate a sine wave on a second teensy at different frequencies to test it out and I thought I should just make Yin Audio object as well. This allowed me to use one teensy and feed it directly with the AudioSynthWaveformSine object to test. Now the crux of the issue is that even with my speed up it is still to slow to use in the update function so I put the algorithm in the read function. It works fine like this but from all the other Audio objects it seems like most of the processing should be in the update function so not slow down user code? This would get rid of the data buffer I have too in the library. Well, here is the my feeble attempt at making a new object and was hoping for some pointers on how to best implement it. I tried to document it as best as possible. I based it off the analyze_tonedetect object.
see github for the latest code.
I know there is Goertzel algorithm (analyze_tonedetect) but it will not work for the low frequencies of the bass and guitar.
I have some examples too of actual guitar notes (open tuning) in wav format that I converted using labview (yes labview for the haters out their) but not going to post here, I'll put all this up on my Github account once I finalize some stuff.
Last edited: