Guitar Tuner with Native Android Technologies
Vääräniemi, Henri (2025)
Vääräniemi, Henri
2025
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2025112629996
https://urn.fi/URN:NBN:fi:amk-2025112629996
Tiivistelmä
The purpose of this thesis was to create a guitar tuner app for Android devices. The app monitors audio coming in from the device’s microphone and converts that to a frequency using a pitch detection algorithm. The measured frequency is then compared to the selected tuning and the nearest note; the possible pitch difference is then displayed on screen. Additionally, the user can set a customizable tuning.
To determine the best choice for the pitch detection algorithm, several timedomain and frequency-domain methods were tested. Tested methods included Autocorrelation, Zero-Crossing Rate, Average Magnitude Difference Function (AMDF), YIN, McLeod Pitch Method (MPM), Fast Fourier Transform (FFT), and Harmonic Product Spectrum (HPS). The testing showed that autocorrelation worked the best, having the least amount of issues in estimating the frequency. Other tested methods displayed octave errors or fluctuating values making them suboptimal choices. Many of the advanced algorithms can be considered refinements of the autocorrelation method. AMDF, YIN and MPM modify the basic autocorrelation function adding steps to reduce specific errors, adding more to the complexity of the algorithm. The simplicity of autocorrelation ended up being one its benefits with ease of use and performance.
The application was built with Kotlin using Android Studio. Audio input is handled with Android’s AudioRecord API. User interface for the tuner was implemented with Jetpack Compose.
The goals of the project were to develop a functional guitar tuner and the evaluation of multiple pitch detection algorithms to determine the most suitable one for a tuner application. Both objectives were achieved, creating a functioning tuner application with customizable tuning, and the analysis of the algorithms leading to selecting autocorrelation for the project.
To determine the best choice for the pitch detection algorithm, several timedomain and frequency-domain methods were tested. Tested methods included Autocorrelation, Zero-Crossing Rate, Average Magnitude Difference Function (AMDF), YIN, McLeod Pitch Method (MPM), Fast Fourier Transform (FFT), and Harmonic Product Spectrum (HPS). The testing showed that autocorrelation worked the best, having the least amount of issues in estimating the frequency. Other tested methods displayed octave errors or fluctuating values making them suboptimal choices. Many of the advanced algorithms can be considered refinements of the autocorrelation method. AMDF, YIN and MPM modify the basic autocorrelation function adding steps to reduce specific errors, adding more to the complexity of the algorithm. The simplicity of autocorrelation ended up being one its benefits with ease of use and performance.
The application was built with Kotlin using Android Studio. Audio input is handled with Android’s AudioRecord API. User interface for the tuner was implemented with Jetpack Compose.
The goals of the project were to develop a functional guitar tuner and the evaluation of multiple pitch detection algorithms to determine the most suitable one for a tuner application. Both objectives were achieved, creating a functioning tuner application with customizable tuning, and the analysis of the algorithms leading to selecting autocorrelation for the project.
