farmaker47 / Pitch_Estimator

Music Pitch detection using Tensorflow SPICE model.
72 stars 18 forks source link

Pitch_Estimator

Music Pitch detection using Tensorflow SPICE model.

Pitch is a perceptual property of sounds that allows their ordering on a frequency-related scale, or more commonly, pitch is the quality that makes it possible to judge sounds as “higher” and “lower” in the sense associated with musical melodies. Pitch is a major auditory attribute of musical tones, along with duration, loudness, and timbre, is quantified by frequency and measured in Hertz (Hz), where one Hz corresponds to one cycle per second.

Pitch detection is an interesting challenge. Historically, the study of pitch and pitch perception has been a central problem in psychoacoustics, and has been instrumental in forming and testing theories of sound representation, signal-processing algorithms, and perception in the auditory system. A lot of techniques have been used for this purpose. Efforts have also been made to separate the relevant frequency from background noise and backing instruments.

Today, we can do that with machine learning, more specifically with the SPICE model (SPICE: Self-Supervised Pitch Estimation). This is a pretrained model that can recognize the fundamental pitch from mixed audio recordings (including noise and backing instruments).The model is available to use through TensorFlow Hub, on the web with TensorFlow.js and on mobile devices with TensorFlow Lite.

You can follow along with this Colab notebook.

Note: Application saves audio file in .wav format inside phone's internal storage memory in Pitch Detector folder so anyone can compare results with colab notebook output. For this purpose and for this demo version of the application, writing internal storage permission is mandatory for app to work!

Demo of the project

Screenshot