GithubHelp home page GithubHelp logo

guitartuner's Introduction

🎸Application

This is a guitar tuner app for Android. It utilizes the YIN algorithm for pitch detection, made thanks to this paper. Here's a video showing how it works.

Note

May lag on older phones, works very well on my samsung S10 though. Susceptible to noise! Be careful when tuning, let the note to ring.

This is my first serious programming project. I chose this type of application because its not a common concept, not something that can be easily found as a free and open source app. There are pre-added tunings as well as the ability to add custom ones!

🛠Getting Started

To install the program on you android device, simply download the build file from here and open it on your device. On startup, the app is set to manual E standard tuning. To tune your guitar, simply select the note you want to adjust. On the top, there's an indicator as well as messages for tuning up/down or indicating that the string is OK. You can select another predefined tuning or simply add your own.

🔬How it works

The application was made solely using Java in android studio. The pitch detection algorithm, while not completely handmade, does not use any external libraries.

  • First of all windowing is applied to the signal with a buffer size of 8192, may be too heavy for older devices.
  • After computing the windowed signal, it is sent to the YIN algorithm. It basically works by detecting the lowest frequency fundamental of the signal, as there are several pitch frequencies for music notes.
  • The first step describes the autocorrelation function where the initial signal is compared to itself but from a delayed time period. This way the algorithm can find the highest peak which is going to indicate where the period starts/ends.
  • On the other hand, the cumulative mean normalised difference function helps with improving the imperfect periodicity that may occur due to zero-lag dip problem.
  • Then an absolute threshold is applied so we filter out the frequencies we dont want. The paper suggests a threshold of 0.1 for less errors. As a note is let to ring, it will be cut at a specific amplitude depending on the threshold. There's also octave based thresholding which essentially splits the range into sub octaves and selects the best estimate lag.
  • Next we need to calculate the fundamental frequency of the signal in the correct position, avoiding errors due to noise and disimilar sampling period. This can be done using parabolic interpolation which fits a parabola, resulting in a smoother pitch. It is a very commonly used function in pitch detection algorithms for discrete/digital signals as it fits a parabola between 3 points, essentially creating a curve.

The program has multiple tunings pre-included as well as automatic tuning. Manual tuning is way more accurate than automatic as it checks for a pitch within a certain range from the target note.

Important

There is a notable octave jumping in automatic tuning. This is not a problem with manual tuning because I have set a specific value of cents that the note can range based on the selected string.

example workflow

Manual Tuning

img1

Automatic Tuning

img2

guitartuner's People

Contributors

konliogka avatar

Stargazers

shirako takamoto avatar Haocxx avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.