Live data from Hacker News

Guitar tuner that uses phone accelerometer

tautme.github.io

1–10 of 105 posts

Re: Guitar tuner that uses phone accelerometer

#6
post #5

Anyone got a handle on the algorithm required to do this? I've got a pocketable accelerometer-enabled device I'd like to try to implement this on..

Don't have a handle on it, unfortunately. But the algorithm is in here: https://github.com/tautme/phone-sensors/blob/main/guitar-tun.... Esp. lines 221–257 and 373–417.

Re: Guitar tuner that uses phone accelerometer

#7
post #3
post #2

guitar detuner that uses accelerometer instead of microphone, it doesn't really work, but amazing to see how sensitive they are.

It also shows that it can leak all kinds of other information.

…which is why both Android & iOS put high-frequency access to the accelerometer behind an additional permission AFAIR.

Re: Guitar tuner that uses phone accelerometer

#8
post #5

Anyone got a handle on the algorithm required to do this? I've got a pocketable accelerometer-enabled device I'd like to try to implement this on..

Don't have a handle on it, unfortunately. But the algorithm is in here: https://github.com/tautme/phone-sensors/blob/main/guitar-tun... . Esp. lines 221–257 and 373–417.

Ah, that does look like something I can work with - thanks for the legwork, I will check it out and see if its worthwhile converting to C/C++ for my device ..

Re: Guitar tuner that uses phone accelerometer

#9
post #4

Fun idea and also I didn't know that websites could get access to my accelerometer data. However for me the sample frequency is 50 Hz which is way too low to measure even the lowest string pitch (E2, about 82 Hz).

If you know you have a single frequency close to an actual frequency of interest, you can use the fact you know you're in an aliased band to get a precise frequency estimate.

Re: Guitar tuner that uses phone accelerometer

#10
The neat bit is that it doesn't necessarily need to sample 82 Hz directly. If the sample rate is known and the target is one of a few guitar strings, the aliased peak can still be useful. The tricky part is probably rejecting the wrong alias once the vibration signal gets messy.
Post reply on HN