Giter Site home page Giter Site logo

sjnyth / guitar-tuner Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 9 KB

Tuning guitar using Discrete Fourier transform and Harmonic Product Specturm

Python 100.00%
guitar music music-theory signal-analysis signal-processing discrete-fourier-transform numpy python sound-device

guitar-tuner's Introduction

Guitar Tuner πŸŽΈβ™―

This program provides a real-time audio pitch detection capabilities using both the Discrete Fourier transform and the Harmonic Product Spectrum method. It analyzes audio input from your microphone and displays the closest musical note along with the corresponding pitch.

Prerequisites πŸ₯

Before you start, ensure you have the following libraries installed:

  • sounddevice
  • numpy
  • scipy
  • tkinter (optional for a graphical user interface)

You can install these libraries using:

pip install sounddevice numpy scipy

Usage 🎹

  1. Clone the repository or download the files DFT_tuner.py and HPS_tuner.py.
  2. Run the script:
python3 DFT_tuner.py

or

python3 HPS_tuner.py
  1. Play a musical note or sound into your microphone.
  2. The application will display the closest musical note and your note pitch vs the closest standard note pitch in the terminal.

How it works? 🎺

  • Discrete Fourier Transform
    1. The application captures audio input and processes the data in chunks.
    2. A DFT is applied to extract the magnitude spectrum and determine the peak frequency.
    3. The closest musical note is calculated based on the detected pitch.
  • Harmonic Product Spectrum
    1. Similar to the DFT-based method, but with additional steps:
    2. The magnitude spectrum undergoes multiple interpolations to increase its resolution.
    3. HPS is applied to the interpolated spectrum to identify the fundamental frequency even in noisy signals.
    4. The closest musical note is calculated based on the detected pitch.

guitar-tuner's People

Contributors

sjnyth avatar

Watchers

 avatar

Forkers

mrkdominik

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.